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.

A074784 a(n) = a(n-1) + square of the sum of digits of n.

Original entry on oeis.org

0, 1, 5, 14, 30, 55, 91, 140, 204, 285, 286, 290, 299, 315, 340, 376, 425, 489, 570, 670, 674, 683, 699, 724, 760, 809, 873, 954, 1054, 1175, 1184, 1200, 1225, 1261, 1310, 1374, 1455, 1555, 1676, 1820, 1836, 1861, 1897, 1946, 2010, 2091, 2191, 2312, 2456
Offset: 0

Views

Author

Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 07 2002

Keywords

Comments

a(n) = Sum_{i=0..n} digsum(i)^2, where digsum(i) = A007953(i). - N. J. A. Sloane, Nov 13 2013

Crossrefs

Partial sums of A118881.

Programs

  • Magma
    [n eq 1 select n else Self(n-1)+(&+Intseq(n))^2: n in [1..48]];  // Bruno Berselli, Jul 12 2011
  • Maple
    See A037123.
  • Mathematica
    Accumulate @ Array[(Plus @@ IntegerDigits[#])^2 &, 50] (* Amiram Eldar, Jan 20 2022 *)

Formula

a(n) = Sum_{k=1..n} s(k)^2 = Sum_{k=1..n} A007953(k)^2, where s(k) denotes the sum of the digits of k in decimal representation.
Asymptotic expression: a(n-1) = Sum_{k=1..n-1} s(k)^2 = 20.25*n*log_10(n)^2 + O(n*log_10(n)).
In general: Sum_{k=1..n-1} s(k)^m = n*((9/2)*log_10(n))^m + O(n*log_10(n)^(m-1)).

Extensions

Offset changed to 0 and a(0) prepended by Amiram Eldar, Jan 20 2022