A290472 Number of ways to write 6*n+1 as x^2 + 3*y^2 + 7*z^2, where x is a positive integer, and y and z are nonnegative integers.
1, 1, 1, 2, 1, 1, 2, 3, 3, 1, 1, 4, 1, 3, 1, 9, 1, 1, 2, 4, 3, 3, 3, 5, 1, 4, 2, 6, 3, 6, 1, 4, 2, 3, 1, 7, 3, 3, 3, 6, 2, 3, 2, 15, 2, 5, 2, 4, 2, 2, 7, 6, 3, 6, 2, 11, 3, 7, 3, 6, 4, 5, 2, 11, 4, 3, 1, 7, 3, 2, 4, 17, 2, 3, 3, 8, 2, 5, 7, 9, 4, 4, 2, 13, 1, 13, 1, 5, 4, 3, 4, 6, 7, 7, 3, 10, 4, 6, 3, 20, 3
Offset: 0
Keywords
Examples
a(4) = 1 since 6*4+1 = 5^2 + 3*0^2 + 7*0^2. a(5) = 1 since 6*5+1 = 2^2 + 3*3^2 + 7*0^2. a(9) = 1 since 6*9+1 = 6^2 + 3*2^2 + 7*1^2. a(116) = 1 since 6*116+1 = 9^2 + 3*14^2 + 7*2^2. a(124) = 1 since 6*124+1 = 21^2 + 3*8^2 + 7*4^2. a(152) = 1 since 6*152+1 = 19^2 + 3*10^2 + 7*6^2. a(286) = 1 since 6*286+1 = 11^2 + 3*14^2 + 7*12^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
- Zhi-Wei Sun, On universal sums of polygonal numbers, Sci. China Math. 58 (2015), 1367-1396.
- Zhi-Wei Sun, On universal sums x(ax+b)/2+y(cy+d)/2+z(ez+f)/2, arXiv:1502.03056 [math.NT], 2015-2017.
- Hai-Liang Wu and Zhi-Wei Sun, Some universal quadratic sums over the integers, arXiv:1707.06223 [math.NT], 2017.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=n>0&&IntegerQ[Sqrt[n]]; Do[r=0;Do[If[SQ[6n+1-3y^2-7z^2],r=r+1],{y,0,Sqrt[(6n+1)/3]},{z,0,Sqrt[(6n+1-3y^2)/7]}];Print[n," ",r],{n,0,100}]
-
PARI
a(n)=my(s=6*n+1,t); sum(z=0,sqrtint((s-1)\7), t=s-7*z^2; sum(y=0,sqrtint((t-1)\3), issquare(t-3*y^2))) \\ Charles R Greathouse IV, Aug 03 2017
-
PARI
first(n)=my(v=vector(n+1),mx=6*n+1,s,t,u); for(x=1,sqrtint(mx), s=x^2; for(y=0,sqrtint((mx-s)\3), t=s+3*y^2; for(z=0,sqrtint((mx-t)\7), u=t+7*z^2; if(u%6==1, v[u\6+1]++)))); v \\ Charles R Greathouse IV, Aug 03 2017
Comments