A092575 Number of representations of n of the form x^2 + 3y^2 with (x,y)=1.
0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- E. Akhtarkavan, M. F. M. Salleh and O. Sidek, Multiple Descriptions Video Coding Using Coinciding Lattice Vector Quantizer for H.264/AVC and Motion JPEG2000, World Applied Sciences Journal 21 (2): 157-169, 2013. - From _N. J. A. Sloane_, Feb 11 2013
- Eric Weisstein's World of Mathematics, Eulers 6n Plus 1 Theorem
Programs
-
Maple
N:= 200: # to get a(1)..a(N) V:= Vector(N): for y from 1 to floor(sqrt(N/3-1)) do for x from 1 to floor(sqrt(N-3*y^2)) do if igcd(x,y) = 1 then V[x^2 + 3*y^2]:= V[x^2+3*y^2]+1 fi od od: convert(V,list); # Robert Israel, Apr 03 2017
-
Mathematica
r[n_] := Reduce[ x > 0 && y > 0 && GCD[x, y] == 1 && n == x^2 + 3 y^2, {x, y}, Integers]; a[n_] := Which[ r[n] === False, 0, r[n][[0]] === And, 1, True, Length[r[n]]]; Table[a[n], {n, 1, 102}] (* Jean-François Alcover, Oct 31 2012 *)