A306439 Number of ways to write n as x*(3x+1)/2 + y*(3y+1)/2 + z*(3z+1) + 3w*(3w+1)/2, where x,y,z,w are nonnegative integers with x <= y.
1, 0, 1, 0, 2, 0, 2, 1, 2, 1, 2, 1, 1, 2, 3, 2, 1, 2, 2, 2, 2, 4, 2, 3, 2, 3, 2, 3, 4, 3, 4, 1, 5, 1, 5, 3, 5, 4, 3, 4, 5, 1, 5, 3, 4, 4, 3, 7, 2, 4, 4, 7, 6, 6, 4, 4, 5, 3, 7, 5, 5, 8, 6, 7, 3, 6, 8, 6, 5, 4, 3, 4, 6, 7, 3, 7, 6, 10, 7, 5, 9, 3, 11, 4, 9, 7, 7, 10, 5, 9, 7, 7, 10, 8, 7, 5, 5, 9, 5, 9, 9
Offset: 0
Keywords
Examples
a(12) = 1 with 12 = 0*(3*0+1)/2 + 1*(3*1+1)/2 + 1*(3*1+1) + 3*1*(3*1+1)/2. a(31) = 1 with 31 = 1*(3*1+1)/2 + 3*(3*3+1)/2 + 2*(3*2+1) + 3*0*(3*0+1)/2. a(33) = 1 with 33 = 2*(3*2+1)/2 + 4*(3*4+1)/2 + 0*(3*0+1) + 3*0*(3*0+1)/2. a(41) = 1 with 41 = 3*(3*3+1)/2 + 4*(3*4+1)/2 + 0*(3*0+1) + 3*0*(3*0+1)/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.
Programs
-
Mathematica
PQ[n_]:=PQ[n]=IntegerQ[Sqrt[24n+1]]&&Mod[Sqrt[24n+1],6]==1; tab={};Do[r=0;Do[If[PQ[n-3x(3x+1)/2-y(3y+1)-z(3z+1)/2],r=r+1],{x,0,(Sqrt[8n+1]-1)/6},{y,0,(Sqrt[12(n-3x(3x+1)/2)+1]-1)/6},{z,0,(Sqrt[12(n-3x(3x+1)/2-y(3y+1))+1]-1)/6}];tab=Append[tab,r],{n,0,100}];Print[tab]
Comments