cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A317682 Number of partitions of n into a prime and two distinct squares.

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