login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A000075
Number of positive integers <= 2^n of form 2 x^2 + 3 y^2.
(Formerly M1078 N0408)
2
0, 1, 2, 4, 7, 14, 23, 42, 76, 139, 258, 482, 907, 1717, 3269, 6257, 12020, 23171, 44762, 86683, 168233, 327053, 636837, 1241723, 2424228, 4738426, 9271299, 18157441, 35591647, 69820626, 137068908, 269270450, 529312241, 1041093048, 2048825748, 4034059456
OFFSET
0,3
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
EXAMPLE
a(3)=4 since 2^3=8 and 2=2*1^2, 3=3*1^2, 5=2*1^2+3*1^2, 8=2*2^2.
PROG
(PARI) a(n)=if(n<0, 0, sum(k=1, 2^n, 0<sum(y=0, sqrtint(k\3), issquare((k-3*y^2)/2))))
(Python)
import math
def A000075(n):
return len(set([2*x**2+3*y**2 for x in range(1+int(math.floor(2**((n-1)/2)))) for y in range(1+int(math.floor(math.sqrt((2**n-2*x**2)/3)))) if 0 < 2*x**2+3*y**2 <= 2**n]))
# Chai Wah Wu, Aug 20 2014
CROSSREFS
Cf. A002480.
Sequence in context: A079488 A054160 A034426 * A285903 A048248 A370636
KEYWORD
nonn
STATUS
approved