|
|
A116568
|
|
Difference between n and the absolute value of the difference between number of nonprimes not exceeding n and number of primes not exceeding n.
|
|
1
|
|
|
0, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 10, 12, 12, 12, 12, 14, 14, 16, 16, 16, 16, 18, 18, 18, 18, 18, 18, 20, 20, 22, 22, 22, 22, 22, 22, 24, 24, 24, 24, 26, 26, 28, 28, 28, 28, 30, 30, 30, 30, 30, 30, 32, 32, 32, 32, 32, 32, 34, 34, 36, 36, 36, 36, 36, 36, 38, 38, 38, 38, 40, 40, 42
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(11)=10 because the nonprimes not exceeding 11 are 1,4,6,8,9 and 10, the primes not exceeding 11 are 2,3,5,7 and 11 and 11-abs(6-5)=10.
|
|
MAPLE
|
with(numtheory): seq(n-abs(n-2*pi(n)), n=1..73);
|
|
MATHEMATICA
|
Table[n-Abs[2*PrimePi[n]-n], {n, 80}] (* Harvey P. Dale, Oct 08 2015 *)
|
|
PROG
|
(PARI) for(n=1, 50, print1(n - abs(2*primepi(n) - n) , ", ")) \\ G. C. Greubel, Sep 20 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|