login
A082926
Difference between the number of primes equal to or less than n and (1 + the number of nonsquarefree numbers equal to or less than n).
2
1, 0, 1, 0, 1, 1, 2, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 2, 3, 2, 2, 1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 1, 2, 3, 3, 2, 3, 4, 5, 5, 6, 5, 6, 6, 7, 7, 7, 6, 7, 6, 6, 7, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 8, 9, 9, 9, 8, 9, 10, 10, 9, 10, 10, 10, 10, 11, 10, 11, 11, 12, 12, 12, 12, 13, 12
OFFSET
1,7
LINKS
FORMULA
a(n) = abs(A057627(n) + 1 - A000720(n)). - Michel Marcus, Mar 27 2020
MATHEMATICA
nsfQ[n_] := n == 1 || ! SquareFreeQ[n]; Abs[Accumulate[Table[If[nsfQ[n], 1, 0] - If[PrimeQ[n], 1, 0], {n, 1, 100}]]] (* Amiram Eldar, Jun 13 2022 *)
PROG
(PARI) a(n) = abs(sum(k=1, n, !issquarefree(k)) + 1 - primepi(n)); \\ Michel Marcus, Mar 27 2020
CROSSREFS
Sequence in context: A330961 A345236 A321223 * A060564 A031267 A247763
KEYWORD
nonn
AUTHOR
Anonymous, Apr 15 2003
EXTENSIONS
Name edited by Michel Marcus, Jun 14 2022
STATUS
approved