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.
%I A025582 #53 Feb 16 2025 08:32:35 %S A025582 0,1,3,7,12,20,30,44,65,80,96,122,147,181,203,251,289,360,400,474,564, %T A025582 592,661,774,821,915,969,1015,1158,1311,1394,1522,1571,1820,1895,2028, %U A025582 2253,2378,2509,2779,2924,3154,3353,3590,3796,3997,4296,4432,4778,4850 %N A025582 A B_2 sequence: a(n) is the least value such that sequence increases and pairwise sums of elements are all distinct. %C A025582 a(n) is also the least value such that sequence increases and pairwise differences of distinct elements are all distinct. %H A025582 David W. Wilson, <a href="/A025582/b025582.txt">Table of n, a(n) for n = 1..1000</a> %H A025582 Alon Amit, <a href="https://www.quora.com/What-are-some-interesting-proofs-using-transfinite-induction/answer/Alon-Amit">What are some interesting proofs using transfinite induction?</a>, Quora, Nov 15 2014. %H A025582 LiJun Zhang, Bing Li, and LeeTang Cheng, <a href="http://dx.doi.org/10.1007/s11432-013-4971-x">Constructions of QC LDPC codes based on integer sequences</a>, Science China Information Sciences, June 2014, Volume 57, Issue 6, pp 1-14. %H A025582 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/B2-Sequence.html">B2 Sequence</a>. %H A025582 <a href="/index/Br#B_2">Index entries for B_2 sequences.</a> %F A025582 a(n) = A005282(n) - 1. - _Tyler Busby_, Mar 16 2024 %e A025582 After 0, 1, a(3) cannot be 2 because 2+0 = 1+1, so a(3) = 3. %o A025582 (Sage) %o A025582 def A025582_list(n): %o A025582 a = [0] %o A025582 psums = set([0]) %o A025582 while len(a) < n: %o A025582 a += [next(k for k in IntegerRange(a[-1]+1, infinity) if not any(i+k in psums for i in a+[k]))] %o A025582 psums.update(set(i+a[-1] for i in a)) %o A025582 return a[:n] %o A025582 print(A025582_list(20)) %o A025582 # _D. S. McNeil_, Feb 20 2011 %o A025582 (Python) %o A025582 from itertools import count, islice %o A025582 def A025582_gen(): # generator of terms %o A025582 aset1, aset2, alist = set(), set(), [] %o A025582 for k in count(0): %o A025582 bset2 = {k<<1} %o A025582 if (k<<1) not in aset2: %o A025582 for d in aset1: %o A025582 if (m:=d+k) in aset2: %o A025582 break %o A025582 bset2.add(m) %o A025582 else: %o A025582 yield k %o A025582 alist.append(k) %o A025582 aset1.add(k) %o A025582 aset2 |= bset2 %o A025582 A025582_list = list(islice(A025582_gen(),20)) # _Chai Wah Wu_, Sep 01 2023 %Y A025582 Row 2 of A365515. %Y A025582 See A011185 for more information. %Y A025582 A010672 is a similar sequence, but there the pairwise sums of distinct elements are all distinct. %K A025582 nonn %O A025582 1,3 %A A025582 _Dan Hoey_