login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A218800 Number of nonnegative integer solutions to x^2 + 2y^2 = (3n)^2. 2

%I #18 Nov 07 2012 13:46:36

%S 1,2,2,3,2,2,3,2,2,4,2,5,3,2,2,3,2,5,4,5,2,3,5,2,3,2,2,5,2,2,3,2,2,8,

%T 5,2,4,2,5,3,2,5,3,5,5,4,2,2,3,2,2,8,2,2,5,5,2,8,2,5,3,2,2,4,2,2,8,5,

%U 5,3,2,2,4,5,2,3,5,5,3,2,2,6,5,5,3,5,5

%N Number of nonnegative integer solutions to x^2 + 2y^2 = (3n)^2.

%C For n > 0, a(n) > 1 since n^2 + 2(2n)^2 = (3n)^2 and (3n)^2 + 2*0^2 = (3n)^2.

%C a(3k) > 2 as we also have (7k)^2 + 2*(4k)^2 = 81k^2 =

%C (9k)^2 = (3*3k)^2.

%e a(2) = 2 because we have 6^2 + 2*0^2 = 6^2 and 2^2 + 2*4^2 = 6^2 and no others.

%o (JavaScript)

%o for (i=0; i<200; i+=3) {

%o d=0; e=0;

%o for (a=0; a<=i; a++)

%o for (b=0; b<=i; b++) {

%o t1=Math.pow(a, 2)+2*Math.pow(b, 2);

%o t2=Math.pow(i, 2);

%o if (t1<t2) d++;

%o if (t1<=t2) e++;

%o }

%o document.write((e-d)+", ");

%o }

%Y Cf. A218799.

%K nonn

%O 0,2

%A _Jon Perry_, Nov 06 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)