[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A133744
a(n) = A062295(n) - A133743(n).
4
0, 0, 0, 0, 0, 0, 15, -19, -44, 0, 31, 33, 80, 43, 92, 0, 112, 305, 140, -77, 336, 261, 0, -103, -228, 129, 131, 268, 429, 292, -153, -805, -352, 189, 985, 2040, 1260, 440, -693, -468, 239, -2367, -1365, -285, 885, 596, 3531, 2608, 3360, 2752, -2196, 0, 2709, 4367, 4411, 2105
OFFSET
1,7
COMMENTS
A062295 is the sequence of smallest squares such that the pairwise sums of not necessarily distinct elements are all distinct, whereas A133743 is the sequence of smallest squares such that the pairwise sums of distinct elements are all distinct.
LINKS
EXAMPLE
a(7) = A062295(7) - A133743(7) = 64 - 49 = 15.
PROG
(Python)
from collections import deque
from itertools import count, islice
def A133744_gen(): # generator of terms
aset2, alist, bset2, blist, aqueue, bqueue = set(), [], set(), [], deque(), deque()
for k in (n**2 for n in count(1)):
cset2 = {k<<1}
if (k<<1) not in aset2:
for a in alist:
if (m:=a+k) 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()
A133744_list = list(islice(A133744_gen(), 30)) # Chai Wah Wu, Sep 11 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Klaus Brockhaus, Sep 24 2007
STATUS
approved