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.

A096772 A B3-sequence: a(1) = 1; for n>1, a(n) = smallest number > a(n-1) such that the sums of any three terms are all distinct.

This page as a plain text file.
%I A096772 #22 Feb 16 2025 08:32:54
%S A096772 1,2,5,14,33,72,125,219,376,573,745,1209,1557,2442,3098,4048,5298,
%T A096772 6704,7839,10987,12332,15465,19144,24546,28974,34406,37769,45864,
%U A096772 50877,61372,68303,77918,88545,101917,122032,131625,148575,171237,197815,201454
%N A096772 A B3-sequence: a(1) = 1; for n>1, a(n) = smallest number > a(n-1) such that the sums of any three terms are all distinct.
%C A096772 This is the B3-sequence analog of the Mian-Chowla B2-sequence (A005282): Let a(1)=1; then use the greedy algorithm to choose the smallest a(n) > a(n-1) such that all sums a(i) + a(j) + a(k) are distinct for 1 <= i <= j <= k <= n. The reciprocal sum of the sequence for the first forty terms is 1.837412....
%H A096772 Chai Wah Wu, <a href="/A096772/b096772.txt">Table of n, a(n) for n = 1..176</a>
%H A096772 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/B2-Sequence.html">B2-Sequence.</a>
%H A096772 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Mian-ChowlaSequence.html">Mian-Chowla Sequence.</a>
%F A096772 a(n) = A051912(n-1) + 1. - _Peter Kagey_, Oct 20 2021
%o A096772 (Python)
%o A096772 from itertools import count, islice
%o A096772 def A096772_gen(): # generator of terms
%o A096772     aset1, aset2, aset3, alist = set(), set(), set(), []
%o A096772     for k in count(1):
%o A096772         bset2, bset3 = {k<<1}, {3*k}
%o A096772         if 3*k not in aset3:
%o A096772             for d in aset1:
%o A096772                 if (m:=d+(k<<1)) in aset3:
%o A096772                     break
%o A096772                 bset2.add(d+k)
%o A096772                 bset3.add(m)
%o A096772             else:
%o A096772                 for d in aset2:
%o A096772                     if (m:=d+k) in aset3:
%o A096772                         break
%o A096772                     bset3.add(m)
%o A096772                 else:
%o A096772                     yield k
%o A096772                     alist.append(k)
%o A096772                     aset1.add(k)
%o A096772                     aset2 |= bset2
%o A096772                     aset3 |= bset3
%o A096772 A096772_list = list(islice(A096772_gen(),30)) # _Chai Wah Wu_, Sep 05 2023
%Y A096772 Row 3 of A347570.
%Y A096772 Cf. A005282 (Mian-Chowla B2-sequence). A051912.
%K A096772 nonn
%O A096772 1,2
%A A096772 _Rick L. Shepherd_, Aug 15 2004