A306460 Number of ways to write n as x*(2x-1) + y*(y+1)/2 + z*(z+1)*(z+2)/6, where x,y,z are nonnegative integers with x > 0.
1, 2, 1, 1, 2, 2, 3, 3, 1, 2, 4, 3, 2, 1, 2, 6, 5, 1, 3, 3, 4, 6, 1, 1, 4, 6, 3, 3, 5, 3, 6, 4, 2, 3, 5, 5, 4, 6, 4, 2, 5, 5, 3, 5, 2, 6, 7, 3, 5, 5, 7, 5, 4, 2, 5, 8, 5, 3, 2, 6, 6, 4, 5, 5, 6, 7, 5, 5, 4, 6, 9, 6, 6, 5, 1, 7, 8, 3, 2, 6, 7, 5, 6, 5, 7, 8, 5, 3, 2, 6, 10, 6, 8, 7, 7, 5, 4, 6, 5, 5
Offset: 1
Keywords
Examples
a(3) = 1 with 3 = 1*(2*1-1) + 1*2/2 + 1*2*3/6. a(14) = 1 with 14 = 1*(2*1-1) + 2*3/2 + 3*4*5/6. a(75) = 1 with 75 = 5*(2*5-1) + 4*5/2 + 4*5*6/2. a(349) = 1 with 349 = 5*(2*5-1) + 24*25/2 + 2*3*4/6. a(369) = 1 with 369 = 4*(2*4-1) + 10*11/2 + 11*12*13/6. a(495) = 1 with 495 = 8*(2*8-1) + 20*21/2 + 9*10*11/6. a(642) = 1 with 642 = 16*(2*16-1) + 16*17/2 + 3*4*5/6.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Tetrahedral Number
Programs
-
Mathematica
f[n_]:=f[n]=n(n+1)(n+2)/6; TQ[n_]:=TQ[n]=IntegerQ[Sqrt[8n+1]]; tab={};Do[r=0;Do[If[f[z]>=n, Goto[aa]]; Do[If[TQ[n-f[z]-x(2x-1)],r=r+1],{x,1,(Sqrt[8(n-f[z])+1]+1)/4}];Label[aa],{z,0,n}];tab=Append[tab,r],{n,1,100}];Print[tab]
Comments