A308597 Number of ways to write n as a*(a+1)/2 + b*(b+1)/2 + 2^c*5^d, where a,b,c,d are nonnegative integers with a <= b and d <= 1.
1, 2, 2, 3, 4, 3, 4, 6, 3, 5, 7, 5, 4, 7, 4, 6, 8, 5, 5, 8, 6, 8, 8, 5, 6, 11, 4, 5, 8, 6, 7, 11, 7, 5, 8, 8, 6, 10, 7, 8, 11, 6, 7, 11, 5, 9, 13, 7, 5, 11, 7, 9, 10, 6, 5, 12, 7, 8, 10, 7, 10, 10, 7, 6, 10, 10, 8, 11, 7, 9, 14, 5, 6, 13, 8, 10, 12, 8, 4, 13, 8, 12, 11, 7, 10, 15, 6, 10, 13, 4, 10, 13, 9, 6, 13, 13, 8, 12, 8, 8
Offset: 1
Keywords
Examples
a(1) = 1 with 1 = 0*1/2 + 0*1/2 + 2^0*5^0. a(3) = 2 with 3 = 0*1/2 + 1*2/2 + 2^1*5^0 = 1*2/2 + 1*2/2 + 2^0*5^0.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Mixed sums of squares and triangular numbers, Acta Arith. 127(2007), 103-113.
Programs
-
Mathematica
TQ[n_]:=TQ[n]=IntegerQ[Sqrt[8n+1]]; tab={};Do[r=0;Do[If[TQ[n-5^k*2^m-x(x+1)/2],r=r+1],{k,0,Min[1,Log[5,n]]},{m,0,Log[2,n/5^k]},{x,0,(Sqrt[4(n-5^k*2^m)+1]-1)/2}];tab=Append[tab,r],{n,1,100}];Print[tab]
Comments