|
|
A330861
|
|
Number of ways to represent n as a sum of 2 triangular numbers and a perfect square.
|
|
2
|
|
|
1, 2, 2, 2, 3, 2, 3, 4, 2, 2, 5, 4, 3, 4, 2, 4, 6, 4, 3, 4, 5, 4, 7, 2, 3, 8, 4, 4, 5, 6, 4, 8, 6, 2, 5, 4, 6, 8, 7, 4, 8, 4, 5, 8, 2, 6, 10, 8, 3, 6, 6, 6, 10, 4, 4, 10, 8, 6, 7, 6, 7, 8, 6, 2, 9, 10, 6, 12, 4, 4, 11, 8, 6, 10, 8, 4, 10, 6, 5, 6, 10, 10, 12, 6, 5, 14, 4, 8, 9, 4, 6, 12
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
The range of the two triangular numbers and the square is the nonnegative numbers.
|
|
LINKS
|
|
|
EXAMPLE
|
a(0)=1 because there is one representation 0 = T(0)+T(0)+0^2.
a(1)=2 because there are 2 representations 1 = T(0)+T(0)+1^2 = T(0)+T(1)+0^2.
a(4)=3 because there are 3 representations 4 = T(0)+T(0)+2^2 = T(0)+T(2)+1^2 = T(1)+T(2)+0^2.
|
|
MAPLE
|
local a, t1idx, t2idx, t1, t2;
a := 0 ;
for t1idx from 0 do
if t1 > n then
break;
end if;
for t2idx from t1idx do
if t1+t2 > n then
break;
end if;
if issqr(n-t1-t2) then
a := a+1 ;
end if;
end do:
end do:
a ;
end proc:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|