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.

A113580 Define prime(0) = 1; then a(n) = sum prime(d), where d ranges over the decimal digits of n.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 3, 4, 5, 7, 9, 13, 15, 19, 21, 25, 4, 5, 6, 8, 10, 14, 16, 20, 22, 26, 6, 7, 8, 10, 12, 16, 18, 22, 24, 28, 8, 9, 10, 12, 14, 18, 20, 24, 26, 30, 12, 13, 14, 16, 18, 22, 24, 28, 30, 34, 14, 15, 16, 18, 20, 24, 26, 30, 32, 36, 18, 19, 20, 22, 24, 28
Offset: 0

Views

Author

Amarnath Murthy, Nov 06 2005

Keywords

Examples

			a(123) = prime(1) + prime(2) + prime(3) = 2 + 3 + 5 = 10.
a(10001) = 2 + 1 + 1 + 1 + 2 = 7.
		

Crossrefs

Cf. A113581; first occurrence in A113736.

Programs

  • Mathematica
    f[n_] := Plus @@ (IntegerDigits[n] /. {0 -> 1, 1 -> 2, 2 -> 3, 3 -> 5, 4 -> 7, 5 -> 11, 6 -> 13, 7 -> 17, 8 -> 19, 9 -> 23}); Table[ f[n], {n, 0, 75}] (* Robert G. Wilson v *)

Extensions

More terms from Robert G. Wilson v, Nov 08 2005