cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A004157 Sum of digits of n-th triangular number.

Original entry on oeis.org

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, 10, 12, 15, 19, 15, 12, 19, 9, 18, 10, 12, 15, 10, 15, 12, 19, 18, 9, 10, 12, 15, 10, 15, 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
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [&+Intseq(n*(n+1) div 2): n in [0..80] ]; // Vincenzo Librandi, Jun 18 2015
    
  • Maple
    seq(convert(convert(n*(n+1)/2,base,10),`+`), n=0..100); # Robert Israel, Jun 18 2015
  • Mathematica
    Table[Plus@@IntegerDigits@(n (n + 1) / 2), {n, 0, 90}] (* Vincenzo Librandi, Jun 18 2015 *)
    Total[IntegerDigits[#]]&/@Accumulate[Range[0,100]] (* Harvey P. Dale, Mar 31 2024 *)
  • PARI
    a(n) = sumdigits(n*(n+1)/2); \\ Michel Marcus, Jun 18 2015

Formula

a(n) = A007953(A000217(n)). - Robert Israel, Jun 18 2015