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.

A138953 Sum of numbers from all substrings of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15
Offset: 0

Views

Author

Zak Seidov, Apr 04 2008

Keywords

Examples

			One-digit numbers have no substring, hence a(0..9)=0;
a(10)  = 1+0 = 1,
a(123) = 1+2+3+12+23 = 41,
a(150) = 1+5+0+15+50 = 71.
		

Crossrefs

Cf. A093882.

Programs

  • Mathematica
    Table[id=IntegerDigits[n]; Total[Flatten[Table[FromDigits/@ Partition[id,k,1], {k,Length[id]-1}]]], {n,0,150}]

Formula

a(n) = A071980(n) - n. [R. J. Mathar, Jul 06 2009]
Note: Mathar's formula works for numbers with 1, 2 or 3 digits, but thereafter only for numbers whose internal digits are zeros. [Christian N. K. Anderson, May 13 2013]