[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”).

a(n) = A062295(n) - A133743(n).
4

%I #11 Sep 11 2023 17:50:19

%S 0,0,0,0,0,0,15,-19,-44,0,31,33,80,43,92,0,112,305,140,-77,336,261,0,

%T -103,-228,129,131,268,429,292,-153,-805,-352,189,985,2040,1260,440,

%U -693,-468,239,-2367,-1365,-285,885,596,3531,2608,3360,2752,-2196,0,2709,4367,4411,2105

%N a(n) = A062295(n) - A133743(n).

%C 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.

%H Klaus Brockhaus, <a href="/A133744/b133744.txt">Table of n, a(n) for n = 1..4944</a>

%e a(7) = A062295(7) - A133743(7) = 64 - 49 = 15.

%o (Python)

%o from collections import deque

%o from itertools import count, islice

%o def A133744_gen(): # generator of terms

%o aset2, alist, bset2, blist, aqueue, bqueue = set(), [], set(), [], deque(), deque()

%o for k in (n**2 for n in count(1)):

%o cset2 = {k<<1}

%o if (k<<1) not in aset2:

%o for a in alist:

%o if (m:=a+k) in aset2:

%o break

%o cset2.add(m)

%o else:

%o aqueue.append(k)

%o alist.append(k)

%o aset2.update(cset2)

%o cset2 = set()

%o for b in blist:

%o if (m:=b+k) in bset2:

%o break

%o cset2.add(m)

%o else:

%o bqueue.append(k)

%o blist.append(k)

%o bset2.update(cset2)

%o if len(aqueue) > 0 and len(bqueue) > 0:

%o yield aqueue.popleft()-bqueue.popleft()

%o A133744_list = list(islice(A133744_gen(),30)) # _Chai Wah Wu_, Sep 11 2023

%Y Cf. A062295, A133743, A133745.

%K sign

%O 1,7

%A _Klaus Brockhaus_, Sep 24 2007