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.

A007605 Sum of digits of n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 2, 4, 8, 10, 5, 11, 4, 10, 5, 7, 11, 8, 14, 7, 13, 8, 10, 16, 11, 17, 16, 2, 4, 8, 10, 5, 10, 5, 11, 13, 14, 7, 13, 10, 14, 11, 17, 10, 11, 13, 17, 19, 4, 7, 11, 13, 8, 14, 7, 8, 14, 11, 17, 10, 16, 11, 13, 14, 10, 5, 7, 11, 7, 13, 14, 16, 11, 17, 16, 13, 19, 14, 20, 19, 5
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007605_list = map a007953 a000040_list -- Reinhard Zumkeller, Aug 04 2011
    
  • Magma
    [ &+Intseq(NthPrime(n), 10): n in [1..80] ]; // Klaus Brockhaus, Jun 13 2009
    
  • Maple
    map(t -> convert(convert(t,base,10),`+`), select(isprime, [2,(2*i+1 $ i=1..1000)])); # Robert Israel, Aug 16 2015
  • Mathematica
    Table[Apply[Plus, RealDigits[Prime[n]][[1]]], {n, 1, 100}]
    Plus@@ IntegerDigits[Prime[Range[100]]] (* Zak Seidov *)
  • PARI
    dsum(n)=my(s);while(n,s+=n%10;n\=10);s
    forprime(p=2,1e3,print1(dsum(p)", ")) \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    a(n) = sumdigits(prime(n)); \\ Michel Marcus, Dec 20 2017
    
  • Python
    from sympy import prime
    def a(n): return sum(map(int, str(prime(n))))
    print([a(n) for n in range(1, 80)]) # Michael S. Branicky, Feb 03 2021

Formula

a(n) = A007953(A000040(n)) = A007953(prime(n)).