A317682 Number of partitions of n into a prime and two distinct squares.
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
Examples
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.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..20000
Programs
-
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 *)
-
PARI
A317682(n,s=0)={forprime(p=2,n-1,s+=A025435(n-p));s} \\ M. F. Hasler, Aug 05 2018
Formula
a(n) = Sum_{primes p} A025435(n-p).
Comments