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.

A005282 Mian-Chowla sequence (a B_2 sequence): a(1) = 1; for n>1, a(n) = smallest number > a(n-1) such that the pairwise sums of elements are all distinct.

This page as a plain text file.
%I A005282 M1094 #111 Jul 04 2025 21:31:10
%S A005282 1,2,4,8,13,21,31,45,66,81,97,123,148,182,204,252,290,361,401,475,565,
%T A005282 593,662,775,822,916,970,1016,1159,1312,1395,1523,1572,1821,1896,2029,
%U A005282 2254,2379,2510,2780,2925,3155,3354,3591,3797,3998,4297,4433,4779,4851
%N A005282 Mian-Chowla sequence (a B_2 sequence): a(1) = 1; for n>1, a(n) = smallest number > a(n-1) such that the pairwise sums of elements are all distinct.
%C A005282 An alternative definition is to start with 1 and then continue with the least number such that all pairwise differences of distinct elements are all distinct. - _Jens Voß_, Feb 04 2003. [However, compare A003022 and A227590. - _N. J. A. Sloane_, Apr 08 2016]
%C A005282 Rachel Lewis points out [see link] that S, the sum of the reciprocals of this sequence, satisfies 2.158435 <= S <= 2.158677. Similarly, the sum of the squares of reciprocals of this sequence converges to approximately 1.33853369 and the sum of the cube of reciprocals of this sequence converges to approximately 1.14319352. - _Jonathan Vos Post_, Nov 21 2004; comment changed by _N. J. A. Sloane_, Jan 02 2020
%C A005282 Let S denote the reciprocal sum of a(n). Then 2.158452685 <= S <= 2.158532684. - _Raffaele Salvia_, Jul 19 2014
%C A005282 From _Thomas Ordowski_, Sep 19 2014: (Start)
%C A005282 Known estimate: n^2/2 + O(n) < a(n) < n^3/6 + O(n^2).
%C A005282 Conjecture: a(n) ~ n^3 / log(n)^2. (End)
%D A005282 P. Erdős and R. Graham, Old and new problems and results in combinatorial number theory. Monographies de L'Enseignement Mathématique (1980).
%D A005282 S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 2.20.2.
%D A005282 R. K. Guy, Unsolved Problems in Number Theory, E28.
%D A005282 A. M. Mian and S. D. Chowla, On the B_2-sequences of Sidon, Proc. Nat. Acad. Sci. India, A14 (1944), 3-4.
%D A005282 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A005282 T. D. Noe, <a href="/A005282/b005282.txt">Table of n, a(n) for n=1..5818</a> (terms less than 2*10^9)
%H A005282 Thomas Bloom, <a href="https://www.erdosproblems.com/340">Problem 340</a>, Erdős Problems.
%H A005282 Yin Choi Cheng, <a href="https://doi.org/10.1016/j.jnt.2024.07.010">Greedy Sidon sets for linear forms</a>, J. Num. Theor. (2024).
%H A005282 Rachel Lewis, <a href="/A005282/a005282.pdf">Mian-Chowla and B2 sequences</a>, 1999. [Thanks to _Steven Finch_ for providing this document. Included with permission. - _N. J. A. Sloane_, Jan 02 2020]
%H A005282 Kevin O'Bryant, <a href="https://arxiv.org/abs/2312.10910">B_h-Sets and Rigidity</a>, arXiv:2312.10910 [math.NT], 2023.
%H A005282 Raffaele Salvia, <a href="/A005282/a005282.txt">Table of n, a(n) for n=1...25000</a>
%H A005282 R. Salvia, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Salvia/salvia3.html">A New Lower Bound for the Distinct Distance Constant</a>, J. Int. Seq. 18 (2015) # 15.4.8.
%H A005282 N. J. A. Sloane, <a href="/A001149/a001149.pdf">Handwritten notes on Self-Generating Sequences, 1970</a> (note that A1148 has now become A005282)
%H A005282 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/B2-Sequence.html">B2 Sequence.</a>
%H A005282 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Mian-ChowlaSequence.html">Chowla Sequence.</a>
%H A005282 Zhang Zhen-Xiang, <a href="http://dx.doi.org/10.1090/S0025-5718-1993-1181334-7">A B_2-sequence with larger reciprocal sum</a>, Math. Comp. 60 (1993), 835-839.
%H A005282 <a href="/index/Br#B_2">Index entries for B_2 sequences.</a>
%F A005282 a(n) = A025582(n) + 1.
%F A005282 a(n) = (A034757(n)+1)/2.
%e A005282 The second term is 2 because the 3 pairwise sums 1+1=2, 1+2=3, 2+2=4 are all distinct.
%e A005282 The third term cannot be 3 because 1+3 = 2+2. But it can be 4, since 1+4=5, 2+4=6, 4+4=8 are distinct and distinct from the earlier sums 1+1=2, 1+2=3, 2+2=4.
%p A005282 a[1]:= 1: P:= {2}: A:= {1}:
%p A005282 for n from 2 to 100 do
%p A005282   for t from a[n-1]+1 do
%p A005282     Pt:= map(`+`,A union {t},t);
%p A005282     if Pt intersect P = {} then break fi
%p A005282   od:
%p A005282   a[n]:= t;
%p A005282   A:= A union {t};
%p A005282   P:= P union Pt;
%p A005282 od:
%p A005282 seq(a[n],n=1..100); # _Robert Israel_, Sep 21 2014
%t A005282 t = {1}; sms = {2}; k = 1; Do[k++; While[Intersection[sms, k + t] != {}, k++]; sms = Join[sms, t + k, {2 k}]; AppendTo[t, k], {49}]; t (* _T. D. Noe_, Mar 02 2011 *)
%o A005282 (Haskell)
%o A005282 import Data.Set (Set, empty, insert, member)
%o A005282 a005282 n = a005282_list !! (n-1)
%o A005282 a005282_list = sMianChowla [] 1 empty where
%o A005282    sMianChowla :: [Integer] -> Integer -> Set Integer -> [Integer]
%o A005282    sMianChowla sums z s | s' == empty = sMianChowla sums (z+1) s
%o A005282                         | otherwise   = z : sMianChowla (z:sums) (z+1) s
%o A005282       where s' = try (z:sums) s
%o A005282             try :: [Integer] -> Set Integer -> Set Integer
%o A005282             try []     s                      = s
%o A005282             try (x:sums) s | (z+x) `member` s = empty
%o A005282                            | otherwise        = try sums $ insert (z+x) s
%o A005282 -- _Reinhard Zumkeller_, Mar 02 2011
%o A005282 (PARI) A005282_vec(N, A=[1], U=[0], D(A, n=#A)=vector(n-1, k, A[n]-A[n-k]))={ while(#A<N, my(k=1); A=concat(A,A[#A]+U[1]); until(!setintersect(U,D(A)), A[#A]++); U=setunion(U,D(A)); while(k<#U && U[k++]<U[1]+k,); k>2 && U=U[k-1..-1]);A} \\ _M. F. Hasler_, Oct 09 2019
%o A005282 (PARI) aupto(L)= my(S=vector(L), A=[1]); for(i=2, L, for(j=1, #A, if(S[i-A[j]], next(2))); for(j=1, #A, S[i-A[j]]=1); A=concat(A, i)); A \\ _Ruud H.G. van Tol_, Jun 30 2025
%o A005282 (Python)
%o A005282 from itertools import count, islice
%o A005282 def A005282_gen(): # generator of terms
%o A005282     aset1, aset2, alist = set(), set(), []
%o A005282     for k in count(1):
%o A005282         bset2 = {k<<1}
%o A005282         if (k<<1) not in aset2:
%o A005282             for d in aset1:
%o A005282                 if (m:=d+k) in aset2:
%o A005282                     break
%o A005282                 bset2.add(m)
%o A005282             else:
%o A005282                 yield k
%o A005282                 alist.append(k)
%o A005282                 aset1.add(k)
%o A005282                 aset2 |= bset2
%o A005282 A005282_list = list(islice(A005282_gen(),30)) # _Chai Wah Wu_, Sep 05 2023
%Y A005282 Row 2 of A347570.
%Y A005282 Cf. A051788, A080200 (for differences between terms).
%Y A005282 Different from A046185. Cf. A011185.
%Y A005282 See also A003022, A227590.
%Y A005282 A259964 has a greater sum of reciprocals.
%Y A005282 Cf. A002858.
%K A005282 nonn,nice
%O A005282 1,2
%A A005282 _N. J. A. Sloane_ and _Simon Plouffe_
%E A005282 Examples added by _N. J. A. Sloane_, Jun 01 2008