OFFSET
1,1
COMMENTS
a(n) is always odd.
From Robert G. Wilson v, Jun 21 2017: (Start)
Obviously, prime(n)|a(n) for n>1.
a(n)/prime(n), n>1: 5, 11, 17, 31, 41, 53, 73, 83, 107, 131, 145, 161, 181, 205, 235, 277, 287, 299, 339, etc.
Values of n such that a(n) < a(n-1): 34, 51, 57, 58, 65, 69, 71, 91, 96, 105, 109, 111, ....
(End)
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 5 = 2+3,
a(2) = 15 = 3+7+5,
a(3) = 55 = 5+11+7+13+19,
a(4) = 119 = 7+29+23+17+11+19+13,
a(5) = 341 = 11+23+13+47+37+71+17+29+19+31+43, etc.
MATHEMATICA
f[n_] := Block[{p = Prime@ n, q, i = s = 0}, While[i < p, q = If[OddQ@ i, 2, 1]*p + i; While[ !PrimeQ@ q, q += 2p]; s += q; i++]; s]; f[1] = 5; Array[f, 100] (* Robert G. Wilson v, Jun 21 2017 *)
PROG
(PARI) a(n) = {res = 0; for (index = 0, prime(n)-1, m = n; while ((prime(m) % prime(n)) != index, m++; ); res += prime(m); ); res; } \\ Michel Marcus, Jun 04 2014
(Python)
from sympy import prime, isprime
def a(n):
if n==1: return 5
p=prime(n)
i=0
s=0
while i<p:
q=(2 if i%2 else 1)*p + i
while not isprime(q): q+=2*p
s+=q
i+=1
return s
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 22 2017, after Mathematica code
CROSSREFS
KEYWORD
nonn
AUTHOR
Torlach Rush, May 30 2014
EXTENSIONS
More terms from Michel Marcus, Jun 05 2014
Entry revised by N. J. A. Sloane, Jun 23 2017
Name corrected by Andrey Zabolotskiy, Dec 25 2023
STATUS
approved