A317685 Number of partitions of n into a prime and two positive squares.
0, 0, 0, 0, 1, 1, 0, 2, 1, 1, 2, 1, 2, 3, 0, 4, 2, 1, 2, 3, 3, 4, 3, 3, 3, 4, 1, 4, 4, 3, 3, 6, 3, 4, 4, 2, 6, 6, 1, 8, 3, 3, 6, 6, 4, 6, 4, 5, 7, 6, 3, 6, 6, 5, 6, 9, 5, 8, 6, 3, 7, 8, 2, 12, 6, 4, 7, 7, 6, 10, 7, 7, 9, 7, 5, 9, 9, 7, 9, 10, 4
Offset: 0
Examples
a(7) = 2 counts 7 = 5 + 1^2 + 1^2 = 2 + 1^2 + 2^2.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Programs
-
Maple
A317685 := proc(n) a := 0 ; p := 2; while p <= n do a := a+A025426(n-p); p := nextprime(p) ; end do: a ; end proc:
-
Mathematica
p2sQ[{a_,b_,c_}]:=PrimeQ[a]&&AllTrue[{Sqrt[b],Sqrt[c]},IntegerQ]||PrimeQ[b] && AllTrue[{Sqrt[c],Sqrt[a]},IntegerQ]||PrimeQ[c]&&AllTrue[{Sqrt[b],Sqrt[a]},IntegerQ]; Table[Count[IntegerPartitions[n,{3}],?(p2sQ[#]&)],{n,0,80}] (* _Harvey P. Dale, Mar 10 2023 *)
Formula
a(n) = Sum_{primes p} A025426(n-p).
Comments