OFFSET
1,2
FORMULA
a(n) = Sum_{k=1..n} p(k, n-k+1), where p(n,0) = n and p(n,k) = prime(p(n, k-1)) for k >= 1.
PROG
(Python)
from sympy import prime
def nprime(x, y):
p = x
for _ in range(y):
p = prime(p)
return p
def a(n):
return sum([nprime(k, n-k) for k in range(1, n+1)])
(PARI) a(n) = sum(k=1, n, my(p=k); for(j=k+1, n, p=prime(p)); p) \\ Andrew Howroyd, Feb 04 2023
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Christoph B. Kassir, Feb 03 2023
EXTENSIONS
a(9)-a(15) from Andrew Howroyd, Feb 03 2023
a(16)-a(20) from Alois P. Heinz, Feb 03 2023
STATUS
approved