%I #20 Apr 07 2020 10:55:34
%S 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,
%T 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,
%U 7,10,8,8,8,12,5,5,8,10,9,11,6,7
%N Number of partitions of n into a prime and two distinct squares.
%C As in A025435, zero is a valid square here.
%H Alois P. Heinz, <a href="/A317682/b317682.txt">Table of n, a(n) for n = 0..20000</a>
%F a(n) = Sum_{primes p} A025435(n-p).
%e 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.
%p A317682 := proc(n)
%p a := 0 ;
%p p := 2;
%p while p < n do
%p a := a+A025435(n-p);
%p p := nextprime(p) ;
%p end do:
%p a ;
%p end proc:
%t A025435[n_] := Length[ PowersRepresentations[n, 2, 2]] - Boole[ IntegerQ[ Sqrt[2n]]];
%t a[n_] := Module[{s = 0, p}, For[p = 2, p <= n-1, p = NextPrime[p], s += A025435[n-p]]; s];
%t a /@ Range[0, 100] (* _Jean-François Alcover_, Apr 07 2020 *)
%o (PARI) A317682(n,s=0)={forprime(p=2,n-1,s+=A025435(n-p));s} \\ _M. F. Hasler_, Aug 05 2018
%Y Cf. A025435, A317683 - A317685.
%K nonn,easy
%O 0,7
%A _R. J. Mathar_, _Michel Marcus_, Aug 04 2018
|