

A033955


a(n) = sum of the remainders when the nth prime is divided by primes up to the (n1)th prime.


12



0, 1, 3, 4, 8, 13, 18, 27, 29, 46, 56, 70, 74, 88, 98, 134, 147, 171, 200, 217, 252, 274, 309, 323, 348, 418, 448, 471, 522, 571, 629, 685, 739, 777, 793, 853, 954, 997, 1002, 1120, 1148, 1220, 1338, 1419, 1466, 1540, 1615, 1573, 1633, 1707, 1825, 1892, 1986
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


COMMENTS



LINKS



FORMULA

a(n) = Sum_{k=1..n1} ( prime(n) mod prime(k) ).


EXAMPLE

a(5) = 8. The remainders when the fifth prime 11 is divided by 2, 3, 5, 7 are 1, 2, 1, 4, respectively and their sum = 8.


MAPLE

P:= [seq(ithprime(i), i=1..200)]:
f:= proc(n) local j; add(P[n] mod P[j], j=1..n1) end proc:


MATHEMATICA

a[n_] := Sum[Mod[Prime[n], Prime[i]], {i, 1, n1}]
Table[Total[Mod[Prime[n], Prime[Range[n1]]]], {n, 60}] (* Harvey P. Dale, Mar 07 2018 *)


PROG

(PARI) {for(n=1, 200, print1(sum(k=1, n, prime(n)%prime(k)), ", "))}


CROSSREFS



KEYWORD

nonn,easy


AUTHOR

Armand Turpel (armandt(AT)unforgettable.com)


EXTENSIONS



STATUS

approved



