A085263 Number of ways to write n as the sum of a squarefree number (A005117) and a positive square (A000290).
0, 1, 1, 1, 1, 2, 2, 1, 1, 2, 3, 2, 0, 3, 3, 2, 2, 3, 3, 2, 2, 3, 4, 2, 1, 4, 4, 2, 1, 5, 4, 3, 2, 2, 5, 2, 3, 6, 6, 3, 2, 6, 4, 3, 2, 5, 6, 3, 2, 5, 6, 3, 2, 4, 6, 4, 3, 4, 6, 4, 1, 7, 5, 3, 3, 7, 6, 4, 4, 6, 8, 3, 3, 6, 7, 2, 4, 8, 5, 4, 3, 7, 9, 4, 2, 8, 9, 4, 3, 6, 6, 5, 4, 7, 9, 5, 3, 8, 4, 3, 5, 9
Offset: 1
Examples
a(11)=3: 11 = 1 + 10 = A000290(1) + A005117(7) = 4 + 7 = A000290(2) + A005117(6) = 9 + 2 = A000290(3) + A005117(2).
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Square Numbers.
- Eric Weisstein's World of Mathematics, Squarefree
- Robert G. Wilson v, Plot of first 100000 terms
Crossrefs
Programs
-
Mathematica
f[n_] := Count[ SquareFreeQ@# & /@ (n - Range[1, Floor[ Sqrt[ n]]]^2), True]; Array[f, 105] (* Robert G. Wilson v, May 16 2014 *)
-
PARI
a(n) = sum(k=1, n-1, issquare(k) * issquarefree(n-k)); \\ Michel Marcus, Oct 30 2020
Formula
a(n) < sqrt(n). - Robert G. Wilson v, May 17 2014
G.f.: (Sum_{i>=1} x^(i^2))*(Sum_{j>=1} mu(j)^2*x^j). - Ilya Gutkovskiy, Feb 06 2017
Comments