A230121 Number of ways to write n = x + y + z (0 < x <= y <= z) such that x*(x+1)/2 + y*(y+1)/2 + z*(z+1)/2 is a triangular number.
0, 0, 1, 0, 0, 1, 0, 1, 2, 1, 1, 0, 2, 1, 2, 1, 2, 3, 2, 2, 6, 1, 3, 5, 1, 2, 3, 5, 2, 1, 3, 3, 3, 4, 3, 8, 2, 5, 11, 2, 5, 8, 4, 6, 4, 9, 4, 6, 5, 4, 6, 3, 8, 8, 5, 8, 10, 7, 7, 11, 8, 6, 7, 8, 5, 9, 7, 6, 8, 7, 7, 8, 13, 9, 11, 10, 7, 22, 9, 10, 13, 3, 6, 10, 8, 17, 12, 7, 9, 10, 16, 6, 18, 18, 10, 15, 9, 12, 20, 5
Offset: 1
Keywords
Examples
a(16) = 1 since 16 = 3 + 6 + 7 and 3*4/2 + 6*7/2 + 7*8/2 = 55 = 10*11/2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..3000
- Chao Huang and Zhi-Wei Sun, On partitions of integers with restrictions involving squares, arXiv:2105.03416 [math.NT], 2021.
- Zhi-Wei Sun, Diophantine problems involving triangular numbers and squares, a message to Number Theory List, Oct. 11, 2013.
Programs
-
Mathematica
SQ[n_]:=IntegerQ[Sqrt[n]] T[n_]:=n(n+1)/2 a[n_]:=Sum[If[SQ[8(T[i]+T[j]+T[n-i-j])+1],1,0],{i,1,n/3},{j,i,(n-i)/2}] Table[a[n],{n,1,100}]
-
PARI
a(n)=my(t=(n+1)*n/2,s);sum(x=1,n\3,s=t-n--*x;sum(y=x,n\2,is_A000217(s-(n-y)*y))) \\ - M. F. Hasler, Oct 11 2013
Comments