login
A317682
Number of partitions of n into a prime and two distinct squares.
4
0, 0, 0, 1, 1, 0, 2, 2, 2, 1, 1, 2, 4, 1, 2, 3, 3, 2, 4, 2, 4, 3, 4, 4, 4, 1, 2, 6, 6, 3, 5, 3, 6, 5, 3, 2, 7, 3, 5, 7, 4, 4, 8, 5, 6, 5, 5, 7, 9, 3, 4, 6, 7, 6, 9, 5, 8, 9, 6, 4, 9, 3, 6, 11, 6, 5, 10, 7, 10, 8, 8, 8, 12, 5, 5, 8, 10, 9, 11, 6, 7
OFFSET
0,7
COMMENTS
As in A025435, zero is a valid square here.
LINKS
FORMULA
a(n) = Sum_{primes p} A025435(n-p).
EXAMPLE
a(12)=4 counts 12 = 11 + 0^2 + 1^2 = 3 + 0^2 + 3^2 = 7 + 1^2 + 2^2 = 2 + 1^2 + 3^2.
MAPLE
A317682 := proc(n)
a := 0 ;
p := 2;
while p < n do
a := a+A025435(n-p);
p := nextprime(p) ;
end do:
a ;
end proc:
MATHEMATICA
A025435[n_] := Length[ PowersRepresentations[n, 2, 2]] - Boole[ IntegerQ[ Sqrt[2n]]];
a[n_] := Module[{s = 0, p}, For[p = 2, p <= n-1, p = NextPrime[p], s += A025435[n-p]]; s];
a /@ Range[0, 100] (* Jean-François Alcover, Apr 07 2020 *)
PROG
(PARI) A317682(n, s=0)={forprime(p=2, n-1, s+=A025435(n-p)); s} \\ M. F. Hasler, Aug 05 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved