A308934 Number of ways to write n as (2^a*3^b)^2 + (2^c*3^d)^2 + x^2 + 2*y^2, where a,b,c,d,x,y are nonnegative integers with 2^a*3^b >= 2^c*3^d.
0, 1, 1, 1, 2, 2, 1, 3, 2, 3, 5, 2, 4, 6, 1, 4, 5, 4, 7, 6, 7, 6, 4, 6, 4, 9, 7, 5, 10, 4, 4, 7, 4, 7, 10, 7, 8, 9, 4, 8, 10, 7, 10, 9, 7, 11, 5, 6, 11, 7, 10, 8, 11, 11, 5, 14, 6, 9, 13, 3, 13, 9, 6, 12, 7, 6, 11, 12, 12, 11, 10, 10, 10, 17, 9, 14, 14, 8, 10, 9, 14, 11, 16, 15, 13, 18, 6, 14, 17, 14, 22, 11, 12, 16, 7, 13, 11, 16, 19, 13
Offset: 1
Keywords
Examples
a(3) = 1 with 3 = 1^2 + 1^2 + 1^2 + 2*0^2. a(7) = 1 with 7 = 2^2 + 1^2 + 0^2 + 2*1^2. a(15) = 1 with 15 = 3^2 + 2^2 + 0^2 + 2*1^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; tab={};Do[r=0;Do[If[SQ[n-4^a*9^b-4^c*9^d-2x^2],r=r+1],{a,0,Log[4,n]},{b,0,Ceiling[Log[9,n/4^a]]-1}, {c,0,Log[4,n-4^a*9^b]},{d,0,Log[9,Min[4^(a-c)*9^b,(n-4^a*9^b)/4^c]]},{x,0,Sqrt[(n-4^a*9^b-4^c*9^d)/2]}];tab=Append[tab,r],{n,1,100}];Print[tab]
Comments