A306790 Number of ways to write n as x*(3*x+1)/2 + y*(y+1)*(y+2)/2 + z*(z+1)*(z+2)/6, where x is a nonzero integer, and y and z are nonnegative integers.
1, 2, 1, 1, 4, 3, 1, 3, 3, 1, 3, 3, 2, 4, 5, 3, 3, 4, 4, 2, 2, 4, 3, 3, 6, 3, 4, 4, 3, 3, 2, 4, 3, 3, 7, 5, 4, 5, 7, 3, 3, 6, 3, 4, 5, 3, 5, 4, 3, 3, 3, 6, 4, 3, 5, 3, 6, 5, 1, 5, 7, 6, 4, 5, 4, 6, 5, 2, 5, 7, 7, 5, 7, 5, 5, 3, 5, 3, 2, 6, 5, 7, 5, 1, 6, 5, 7, 3, 5, 6, 6, 6, 4, 3, 4, 7, 4, 3, 6, 6
Offset: 1
Keywords
Examples
a(59) = 1 with 59 = (-3)*(3*(-3)+1)/2 + 2*3*4/2 + 5*6*7/6. a(19694) = 1 with 19694 = 20*(3*20+1)/2 + 10*11*12/2 + 47*48*49/6. a(19919) = 1 with 19919 = (-45)*(3*(-45)+1)/2 + 30*31*32/2 + 22*23*24/6. a(33989) = 1 with 33989 = 55*(3*55+1)/2 + 20*21*22/2 + 52*53*54/6. a(60769) = 1 with 60769 = 46*(3*46+1)/2 + 47*48*49/2 + 23*24*25/6.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
f[n_]:=f[n]=Binomial[n+2,3]; PQ[n_]:=PQ[n]=IntegerQ[Sqrt[24n+1]]; tab={};Do[r=0;Do[If[f[x]>=n/3,Goto[cc]];Do[If[f[y]>=n-3*f[x],Goto[bb]];If[PQ[n-3*f[x]-f[y]],r=r+1];Label[aa],{y,0,n-1-3*f[x]}];Label[bb],{x,0,(n-1)/3}];Label[cc];tab=Append[tab,r],{n,1,100}];Print[tab]
Comments