This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A004157 Sum of digits of n-th triangular number. 3

%I

%S 0,1,3,6,1,6,3,10,9,9,10,12,15,10,6,3,10,9,9,10,3,6,10,15,3,10,9,18,

%T 10,12,15,19,15,12,19,9,18,10,12,15,10,15,12,19,18,9,10,12,15,10,15,

%U 12,19,9,18,10,21,15,10,15,12,19,18,9,10,12,6,19,15,12,19,18,18,10,21,15,19,6,12,10

%N Sum of digits of n-th triangular number.

%H Robert Israel, <a href="/A004157/b004157.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A007953(A000217(n)). - _Robert Israel_, Jun 18 2015

%p P:=proc(n) local a,i,k,w; a:=0; for i from 1 by 1 to n do a:=a+i; w:=0; k:=a; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; print(w); od; end: P(100); # _Paolo P. Lava_, May 03 2007

%p seq(convert(convert(n*(n+1)/2,base,10),`+`), n=0..100); # _Robert Israel_, Jun 18 2015

%t Table[Plus@@IntegerDigits@(n (n + 1) / 2), {n, 0, 90}] (* _Vincenzo Librandi_, Jun 18 2015 *)

%o (MAGMA) [&+Intseq(n*(n+1) div 2): n in [0..80] ]; // _Vincenzo Librandi_, Jun 18 2015

%o (PARI) a(n) = sumdigits(n*(n+1)/2); \\ _Michel Marcus_, Jun 18 2015

%Y Cf. A000217, A007953, A145389.

%K nonn,base

%O 0,3

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified July 21 21:14 EDT 2019. Contains 325199 sequences. (Running on oeis4.)