login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A124808
Number of numbers k <= n such that k^2 + 1 is squarefree.
3
1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 35, 36, 37, 37, 38, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 61, 62, 62, 63, 64
OFFSET
0,2
LINKS
FORMULA
a(0) = 1, a(n) = a(n-1) + 0^(A059592(n) - 1).
a(n) = Sum_{k=0..n} mu(k^2+1)^2, where mu(n) is the Mobius function (A008683). - Wesley Ivan Hurt, Jul 15 2015
a(n) ~ c*n where c = Product_{p prime, p == 1 (mod 4)} (1 - 2/p^2) = 0.894841... (A335963). - Amiram Eldar, Feb 23 2021
MAPLE
ListTools:-PartialSums([seq(numtheory:-mobius(k^2+1)^2, k=0..100)]); # Robert Israel, Jul 15 2015
MATHEMATICA
Accumulate[Table[If[SquareFreeQ[k^2+1], 1, 0], {k, 0, 80}]] (* Harvey P. Dale, Mar 04 2014 *)
Table[Sum[MoebiusMu[k^2 + 1]^2, {k, 0, n}], {n, 0, 100}] (* Wesley Ivan Hurt, Jul 15 2015 *)
PROG
(PARI) a(n)={my(k, r=0); for(k=0, n, if(issquarefree(k^2+1), r++)); return(r); }
main(size)=my(n); vector(size, n, a(n-1)) /* Anders Hellström, Jul 15 2015 */
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Nov 08 2006
STATUS
approved