cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A133097 a(n) = A005282(n) - A011185(n-1).

This page as a plain text file.
%I A133097 #12 Sep 11 2023 17:51:49
%S A133097 0,0,1,3,5,8,10,15,27,28,23,28,20,30,22,40,32,45,27,62,89,62,116,167,
%T A133097 105,118,108,51,99,151,88,137,137,265,174,195,320,321,249,283,226,281,
%U A133097 293,394,465,369,585,565,639,404,483,221,233,428,384,370,527,431,818
%N A133097 a(n) = A005282(n) - A011185(n-1).
%C A133097 Also A025582(n) - A010672(n-1).
%C A133097 A005282 is the sequence of smallest numbers such that the pairwise sums of not necessarily distinct elements are all distinct, whereas A011185 is the sequence of smallest numbers such that the pairwise sums of distinct elements are all distinct.
%C A133097 Sequence has negative terms; the first one is a(65) = -130.
%H A133097 Klaus Brockhaus, <a href="/A133097/b133097.txt">Table of n, a(n) for n = 1..2400</a>
%e A133097 a(6) = A005282(6) - A011185(6) = 21 - 13 = 8.
%o A133097 (Python)
%o A133097 from itertools import count, islice
%o A133097 from collections import deque
%o A133097 def A133097_gen(): # generator of terms
%o A133097     aset2, alist, bset2, blist, aqueue, bqueue = set(), [], set(), [], deque(), deque()
%o A133097     for k in count(1):
%o A133097         cset2 = {k<<1}
%o A133097         if (k<<1) not in aset2:
%o A133097             for a in alist:
%o A133097                 if (m:=a+k) in aset2:
%o A133097                     break
%o A133097                 cset2.add(m)
%o A133097             else:
%o A133097                 aqueue.append(k)
%o A133097                 alist.append(k)
%o A133097                 aset2.update(cset2)
%o A133097         cset2 = set()
%o A133097         for b in blist:
%o A133097             if (m:=b+k) in bset2:
%o A133097                 break
%o A133097             cset2.add(m)
%o A133097         else:
%o A133097             bqueue.append(k)
%o A133097             blist.append(k)
%o A133097             bset2.update(cset2)
%o A133097         if len(aqueue) > 0 and len(bqueue) > 0:
%o A133097             yield aqueue.popleft()-bqueue.popleft()
%o A133097 A133097_list = list(islice(A133097_gen(),30)) # _Chai Wah Wu_, Sep 11 2023
%Y A133097 Cf. A005282, A011185, A025582, A010672, A133096.
%K A133097 sign
%O A133097 1,4
%A A133097 _Klaus Brockhaus_, Sep 17 2007