A306242 Number of ways to write n as x*(3x+1) + y*(3y-1) + z*(3z+2) + w*(3w-2), where x,y,z,w are nonnegative integers.
1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 3, 2, 2, 1, 3, 4, 3, 3, 2, 4, 3, 3, 4, 3, 4, 3, 3, 4, 3, 4, 7, 4, 5, 4, 3, 4, 4, 6, 6, 3, 9, 6, 2, 5, 5, 8, 4, 6, 7, 6, 5, 6, 3, 5, 9, 6, 8, 7, 8, 7, 7, 8, 7, 4, 9, 8, 6, 6, 7, 7, 13, 9, 6, 6, 7, 11, 4, 6, 11, 9, 12
Offset: 0
Keywords
Examples
a(1) = 1 with 1 = 0*(3*0+1) + 0*(3*0-1) + 0*(3*0+2) + 1*(3*1-2). a(3) = 1 with 3 = 0*(3*0+1) + 1*(3*1-1) + 0*(3*0+2) + 1*(3*1-2). a(4) = 1 with 4 = 1*(3*1+1) + 0*(3*0-1) + 0*(3*0+2) + 0*(3*0-2). a(9) = 1 with 9 = 1*(3*1+1) + 0*(3*0-1) + 1*(3*1+2) + 0*(3*0-2). a(13) = 1 with 13 = 0*(3*0+1) + 0*(3*0-1) + 1*(3*1+2) + 2*(3*2-2).
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
- Zhi-Wei Sun, A result similar to Lagrange's theorem, J. Number Theory 162(2016), 190-211.
- Zhi-Wei Sun, On x(ax+1)+y(by+1)+z(cz+1) and x(ax+b)+y(ay+c)+z(az+d), J. Number Theory 171(2017), 275-283.
Programs
-
Mathematica
OctQ[n_]:=OctQ[n]=IntegerQ[Sqrt[3n+1]]&&(n==0||Mod[Sqrt[3n+1]+1,3]==0); tab={};Do[r=0;Do[If[OctQ[n-x(3x+2)-y(3y+1)-z(3z-1)],r=r+1],{x,0,(Sqrt[3n+1]-1)/3},{y,0,(Sqrt[12(n-x(3x+2))+1]-1)/6},{z,0,(Sqrt[12(n-x(3x+2)-y(3y+1))+1]+1)/6}];tab=Append[tab,r],{n,0,80}];Print[tab]
Comments