|
|
A062298
|
|
Number of nonprimes <= n.
|
|
51
|
|
|
1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 18, 19, 19, 20, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 42, 43, 43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 52, 53
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
Same as number of primes between n and prime(n+1) and between n and prime(n)+1 (end points excluded); n prime -> a(n)=a(n-1), n composite-> a(n)=1+a(n-1). - David James Sycamore, Jul 23 2018
There exists at least one prime number between a(n) and n for n >= 3 (see the paper by Ya-Ping Lu attached in the links). - Ya-Ping Lu, Nov 27 2020
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(19) = 11 as there are 8 primes up to 19 (inclusive).
|
|
MAPLE
|
NumComposites := proc(N::posint) local count, i:count := 0:for i from 1 to N do if not isprime(i) then count := count + 1 fi:od: count; end:seq(NumComposites(binomial(k+1, k)), k=0..73); # Zerinvary Lajos, May 26 2008
|
|
MATHEMATICA
|
Accumulate[Table[If[PrimeQ[n], 0, 1], {n, 100}]] (* Harvey P. Dale, Feb 15 2017 *)
|
|
PROG
|
(Haskell)
a062298 n = a062298_list !! (n-1)
a062298_list = scanl1 (+) $ map (1 -) a010051_list
(Python)
from sympy import primepi
print([n - primepi(n) for n in range(1, 101)]) # Indranil Ghosh, Mar 29 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|