OFFSET
1,1
COMMENTS
Asymptotically, a(n) ~ 5n by Dirichlet's theorem. - Charles R Greathouse IV, Sep 28 2008
EXAMPLE
a(1) = 2;
a(2) = 2 + 3 = 5;
a(3) = 2 + 3 + 5 = 10;
a(4) = 2 + 3 + 5 + 7 = 17;
a(5) = 2 + 3 + 5 + 7 + 1(1) = 2 + 3 + 5 + 7 + 1 = 18.
MATHEMATICA
f[n_] := Sum[ Mod[ Prime[i], 10], {i, n}]; Array[ f, 60] (* Robert G. Wilson v, Dec 22 2004 *)
Rest@ FoldList[Plus, 0, Mod[Prime@ Range@ 60, 10]] (* Robert G. Wilson v, Jan 16 2011 *)
PROG
(PARI) sum(k=1, n, prime(k)%10) \\ Charles R Greathouse IV, Sep 28 2008
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jorge Coveiro, Dec 22 2004
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Dec 22 2004
STATUS
approved