OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Todor Szimeonov, A completive sequence
MATHEMATICA
a[1] = 1; a[n_] := a[n] = NextPrime[a[n - 1] + n] - a[n - 1] - n; Array[a, 100] (* Amiram Eldar, Apr 04 2021 *)
nxt[{n_, a_}]:={n+1, NextPrime[a+n+1]-a-n-1}; NestList[nxt, {1, 1}, 100][[;; , 2]] (* Harvey P. Dale, Oct 19 2025 *)
PROG
(Python)
from sympy import nextprime
def aupton(terms):
alst = [1]
for n in range(2, terms+1):
alst.append(nextprime(alst[-1] + n) - alst[-1] - n)
return alst
print(aupton(87)) # Michael S. Branicky, Apr 04 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Todor Szimeonov, Apr 04 2021
STATUS
approved
