login
Number of partitions of n into a prime and two positive squares.
4

%I #12 Mar 10 2023 17:36:25

%S 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,

%T 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,

%U 6,10,7,7,9,7,5,9,9,7,9,10,4

%N Number of partitions of n into a prime and two positive squares.

%C As in A025426, the two squares do not need to be distinct.

%F a(n) = Sum_{primes p} A025426(n-p).

%e a(7) = 2 counts 7 = 5 + 1^2 + 1^2 = 2 + 1^2 + 2^2.

%p A317685 := proc(n)

%p a := 0 ;

%p p := 2;

%p while p <= n do

%p a := a+A025426(n-p);

%p p := nextprime(p) ;

%p end do:

%p a ;

%p end proc:

%t 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 *)

%Y Cf. A025426, A317682 - A317684.

%K nonn,easy

%O 0,8

%A _R. J. Mathar_, _Michel Marcus_, Aug 04 2018