OFFSET
1,2
EXAMPLE
a(1)=abs(3-2)=1, a(2)=abs(5-23)=abs(-18)=18, a(3)=abs(7-37)=abs(-30)=30, etc.
PROG
(Python)
from sympy import nextprime
def aupton(terms):
n, p, q = 1, 2, 3
alst, non_twins, twins = [], [2], [3]
while True:
p, q = q, nextprime(q)
if q - p == 2:
if p != twins[-1]: twins.append(p)
twins.append(q)
else:
if p != twins[-1]: non_twins.append(p)
if len(twins) >= n and len(non_twins) >= n:
alst.append(abs(twins[n-1] - non_twins[n-1]))
if n == terms: break
n += 1
return alst
print(aupton(63)) # Michael S. Branicky, Jan 18 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jun 04 2009
EXTENSIONS
Terms corrected by D. S. McNeil, Dec 10 2009
STATUS
approved