OFFSET
1,3
COMMENTS
Row sums of A207409. - Bob Selcoe, Apr 14 2014
The sequence does not change if defined to go up to the n-th prime, as that contributes 0 to the sum; it's merely a computational optimization. Conjecture: For all n > 6, a(n) > prime(n). A corollary of this conjecture is that a(6) = 13 is the only instance of a(n) = prime(n) in the sequence. - Alonso del Arte, Jul 27 2026
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{k = 1 .. n - 1} ( prime(n) mod prime(k) ).
a(n) >= n - 1 for all n; a(n) > n - 1 for all n > 2 (loose lower bound). a(n) < n^2 (loose upper bound). If prime(n) = 1 mod 6, then a(n) >= 4. If prime(n) = 5 mod 6, then a(n) > 5. - Alonso del Arte, Jul 27 2026
EXAMPLE
a(5) = 8. The remainders when the fifth prime, 11, is divided by 2, 3, 5, 7 are 1, 2, 1, 4, and those add up to 8.
a(6) = 13. Reckoning 13 modulo {2, 3, 5, 7, 11} gives us 1, 1, 3, 6, 2, and 1 + 1 + 3 + 6 + 2 = 13.
a(7) = 18. From 17 modulo {2, 3, 5, 7, 11, 13} we get 1 + 2 + 2 + 3 + 6 + 4 = 18.
MAPLE
P:= [seq(ithprime(i), i=1..200)]:
f:= proc(n) local j; add(P[n] mod P[j], j=1..n-1) end proc:
map(f, [$1..200]); # Robert Israel, Dec 29 2020
MATHEMATICA
a[n_] := Sum[Mod[Prime[n], Prime[i]], {i, 1, n - 1}]
(* Alternative: *)
Table[Total[Mod[Prime[n], Prime[Range[n - 1]]]], {n, 60}] (* Harvey P. Dale, Mar 07 2018 *)
PROG
(PARI) {for(n=1, 200, print1(sum(k=1, n, prime(n)%prime(k)), ", "))}
(Python) from sympy import prime; {print(sum(prime(n)%prime(k) for k in range(1, n)), end =', ') for n in range(1, 54)} # Ya-Ping Lu, May 05 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Armand Turpel (armandt(AT)unforgettable.com)
EXTENSIONS
Edited by Dean Hickerson, Mar 02 2002
STATUS
approved