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).
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
Keywords
Links
- Jinyuan Wang, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
PARI
a(n) = abs(sum(k=1, n, !issquarefree(k)) + 1 - primepi(n)); \\ Michel Marcus, Mar 27 2020
Formula
Extensions
Name edited by Michel Marcus, Jun 14 2022