A256106 Number of ways to write n as w + x + 2*y + 4*z, where w,x,y,z are hexagonal numbers with w <= x.
1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 1, 1, 3, 2, 2, 1, 3, 2, 4, 2, 1, 2, 2, 2, 2, 2, 2, 3, 4, 1, 4, 4, 5, 3, 4, 2, 6, 3, 3, 1, 4, 3, 4, 2, 1, 5, 5, 3, 2, 3, 3, 4, 3, 2, 3, 5, 4, 4, 5, 2, 7, 4, 8, 4, 5, 1, 6, 5, 5, 5, 4, 3, 9, 4, 3, 6, 5, 5, 4, 5, 3, 6, 5, 4, 5, 4, 4, 4, 5, 3, 10, 5, 8, 4, 7, 3, 11, 8, 3, 4, 5
Offset: 0
Keywords
Examples
a(65) = 1 since 65 = 1*(2*1-1) + 4*(2*4-1) + 2*2*(2*2-1) + 4*2*(2*2-1) = 1 + 28 + 2*6 + 4*6 with 1,28,6,6 hexagonal numbers. a(104) = 1 since 104 = 1*(2*1-1) + 7*(2*7-1) + 2*2*(2*2-1) + 4*0*(2*0-1) = 1 + 91 + 2*6 + 4*0 with 1,91,6,0 hexagonal numbers.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
- Xiang-Zi Meng and Zhi-Wei Sun, Sums of four polygonal numbers with coefficients, arXiv:1608.02022 [math.NT], 2016.
- Zhi-Wei Sun, On universal sums of polygonal numbers, arXiv:0905.0635 [math.NT], 2009-2015.
- Zhi-Wei Sun, A result similar to Lagrange's theorem, J. Number Theory 162(2016), 190-211.
Programs
-
Mathematica
H[n_]:=IntegerQ[Sqrt[8n+1]]&&(n==0||Mod[Sqrt[8n+1]+1,4]==0) Do[r=0;Do[If[Mod[n-x(2x-1)-y(2y-1)-2z(2z-1),4]==0&&H[(n-x(2x-1)-y(2y-1)-2z(2z-1))/4],r=r+1],{x,0,(Sqrt[4n+1]+1)/4},{y,x,(Sqrt[8(n-x(2x-1))+1]+1)/4}, {z,0,(Sqrt[4(n-x(2x-1)-y(2y-1))+1]+1)/4}];Print[n," ",r];Continue,{n,0,100}]
Comments