|
|
A161164
|
|
Absolute value of (the n-th twin prime minus the n-th non-twin prime).
|
|
0
|
|
|
1, 18, 30, 36, 40, 50, 60, 54, 58, 56, 70, 68, 70, 86, 90, 66, 70, 104, 114, 96, 112, 108, 112, 98, 112, 116, 124, 134, 138, 126, 130, 128, 132, 110, 112, 108, 114, 90, 96, 92, 94, 30, 36, 36, 46, 26, 28, 22, 20, 60, 30, 52, 44, 54, 42, 54, 50, 52, 48, 178, 164, 168, 150
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|