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.
Original entry on oeis.org
1, 2, 4, 8, 13, 21, 31, 45, 66, 81, 97, 123, 148, 182, 204, 252, 290, 361, 401, 475, 565, 593, 662, 775, 822, 916, 970, 1016, 1159, 1312, 1395, 1523, 1572, 1821, 1896, 2029, 2254, 2379, 2510, 2780, 2925, 3155, 3354, 3591, 3797, 3998, 4297, 4433, 4779, 4851
Offset: 1
The second term is 2 because the 3 pairwise sums 1+1=2, 1+2=3, 2+2=4 are all distinct.
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. Erdős and R. Graham, Old and new problems and results in combinatorial number theory. Monographies de L'Enseignement Mathématique (1980).
- S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 2.20.2.
- R. K. Guy, Unsolved Problems in Number Theory, E28.
- A. M. Mian and S. D. Chowla, On the B_2-sequences of Sidon, Proc. Nat. Acad. Sci. India, A14 (1944), 3-4.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- T. D. Noe, Table of n, a(n) for n=1..5818 (terms less than 2*10^9)
- Thomas Bloom, Problem 340, Erdős Problems.
- Yin Choi Cheng, Greedy Sidon sets for linear forms, J. Num. Theor. (2024).
- Rachel Lewis, Mian-Chowla and B2 sequences, 1999. [Thanks to _Steven Finch_ for providing this document. Included with permission. - _N. J. A. Sloane_, Jan 02 2020]
- Kevin O'Bryant, B_h-Sets and Rigidity, arXiv:2312.10910 [math.NT], 2023.
- Raffaele Salvia, Table of n, a(n) for n=1...25000
- R. Salvia, A New Lower Bound for the Distinct Distance Constant, J. Int. Seq. 18 (2015) # 15.4.8.
- N. J. A. Sloane, Handwritten notes on Self-Generating Sequences, 1970 (note that A1148 has now become A005282)
- Eric Weisstein's World of Mathematics, B2 Sequence.
- Eric Weisstein's World of Mathematics, Chowla Sequence.
- Zhang Zhen-Xiang, A B_2-sequence with larger reciprocal sum, Math. Comp. 60 (1993), 835-839.
- Index entries for B_2 sequences.
A259964 has a greater sum of reciprocals.
-
import Data.Set (Set, empty, insert, member)
a005282 n = a005282_list !! (n-1)
a005282_list = sMianChowla [] 1 empty where
sMianChowla :: [Integer] -> Integer -> Set Integer -> [Integer]
sMianChowla sums z s | s' == empty = sMianChowla sums (z+1) s
| otherwise = z : sMianChowla (z:sums) (z+1) s
where s' = try (z:sums) s
try :: [Integer] -> Set Integer -> Set Integer
try [] s = s
try (x:sums) s | (z+x) `member` s = empty
| otherwise = try sums $ insert (z+x) s
-- Reinhard Zumkeller, Mar 02 2011
-
a[1]:= 1: P:= {2}: A:= {1}:
for n from 2 to 100 do
for t from a[n-1]+1 do
Pt:= map(`+`,A union {t},t);
if Pt intersect P = {} then break fi
od:
a[n]:= t;
A:= A union {t};
P:= P union Pt;
od:
seq(a[n],n=1..100); # Robert Israel, Sep 21 2014
-
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 *)
-
A005282_vec(N, A=[1], U=[0], D(A, n=#A)=vector(n-1, k, A[n]-A[n-k]))={ while(#A2 && U=U[k-1..-1]);A} \\ M. F. Hasler, Oct 09 2019
-
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
-
from itertools import count, islice
def A005282_gen(): # generator of terms
aset1, aset2, alist = set(), set(), []
for k in count(1):
bset2 = {k<<1}
if (k<<1) not in aset2:
for d in aset1:
if (m:=d+k) in aset2:
break
bset2.add(m)
else:
yield k
alist.append(k)
aset1.add(k)
aset2 |= bset2
A005282_list = list(islice(A005282_gen(),30)) # Chai Wah Wu, Sep 05 2023
A051912
a(n) is the smallest integer such that the sum of any three ordered terms a(k), k <= n, is unique.
Original entry on oeis.org
0, 1, 4, 13, 32, 71, 124, 218, 375, 572, 744, 1208, 1556, 2441, 3097, 4047, 5297, 6703, 7838, 10986, 12331, 15464, 19143, 24545, 28973, 34405, 37768, 45863, 50876, 61371, 68302, 77917, 88544, 101916, 122031, 131624, 148574, 171236, 197814
Offset: 0
Three terms chosen from {0,1,4} can be 0+0+0; 0+0+1; 0+1+1; 1+1+1; 0+0+4; 0+1+4; 1+1+4; 0+4+4; 1+4+4; 4+4+4 are all distinct (3*4*5/6 = 10 terms), so a(2) = 4 is the next integer of the sequence after 0 and 1.
-
A[0]:= 0: S:= {0}: S2:= {0}: S3:= {0}:
for i from 1 to 40 do
for x from A[i-1] do
if (map(t -> t+x,S2) intersect S3 = {}) and (map(t -> t+2*x, S) intersect S3 = {}) then
A[i]:= x;
S3:= S3 union map(t -> t+x,S2) union map(t -> t+2*x, S) union {3*x};
S2:= S2 union map(t -> t+x, S) union {2*x};
S:= S union {x};
break
fi
od
od:
seq(A[i],i=0..40); # Robert Israel, Jul 01 2019
-
a[0] = 0; a[1] = 1; a[n_] := a[n] = For[A0 = Array[a, n, 0]; an = a[n-1] + 1, True, an++, A1 = Append[A0, an]; A2 = Flatten[Table[A1[[{i, j, k}]], {i, 1, n+1}, {j, i, n+1}, {k, j, n+1}], 2]; A3 = Sort[Total /@ A2]; If[Length[A3] == Length[Union[A3]], Return[an]]]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 38}] (* Jean-François Alcover, Nov 24 2016 *)
-
from itertools import count, islice
def A051912_gen(): # generator of terms
aset1, aset2, aset3, alist = set(), set(), set(), []
for k in count(0):
bset2, bset3 = {k<<1}, {3*k}
if 3*k not in aset3:
for d in aset1:
if (m:=d+(k<<1)) in aset3:
break
bset2.add(d+k)
bset3.add(m)
else:
for d in aset2:
if (m:=d+k) in aset3:
break
bset3.add(m)
else:
yield k
alist.append(k)
aset1.add(k)
aset2 |= bset2
aset3 |= bset3
A051912_list = list(islice(A051912_gen(),20)) # Chai Wah Wu, Sep 01 2023
A365515
Table read by antidiagonals upward: the n-th row gives the lexicographically earliest infinite B_n sequence starting from 0.
Original entry on oeis.org
0, 0, 1, 0, 1, 2, 0, 1, 3, 3, 0, 1, 4, 7, 4, 0, 1, 5, 13, 12, 5, 0, 1, 6, 21, 32, 20, 6, 0, 1, 7, 31, 55, 71, 30, 7, 0, 1, 8, 43, 108, 153, 124, 44, 8, 0, 1, 9, 57, 154, 366, 368, 218, 65, 9, 0, 1, 10, 73, 256, 668, 926, 856, 375, 80, 10, 0, 1, 11, 91, 333, 1153, 2214, 2286, 1424, 572, 96, 11
Offset: 1
Table begins:
n\k | 1 2 3 4 5 6 7 8 9
----+---------------------------------------------------
1 | 0, 1, 2, 3, 4, 5, 6, 7, 8, ...
2 | 0, 1, 3, 7, 12, 20, 30, 44, 65, ...
3 | 0, 1, 4, 13, 32, 71, 124, 218, 375, ...
4 | 0, 1, 5, 21, 55, 153, 368, 856, 1424, ...
5 | 0, 1, 6, 31, 108, 366, 926, 2286, 5733, ...
6 | 0, 1, 7, 43, 154, 668, 2214, 6876, 16864, ...
7 | 0, 1, 8, 57, 256, 1153, 4181, 14180, 47381, ...
8 | 0, 1, 9, 73, 333, 1822, 8043, 28296, 102042, ...
9 | 0, 1, 10, 91, 500, 3119, 13818, 59174, 211135, ...
Cf.
A001477 (n=1),
A025582 (n=2),
A051912 (n=3),
A365300 (n=4),
A365301 (n=5),
A365302 (n=6),
A365303 (n=7),
A365304 (n=8),
A365305 (n=9),
A002061 (k=4),
A369817 (k=5),
A369818 (k=6),
A369819 (k=7),
A347570.
-
from itertools import count, islice, combinations_with_replacement
def A365515_gen(): # generator of terms
asets, alists, klist = [set()], [[]], [0]
while True:
for i in range(len(klist)-1,-1,-1):
kstart, alist, aset = klist[i], alists[i], asets[i]
for k in count(kstart):
bset = set()
for d in combinations_with_replacement(alist+[k],i):
if (m:=sum(d)+k) in aset:
break
bset.add(m)
else:
yield k
alists[i].append(k)
klist[i] = k+1
asets[i].update(bset)
break
klist.append(0)
asets.append(set())
alists.append([])
A365515_list = list(islice(A365515_gen(),30))
A067992
a(0)=1 and, for n > 0, a(n) is the smallest positive integer such that the ratios min(a(k)/a(k-1), a(k-1)/a(k)) for 0 < k <= n are all distinct.
Original entry on oeis.org
1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 5, 2, 7, 1, 8, 3, 7, 4, 5, 7, 6, 11, 1, 9, 2, 11, 3, 10, 1, 12, 5, 8, 7, 9, 4, 11, 5, 9, 8, 11, 7, 10, 9, 11, 10, 13, 1, 14, 3, 13, 2, 15, 1, 16, 3, 17, 1, 18, 5, 13, 4, 15, 7, 12, 11, 13, 6, 17, 2, 19, 1, 20, 3, 19, 4, 17, 5, 14, 9, 13, 7, 16, 5, 19, 6, 23, 1, 21, 2
Offset: 0
The sequence of all rational numbers between 0 and 1 obtained by taking ratios of sorted consecutive terms begins: 1/2, 2/3, 1/3, 1/4, 3/4, 3/5, 1/5, 1/6, 5/6, 2/5, 2/7, 1/7, 1/8, 3/8, 3/7, 4/7, 4/5, 5/7, 6/7. - _Gus Wiseman_, Aug 30 2018
See
A066720 for a somewhat similar sequence.
-
Nest[Function[seq,Append[seq,NestWhile[#+1&,1,MemberQ[Divide@@@Sort/@Partition[seq,2,1],Min[Last[seq]/#,#/Last[seq]]]&]]],{1},100] (* Gus Wiseman, Aug 30 2018 *)
-
seen = Set([]); other(p) = for (v=1, oo, my (r = min(v,p)/max(v,p)); if (!set search(seen, r), seen = set union(seen, Set([r])); return (v)))
for (n=0, 88, v = if (n==0, 1, other(v)); print1 (v ", ")) \\ Rémy Sigrist, Aug 07 2017
A325868
Number of subsets of {1..n} containing n such that every ordered pair of distinct elements has a different quotient.
Original entry on oeis.org
1, 2, 4, 6, 14, 24, 52, 84, 120, 240, 548, 688, 1784, 2600, 4236, 5796, 16200, 17568, 49968, 55648, 101360, 176792, 433736, 430032, 728784, 1360928, 2304840, 2990856, 8682912, 7877376, 25243200, 27946656, 46758912, 81457248, 121546416, 114388320, 442583952
Offset: 1
The a(1) = 1 through a(5) = 14 subsets:
{1} {2} {3} {4} {5}
{1,2} {1,3} {1,4} {1,5}
{2,3} {2,4} {2,5}
{1,2,3} {3,4} {3,5}
{1,3,4} {4,5}
{2,3,4} {1,2,5}
{1,3,5}
{1,4,5}
{2,3,5}
{2,4,5}
{3,4,5}
{1,2,3,5}
{1,3,4,5}
{2,3,4,5}
-
Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&UnsameQ@@Divide@@@Subsets[#,{2}]&]],{n,10}]
A010672
A B_2 sequence: a(n) = least value such that the sequence increases and pairwise sums of distinct terms are all distinct.
Original entry on oeis.org
0, 1, 2, 4, 7, 12, 20, 29, 38, 52, 73, 94, 127, 151, 181, 211, 257, 315, 373, 412, 475, 530, 545, 607, 716, 797, 861, 964, 1059, 1160, 1306, 1385, 1434, 1555, 1721, 1833, 1933, 2057, 2260, 2496, 2698, 2873, 3060, 3196, 3331, 3628, 3711, 3867, 4139, 4446, 4639
Offset: 0
A025582 is a similar sequence, but there the pairwise sums of (not necessarily distinct) elements are all distinct.
-
N = 3*10^8; % to get all terms < N
Cands = ones(N,1);
Delta = [];
A = [];
n = 1;
while nnz(Cands) > 0
A(n) = find(Cands,1,'first');
Cands(A(n)) = 0;
Rem = Delta(Delta <= N - A(n)) + A(n);
Cands(Rem) = 0;
Delta = union(Delta, -A(1:n-1)+A(n));
if mod(n,10)==0
fprintf('a(%d)=%d\n',n,A(n));
toc;
end
n = n + 1;
end
A - 1 % Robert Israel, May 02 2016
-
N:= 10^6: # to get all terms <= N
A[0]:= 0: Delta:= {}: As:= {A[0]}:
Cands:= {$1..N}:
for n from 1 while Cands <> {} do
A[n]:= min(Cands);
Cands:= Cands minus ({A[n]} union map(`+`,Delta, A[n]));
Delta:= Delta union map(t ->A[n] - t, As);
As:= As union {A[n]};
od:
seq(A[i],i=0..n-1); # Robert Israel, May 02 2016
-
seq = {0};
pairSums = {};
nextTerm = 1;
pairSumsUpdate := Join[pairSums, nextTerm + seq]
hasDuplicates := ! DuplicateFreeQ[pairSumsUpdate]
Do[
While[hasDuplicates, nextTerm++];
pairSums = pairSumsUpdate;
AppendTo[seq, nextTerm];
, 50]
seq (* David Trimas, Dec 28 2024 *)
-
from itertools import count, islice
def A010672_gen(): # generator of terms
aset2, alist = set(), []
for k in count(0):
bset2 = set()
for a in alist:
if (b:=a+k) in aset2:
break
bset2.add(b)
else:
yield k
alist.append(k)
aset2.update(bset2)
A010672_list = list(islice(A010672_gen(),30)) # Chai Wah Wu, Sep 11 2023
A325869
Number of maximal subsets of {1..n} containing n such that every pair of distinct elements has a different quotient.
Original entry on oeis.org
1, 1, 1, 2, 3, 4, 6, 6, 6, 20, 32, 29, 57, 83, 113, 183, 373, 233, 549, 360
Offset: 1
The a(1) = 1 through a(7) = 6 subsets:
{1} {1,2} {1,2,3} {1,3,4} {1,2,3,5} {1,2,5,6} {1,2,3,5,7}
{2,3,4} {1,3,4,5} {2,3,5,6} {1,2,5,6,7}
{2,3,4,5} {2,4,5,6} {2,3,4,5,7}
{1,3,4,5,6} {2,3,5,6,7}
{2,4,5,6,7}
{1,3,4,5,6,7}
-
fasmax[y_]:=Complement[y,Union@@(Most[Subsets[#]]&)/@y];
Table[Length[fasmax[Select[Subsets[Range[n]],MemberQ[#,n]&&UnsameQ@@Divide@@@Subsets[#,{2}]&]]],{n,10}]
A080200
Numbers that do not occur as differences between terms of the Mian-Chowla sequence A005282.
Original entry on oeis.org
33, 88, 98, 99, 105, 106, 112, 126, 130, 132, 134, 150, 152, 154, 156, 162, 163, 165, 170, 176, 184, 188, 198, 205, 214, 215, 217, 220, 222, 228, 234, 235, 240, 246, 252, 255, 263, 266, 267, 268, 274, 276, 279, 281, 287, 290, 291, 294, 297, 302
Offset: 1
Corrected and extended by
T. D. Noe, Mar 29 2007
A365300
a(n) is the smallest nonnegative integer such that the sum of any four ordered terms a(k), k<=n (repetitions allowed), is unique.
Original entry on oeis.org
0, 1, 5, 21, 55, 153, 368, 856, 1424, 2603, 4967, 8194, 13663, 22432, 28169, 47688, 65545, 96615, 146248, 202507, 266267, 364834, 450308, 585328, 773000, 986339, 1162748, 1472659, 1993180, 2275962, 3012656, 3552307, 4590959, 5404183, 6601787, 7893270, 9340877
Offset: 1
a(4) != 12 because 12+1+1+1 = 5+5+5+0.
- Chai Wah Wu, Table of n, a(n) for n = 1..50
- J. Cilleruelo and J Jimenez-Urroz, B_h[g] sequences, Mathematika (47) 2000, pp. 109-115.
- Melvyn B. Nathanson, The third positive element in the greedy B_h-set, arXiv:2310.14426 [math.NT], 2023.
- Melvyn B. Nathanson and Kevin O'Bryant, The fourth positive element in the greedy B_h-set, arXiv:2311.14021 [math.NT], 2023.
- Kevin O'Bryant, A complete annotated bibliography of work related to Sidon sequences, Electron. J. Combin., DS11, Dynamic Surveys (2004), 39 pp.
-
def GreedyBh(h, seed, stopat):
A = [set() for _ in range(h+1)]
A[1] = set(seed) # A[i] will hold the i-fold sumset
for j in range(2,h+1): # {2,...,h}
for x in A[1]:
A[j].update([x+y for y in A[j-1]])
w = max(A[1])+1
while w <= stopat:
wgood = True
for k in range(1,h):
if wgood:
for j in range(k+1,h+1):
if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
wgood = False
if wgood:
A[1].add(w)
for k in range(2,h+1): # update A[k]
for j in range(1,k):
A[k].update([(k-j)*w + x for x in A[j]])
w += 1
return A[1]
GreedyBh(4,[0],10000)
-
from itertools import count, islice, combinations_with_replacement
def A365300_gen(): # generator of terms
aset, alist = set(), []
for k in count(0):
bset = set()
for d in combinations_with_replacement(alist+[k],3):
if (m:=sum(d)+k) in aset:
break
bset.add(m)
else:
yield k
alist.append(k)
aset |= bset
A365300_list = list(islice(A365300_gen(),20)) # Chai Wah Wu, Sep 01 2023
A365301
a(n) is the smallest nonnegative integer such that the sum of any five ordered terms a(k), k<=n (repetitions allowed), is unique.
Original entry on oeis.org
0, 1, 6, 31, 108, 366, 926, 2286, 5733, 12905, 27316, 44676, 94545, 147031, 257637, 435387, 643320, 1107715, 1760092, 2563547, 3744446, 5582657, 8089160, 11373419, 15575157, 21480927, 28569028, 40893371, 53425354, 69774260, 93548428, 119627554
Offset: 1
a(4) != 20 because 20+1+1+1+1 = 6+6+6+6+0.
- J. Cilleruelo and J Jimenez-Urroz, B_h[g] sequences, Mathematika (47) 2000, pp. 109-115.
- Melvyn B. Nathanson, The third positive element in the greedy B_h-set, arXiv:2310.14426 [math.NT], 2023.
- Melvyn B. Nathanson and Kevin O'Bryant, The fourth positive element in the greedy B_h-set, arXiv:2311.14021 [math.NT], 2023.
- Kevin O'Bryant, A complete annotated bibliography of work related to Sidon sequences, Electron. J. Combin., DS11, Dynamic Surveys (2004), 39 pp.
-
def GreedyBh(h, seed, stopat):
A = [set() for _ in range(h+1)]
A[1] = set(seed) # A[i] will hold the i-fold sumset
for j in range(2,h+1): # {2,...,h}
for x in A[1]:
A[j].update([x+y for y in A[j-1]])
w = max(A[1])+1
while w <= stopat:
wgood = True
for k in range(1,h):
if wgood:
for j in range(k+1,h+1):
if wgood and (A[j].intersection([(j-k)*w + x for x in A[k]]) != set()):
wgood = False
if wgood:
A[1].add(w)
for k in range(2,h+1): # update A[k]
for j in range(1,k):
A[k].update([(k-j)*w + x for x in A[j]])
w += 1
return A[1]
GreedyBh(5,[0],10000)
-
from itertools import count, islice, combinations_with_replacement
def A365301_gen(): # generator of terms
aset, alist = set(), []
for k in count(0):
bset = set()
for d in combinations_with_replacement(alist+[k],4):
if (m:=sum(d)+k) in aset:
break
bset.add(m)
else:
yield k
alist.append(k)
aset |= bset
A365301_list = list(islice(A365301_gen(),10)) # Chai Wah Wu, Sep 01 2023
Showing 1-10 of 22 results.
Comments