OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 3, a(n) = (7 mod 2) + (11 mod 3) + (13 mod 5) = 1+2+3 = 6.
MAPLE
f:= proc(n) local k;
add(ithprime(n+k) mod ithprime(k), k=1..n)
end proc:
map(f, [$1..100]);
MATHEMATICA
a[n_]:=Sum[Mod[Prime[i+n], Prime[i]], {i, n}]; Array[a, 57] (* Stefano Spezia, Jun 15 2022 *)
PROG
(PARI) a(n) = sum(i=1, n, prime(i+n) % prime(i)); \\ Michel Marcus, Jun 15 2022
(Python)
from sympy import prime
def A354975(n): return sum(prime(i+n) % prime(i) for i in range(1, n+1)) # Chai Wah Wu, Jun 19 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jun 15 2022
STATUS
approved