A255916 Number of ways to write n as the sum of a generalized heptagonal number, an octagonal number and a nonagonal number.
1, 3, 3, 1, 1, 2, 1, 1, 3, 4, 3, 1, 1, 3, 3, 2, 2, 2, 2, 2, 1, 3, 4, 2, 2, 3, 3, 3, 5, 3, 2, 2, 2, 1, 3, 5, 4, 3, 1, 2, 2, 2, 3, 4, 3, 3, 3, 5, 5, 3, 3, 3, 2, 3, 4, 5, 5, 2, 4, 4, 1, 1, 1, 3, 5, 4, 3, 6, 4, 1, 3, 5, 5, 2, 4, 3, 5, 3, 4, 6, 5, 4, 4, 5, 2, 2, 2, 6, 2, 3, 5, 4, 4, 5, 3, 3, 5, 3, 3, 3, 8
Offset: 0
Keywords
Examples
a(60) = 1 since 60 = (-2)(5*(-2)-3)/2 + 1*(3*1-2) + 4*(7*4-5)/2. a(279) = 1 since 279 = 3*(5*3-3)/2 + 0*(3*0-2) + 9*(7*9-5)/2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
HQ[n_]:=HQ[n]=IntegerQ[Sqrt[40n+9]]&&(Mod[Sqrt[40n+9]+3,10]==0||Mod[Sqrt[40n+9]-3,10]==0) Do[r=0;Do[If[HQ[n-x(3x-2)-y(7y-5)/2],r=r+1],{x,0,(Sqrt[3n+1]+1)/3},{y,0,(Sqrt[56(n-x(3x-2))+25]+5)/14}]; Print[n," ",r];Continue,{n,0,100}]
Comments