OFFSET
1,2
LINKS
Winston de Greef, Table of n, a(n) for n = 1..10000
EXAMPLE
a(6): 6th prime = 13 and the (6+1)th prime = 17; the composites between are {14,15,16} and the distinct prime factors of this set are {2,7,3,5} (no duplicates allowed); so a(6) = 2 + 7 + 3 + 5 = 17.
MATHEMATICA
a[n_] := Plus @@ Union@ (Join @@ (FactorInteger[#][[;; , 1]] & /@ Range[Prime[n] + 1, Prime[n + 1] - 1])); Array[a, 65] (* Amiram Eldar, Mar 27 2023 *)
PROG
(Python)
from sympy import primefactors, sieve
def A361806(n):
primeset = []
for composites in range (sieve[n]+1, sieve[n+1]):
for p in primefactors(composites): primeset.append(p)
return(sum(set(primeset)))
(PARI) a(n) = my(list=List()); for(i=prime(n)+1, prime(n+1)-1, my(f=factor(i)[, 1]); for (k=1, #f, listput(list, f[k]))); vecsum(Set(list)); \\ Michel Marcus, Mar 27 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Karl-Heinz Hofmann, Mar 26 2023
STATUS
approved