OFFSET
1,2
MAPLE
A000217 := proc(n) option remember ; n*(n+1)/2 ; end: A114031 := proc(n) local strt, su, len, i; strt := 1 ; for su from 1 to n do len := 1; while add( A000217(strt+i), i=0..len-1) mod su <> 0 do len := len+1 ; od ; if su = n then RETURN( add( A000217(strt+i), i=0..len-1) ) ; else strt := strt+len ; fi ; od ; end: for n from 1 to 80 do printf("%d, ", A114031(n)) ; od ; # R. J. Mathar, May 10 2007
MATHEMATICA
t[n_] := n(n+1)/2;
a[n_] := Module[{strt, su, len}, strt = 1; For[su = 1, True, su++, len = 1; While[Mod[Sum[t[strt+i], {i, 0, len-1}], su] != 0, len++]; If[su == n, Return[Sum[t[strt+i], {i, 0, len-1}]], strt += len]]];
Table[a[n], {n, 1, 36}] (* Jean-François Alcover, Aug 01 2023, after R. J. Mathar *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Nov 13 2005
EXTENSIONS
More terms from R. J. Mathar, May 10 2007
STATUS
approved