OFFSET
1,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
D. Subramaniam, E. Trevino, and P. Pollack, On sums of consecutive triangular numbers, INTEGERS 20A (2020) A15.
MAPLE
isA034706 := proc(n)
local a, b;
for a from 0 do
if a*(a+1)/2 > n then
return false;
end if;
for b from a do
tab := (1+b-a)*(a^2+b*a+a+b^2+2*b)/6 ;
if tab = n then
return true;
elif tab > n then
break;
end if;
end do:
end do:
end proc:
for n from 0 to 100 do
if isA034706(n) then
printf("%d, ", n) ;
end if;
end do: # R. J. Mathar, Dec 14 2015
MATHEMATICA
M = 1000; (* to get all terms <= M *)
nmax = (Sqrt[8 M + 1] - 1)/2 // Ceiling;
Table[Sum[n(n+1)/2, {n, j, k}], {j, 0, nmax}, {k, j, nmax}] // Flatten // Union // Select[#, # <= M&]& (* Jean-François Alcover, Mar 10 2019 *)
PROG
(Haskell)
-- import Data.Set (deleteFindMin, union, fromList); import Data.List (inits)
a034706 n = a034706_list !! (n-1)
a034706_list = f 0 (tail $ inits $ a000217_list) (fromList [0]) where
f x vss'@(vs:vss) s
| y < x = y : f x vss' s'
| otherwise = f w vss (union s $ fromList $ scanl1 (+) ws)
where ws@(w:_) = reverse vs
(y, s') = deleteFindMin s
-- Reinhard Zumkeller, May 12 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved