A191770 Lim f(f(...f(n)...)) where f(n) is the fractal sequence A022446.
1, 2, 3, 1, 1, 2, 1, 3, 1, 1, 2, 2, 1, 1, 3, 1, 3, 1, 1, 2, 2, 1, 1, 1, 3, 1, 3, 1, 2, 1, 2, 2, 2, 1, 1, 1, 1, 3, 1, 3, 1, 1, 3, 2, 1, 2, 1, 2, 2, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 3, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 3, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 3
Offset: 1
Keywords
Examples
Write the counting numbers and A022446 like this: 1..2..3..4..5..6..7..8..9..10..11..12..13..14..15.. 1..2..3..1..4..2..5..8..1..4...6...2...7...5...3... It is then easy to check composites: 1->1, 2->2, 3->3, 4->1, 5->4->1, 6->2, 7->5->4->1,...
Links
- Wikipedia, Fractal sequence
Programs
-
Mathematica
g[n_] := Length[Select[Table[FixedPoint[i + PrimePi[#] + 1 &, i + PrimePi[i] + 1], {i, n}], # <= n &]]; f[n_] := PrimePi[NestWhile[g, n, ! PrimeQ[#] && # != 1 &]] + 1; Array[f, 80] (* A022446 *) h[n_] := Nest[f, n, 40]; t = Table[h[n], {n, 1, 300}] (* A191770 *) Flatten[Position[t, 1]] (* A191771 *) Flatten[Position[t, 2]] (* A191772 *) Flatten[Position[t, 3]] (* A191773 *)
Comments