This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A055399 Stages of sieve of Eratosthenes needed to identify n as prime or composite. 7
 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 4, 1, 4, 1, 2, 1, 3, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 1, 5, 1, 3, 1, 2, 1, 5, 1, 5, 1, 2, 1, 3, 1, 5, 1, 2, 1, 5, 1, 5, 1, 2, 1, 4, 1, 5, 1, 2, 1, 5, 1, 3, 1, 2, 1, 5 (list; graph; refs; listen; history; text; internal format)
 OFFSET 3,3 LINKS T. D. Noe, Table of n, a(n) for n = 3..10000 H. B. Meyer, Eratosthenes' sieve J. Britton, Sieve of Eratosthenes Applet C. K. Caldwell, The Prime Glossary, sieve of Eratosthenes FORMULA If n is composite, a(n) = A055396(n); if n is prime, a(n) = A000040(firstprimeabove(sqrt(n)). EXAMPLE a(7)=2 because 7 is not removed by the first two stages of the sieve, but is less than the square of the second prime (though not the square of the first); a(35)=3 because 35 is removed in the third stage as a multiple of 5. MATHEMATICA a[n_ /; !PrimeQ[n]] := PrimePi[ FactorInteger[n][[1, 1]]]; a[n_ /; PrimeQ[n]] := PrimePi[ NextPrime[ Sqrt[n]]]; Table[a[n], {n, 3, 107}](* Jean-François Alcover, Jun 11 2012, after formula *) CROSSREFS Cf. A000040, A002808, A004280, A038179, A055396, A055397, A055397. Cf. A054403; A055398; A083269. Sequence in context: A033103 A060775 A175494 * A029426 A085342 A025825 Adjacent sequences:  A055396 A055397 A055398 * A055400 A055401 A055402 KEYWORD nice,nonn AUTHOR Henry Bottomley, May 15 2000 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .