login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


Number of steps in the prime index chain for the n-th prime.
64

%I #31 Mar 16 2020 17:26:45

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

%T 1,1,2,1,1,1,3,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,4,1,2,1,1,1,1,1,3,1,

%U 1,1,2,1,2,1,1,1,1,1,2,1,1,1,3,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,2,1,2,1,1

%N Number of steps in the prime index chain for the n-th prime.

%C Let p(k) = k-th prime, let S(p) = S(p(k)) = k, the subscript of p; a(n) = order of primeness of p(n) = 1+m where m is largest number such that S(S(..S(p(n))...)) with m S's is a prime.

%C The record holders correspond to A007097.

%H N. Fernandez, <a href="/A049076/b049076.txt">Table of n, a(n) for n = 1..500</a>

%H N. Fernandez, <a href="http://www.borve.org/primeness/FOP.html">An order of primeness, F(p)</a>

%H N. Fernandez, <a href="/A006450/a006450.html">An order of primeness</a> [cached copy, included with permission of the author]

%H N. Fernandez, <a href="http://www.borve.org/primeness/intro.html">The Exploring Primeness Project</a>

%F Let b(n) = 0 if n is nonprime, otherwise b(n) = k where n is the k-th prime. Then a(n) is the number of times you can apply b to the n-th prime before you hit a nonprime.

%F a(n) = 1 + A078442(n). - _R. J. Mathar_, Jul 07 2012

%F a(n) = A078442(A000040(n)). - _Alois P. Heinz_, Mar 16 2020

%e 11 is 5th prime, so S(11)=5, 5 is 3rd prime, so S(S(11))=3, 3 is 2nd prime, so S(S(S(11)))=2, 2 is first prime, so S(S(S(S(11))))=1, not a prime. Thus a(5)=4.

%e Alternatively, a(5) = 4: the 5th prime is 11 and its prime index chain is 11->5->3->2->1->0. a(6) = 1: the 6th prime is 13 and its prime index chain is 13->6->0.

%p A049076 := proc(n)

%p if not isprime(n) then

%p 1 ;

%p else

%p 1+procname(numtheory[pi](n)) ;

%p end if;

%p end proc:

%p seq(A049076(n),n=1..30) ; # _R. J. Mathar_, Jan 28 2014

%t A049076 f[n_] := Length[ NestWhileList[ PrimePi, n, PrimeQ]]; Table[ f[n], {n, 105}] (* _Robert G. Wilson v_, Mar 11 2004 *)

%t Table[Length[NestWhileList[PrimePi[#]&,Prime[n],PrimeQ[#]&]]-1,{n,110}] (* _Harvey P. Dale_, May 07 2018 *)

%o (PARI) apply(p->my(s=1);while(isprime(p=primepi(p)),s++); s, primes(100)) \\ _Charles R Greathouse IV_, Nov 20 2012

%o (Haskell)

%o a049076 = (+ 1) . a078442 -- _Reinhard Zumkeller_, Jul 14 2013

%Y Cf. A000040, A049077 - A049081, A006450, A049084, A236542.

%K nice,nonn,easy

%O 1,2

%A _Neil Fernandez_

%E Additional comments from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 12 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 23 04:24 EDT 2024. Contains 376142 sequences. (Running on oeis4.)