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.
%I A366091 #11 Sep 29 2023 16:13:17 %S A366091 1,1,1,2,2,1,2,1,1,3,0,2,4,1,2,2,2,1,3,2,2,4,2,1,2,2,0,4,3,2,5,2,1,3, %T A366091 2,2,7,2,2,5,0,2,0,2,4,4,3,1,4,3,3,5,3,2,7,1,2,6,0,3,6,2,2,4,2,2,6,3, %U A366091 2,4,3,3,3,2,0,7,5,2,6,3,2,8,2,2,11,2,5,2,2,3,0,4,3,7,3,2,2,3,3 %N A366091 a(n) is the number of ways to write n = i^2 + 2*j^2 + 3*k^2 with i,j,k >= 0. %H A366091 Robert Israel, <a href="/A366091/b366091.txt">Table of n, a(n) for n = 0..10000</a> %F A366091 G.f. (1 + theta_3(0,z)) * (1 + theta_3(0,z^2)) * (1 + theta_3(0,z^3))/8 where theta_3 is a Jacobi theta function. %e A366091 a(9) = 3 because 9 = 3^2 + 2*0^2 + 3*0^2 = 1^2 + 2*2^2 + 3*0^2 = 2^2 + 2*1^2 + 3*1^2. %p A366091 g:= (1+JacobiTheta3(0,z))*(1+JacobiTheta3(0,z^2))*(1+JacobiTheta3(0,z^3))/8: %p A366091 S:= series(g,z,101): %p A366091 seq(coeff(S,z,j),j=0..100); %o A366091 (Python) %o A366091 from itertools import count %o A366091 from sympy.ntheory.primetest import is_square %o A366091 def A366091(n): %o A366091 c = 0 %o A366091 for k in count(0): %o A366091 if (a:=3*k**2)>n: %o A366091 break %o A366091 for j in count(0): %o A366091 if (b:=a+(j**2<<1))>n: %o A366091 break %o A366091 if is_square(n-b): %o A366091 c += 1 %o A366091 return c # _Chai Wah Wu_, Sep 29 2023 %Y A366091 Cf. A028594 (allows any integer i,j,k), A055042 (a(n) = 0) %K A366091 nonn %O A366091 0,4 %A A366091 _Robert Israel_, Sep 28 2023