OFFSET
1,3
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{k=1..n} A004648(k).
EXAMPLE
A004648 begins: 0, 1, 2, 3, 1, 1, 3, 3, 5, 9, 9, ... so the partial sums are 0, 1, 3, 6, 7, 8, 11, 14, 19, 28, 37, ...
MATHEMATICA
Table[Sum[Mod[Prime[j], j], {j, n}], {n, 100}] (* G. C. Greubel, Apr 20 2023 *)
Accumulate[Table[Mod[Prime[n], n], {n, 100}]] (* Harvey P. Dale, Jun 14 2023 *)
PROG
(PARI) s=vector(100):s[1]=prime(1)%1:for(n=2, 100, s[n]=s[n-1]+prime(n)%n)
(Magma) [(&+[(NthPrime(k) mod k): k in [1..n]]): n in [1..100]]; // G. C. Greubel, Apr 20 2023
(SageMath)
def A004648(n): return (nth_prime(n)%n)
[A099850(n) for n in range(1, 101)] # G. C. Greubel, Apr 20 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 27 2004
STATUS
approved