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.

A000075 Number of positive integers <= 2^n of form 2 x^2 + 3 y^2.

This page as a plain text file.
%I A000075 M1078 N0408 #26 Jun 05 2022 13:11:01
%S A000075 0,1,2,4,7,14,23,42,76,139,258,482,907,1717,3269,6257,12020,23171,
%T A000075 44762,86683,168233,327053,636837,1241723,2424228,4738426,9271299,
%U A000075 18157441,35591647,69820626,137068908,269270450,529312241,1041093048,2048825748,4034059456
%N A000075 Number of positive integers <= 2^n of form 2 x^2 + 3 y^2.
%D A000075 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A000075 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A000075 D. Shanks and L. P. Schmid, <a href="http://dx.doi.org/10.1090/S0025-5718-1966-0210678-1">Variations on a theorem of Landau. Part I</a>, Math. Comp., 20 (1966), 551-569.
%H A000075 <a href="/index/Qua#quadpop">Index entries for sequences related to populations of quadratic forms</a>
%e A000075 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.
%o A000075 (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))))
%o A000075 (Python)
%o A000075 import math
%o A000075 def A000075(n):
%o A000075     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]))
%o A000075 # _Chai Wah Wu_, Aug 20 2014
%Y A000075 Cf. A002480.
%K A000075 nonn
%O A000075 0,3
%A A000075 _N. J. A. Sloane_