login
Fractalization of the prime marker sequence A089026.
3

%I #17 Nov 07 2017 18:36:22

%S 1,1,2,1,2,3,4,1,2,3,4,1,2,3,5,6,4,1,2,3,5,6,4,1,2,3,5,7,8,6,4,1,2,3,

%T 5,7,9,8,6,4,1,2,3,5,7,10,9,8,6,4,1,2,3,5,7,10,9,8,6,4,1,2,3,5,7,11,

%U 12,10,9,8,6,4,1,2,3,5,7,11,12,10,9,8,6,4,1,2,3,5,7,11,13,14,12

%N Fractalization of the prime marker sequence A089026.

%C See A194959 for a discussion of fractalization and the interspersion fractally induced by a sequence. (The prime marker sequence A089026 is defined by p(n)=n if n is prime and p(n)=1 otherwise.)

%H G. C. Greubel, <a href="/A195183/b195183.txt">Table of n, a(n) for n = 1..5000</a>

%t Table[p[n], {n, 1, 90}] (* A089026 *)

%t g[1] = {1}; g[n_] := Insert[g[n - 1], n, p[n]]

%t f[1] = g[1]; f[n_] := Join[f[n - 1], g[n]]

%t f[20] (* A195183 *)

%t row[n_] := Position[f[30], n];

%t u = TableForm[Table[row[n], {n, 1, 5}]]

%t v[n_, k_] := Part[row[n], k];

%t w = Flatten[Table[v[k, n - k + 1], {n, 1, 13}, {k, 1, n}]] (* A195184 *)

%t q[n_] := Position[w, n]; Flatten[Table[q[n], {n, 1, 80}]] (* A195185 *)

%Y Cf. A194959, A089026, A195184, A195185.

%K nonn

%O 1,3

%A _Clark Kimberling_, Sep 10 2011