cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A022447 Fractal sequence of the dispersion of the primes.

This page as a plain text file.
%I A022447 #33 May 20 2019 14:49:50
%S A022447 1,1,1,2,1,3,2,4,5,6,1,7,3,8,9,10,2,11,4,12,13,14,5,15,16,17,18,19,6,
%T A022447 20,1,21,22,23,24,25,7,26,27,28,3,29,8,30,31,32,9,33,34,35,36,37,10,
%U A022447 38,39,40,41,42,2,43,11,44,45,46,47,48,4,49,50,51,12,52,13,53,54,55,56,57,14
%N A022447 Fractal sequence of the dispersion of the primes.
%D A022447 C. Kimberling, Fractal sequences and interspersions, Ars Combinatoria, vol. 45, p. 157, 1997.
%H A022447 G. C. Greubel, <a href="/A022447/b022447.txt">Table of n, a(n) for n = 1..10000</a>
%H A022447 Sean A. Irvine, <a href="https://github.com/archmageirvine/joeis/blob/master/src/irvine/oeis/a022/A022447.java">Java program</a> (github)
%H A022447 C. Kimberling, <a href="http://faculty.evansville.edu/ck6/integer/intersp.html">Interspersions</a>
%e A022447 From _Sean A. Irvine_, May 20 2019: (Start)
%e A022447 The prime counting function, pi(n), is iterated (possibly zero times) until a nonprime is reached.  If the result of this iteration is m, then a(n) = m - pi(m).  Examples:
%e A022447 n=11: pi(11)=5, pi(5)=3, pi(3)=2, pi(2)=1. Hence, m=1 and so a(11) = 1-pi(1) = 1.
%e A022447 n=12: is already nonprime, hence m=12 and so a(12) = 12-pi(12) = 7.
%e A022447 n=13: pi(13)=6 (a nonprime), hence m=6 and so a(13) = 6-pi(6) = 3.
%e A022447 (End)
%t A022447 m = 30; list = Table[Length[NestWhileList[PrimePi, n, PrimeQ]], {n, m}]; Table[Length@Position[Take[list, k], list[[k]]], {k, Length[list]}] (* _Birkas Gyorgy_, Apr 04 2011 *)
%t A022447 primefractal[n_]:= (# - PrimePi[#]) &@NestWhile[PrimePi, n, PrimeQ]; Array[primefractal, 30] (* _Birkas Gyorgy_, Apr 04 2011 *)
%Y A022447 Cf. A000720, A022446, A114537, A114538, A114577.
%K A022447 nonn
%O A022447 1,4
%A A022447 _Clark Kimberling_
%E A022447 Terms a(67) onward added by _G. C. Greubel_, Feb 28 2018
%E A022447 Offset corrected by _Sean A. Irvine_, May 20 2019