login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A283556 Digital root of the sum of the first n primes. 1
0, 2, 5, 1, 8, 1, 5, 4, 5, 1, 3, 7, 8, 4, 2, 4, 3, 8, 6, 1, 9, 1, 8, 1, 9, 7, 9, 4, 3, 4, 9, 1, 6, 8, 3, 8, 6, 1, 2, 7, 9, 8, 9, 2, 6, 5, 6, 1, 8, 1, 5, 4, 9, 7, 6, 2, 4, 3, 4, 2, 4, 8, 4, 5, 1, 8, 1, 8, 3, 8, 6, 8, 7, 5, 9, 1, 6, 8, 9, 5, 9, 5, 3, 2, 3, 1, 3, 2, 9, 2, 6, 5, 7, 8, 4, 8, 7, 3, 2, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

LINKS

Robert Israel, Table of n, a(n) for n = 0..10000

FORMULA

a(n) = ((A007504(n) - 1) mod 9) + 1.

a(n) = ((A051351(n) - 1) mod 9) + 1.

a(n) = A010888(A007504(n)). - Michel Marcus, Mar 26 2017

EXAMPLE

For n=3, a(3)=1 because the sum of the first 3 primes is 10 and the sum of digits of 10 is 1.

MAPLE

0, op(subs(0=9, ListTools:-PartialSums(select(isprime, [2, seq(i, i=3..1000, 2)])) mod 9)); # Robert Israel, Mar 30 2017

MATHEMATICA

With[{nn = 78}, {0}~Join~Table[NestWhile[Total@ IntegerDigits@ # &, #, # >= 10 &] &@ Total@ Take[#, n], {n, nn}] &@ Array[Prime, nn]] (* Michael De Vlieger, Mar 15 2017 *)

PROG

(PARI) {

p=0; print1(p", ");

forprime(n=2, 1000,

         p+=n;

         while(p>9, p=sumdigits(p))

         ; print1(p", ")

        )

}

(Python)

from sympy import primerange

from itertools import accumulate

prime_sum = [0] + list(accumulate(primerange(2, 1000)))

def dig_root(n): return 1+(n-1)%9

def a(n):

    return 0 if n<1 else dig_root(prime_sum[n])

print([a(n) for n in range(101)]) # Indranil Ghosh, Mar 30 2017

CROSSREFS

Cf. A007504, A010888, A051351.

Sequence in context: A240241 A019510 A124576 * A340198 A268980 A297012

Adjacent sequences:  A283553 A283554 A283555 * A283557 A283558 A283559

KEYWORD

nonn,base

AUTHOR

Dimitris Valianatos, Mar 10 2017

EXTENSIONS

Corrected by Robert Israel, Mar 30 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 13 20:25 EDT 2021. Contains 345009 sequences. (Running on oeis4.)