login
A133096
a(n) = A079848(n) - A062294(n).
3
0, 0, 0, 4, 12, 20, 18, 50, 34, 66, 80, 70, 120, 76, 90, 198, 140, 70, 110, 156, 100, 164, 10, -6, 198, 66, 258, 280, 732, 390, 594, 342, 270, 314, 210, 402, 252, 246, -28, -204, -224, 234, 14, 528, 500, 850, 1110, 942, 1014, 1542, 1906, 1416, 1034, 1454, 970, 982, 1518
OFFSET
1,4
COMMENTS
A079848 is the sequence of smallest primes such that the pairwise sums of not necessarily distinct elements are all distinct, whereas A062294 is the sequence of smallest primes such that the pairwise sums of distinct elements are all distinct.
LINKS
EXAMPLE
a(6) = A079848(6) - A062294(6) = 37 - 17 = 20.
PROG
(Python)
from collections import deque
from itertools import islice
from sympy import nextprime
def A133096_gen(): # generator of terms
aset2, alist, bset2, blist, aqueue, bqueue, k = set(), [], set(), [], deque(), deque(), 1
while (k:=nextprime(k)):
cset2 = set()
for a in alist:
if (m:=k-a) in aset2:
break
cset2.add(m)
else:
aqueue.append(k)
alist.append(k)
aset2.update(cset2)
cset2 = set()
for b in blist:
if (m:=b+k) in bset2:
break
cset2.add(m)
else:
bqueue.append(k)
blist.append(k)
bset2.update(cset2)
if len(aqueue) > 0 and len(bqueue) > 0:
yield aqueue.popleft()-bqueue.popleft()
A133096_list = list(islice(A133096_gen(), 30)) # Chai Wah Wu, Sep 11 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Klaus Brockhaus, Sep 17 2007
STATUS
approved