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.

Previous Showing 31-40 of 60 results. Next

A347570 Table read by antidiagonals upward: the n-th row gives the lexicographically earliest infinite B_n sequence.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 4, 4, 1, 2, 5, 8, 5, 1, 2, 6, 14, 13, 6, 1, 2, 7, 22, 33, 21, 7, 1, 2, 8, 32, 56, 72, 31, 8, 1, 2, 9, 44, 109, 154, 125, 45, 9, 1, 2, 10, 58, 155, 367, 369, 219, 66, 10, 1, 2, 11, 74, 257, 669, 927, 857, 376, 81, 11
Offset: 1

Views

Author

Peter Kagey, Sep 06 2021

Keywords

Comments

A B_n sequence is a sequence such that all sums a(x_1) + a(x_2) + ... + a(x_n) are distinct for 1 <= x_1 <= x_2 <= ... <= x_n.

Examples

			Table begins:
n\k | 1  2   3   4    5     6     7      8
----+------------------------------------------
  1 | 1, 2,  3,  4,   5,    6,    7,     8, ...
  2 | 1, 2,  4,  8,  13,   21,   31,    45, ...
  3 | 1, 2,  5, 14,  33,   72,  125,   219, ...
  4 | 1, 2,  6, 22,  56,  154,  369,   857, ...
  5 | 1, 2,  7, 32, 109,  367,  927,  2287, ...
  6 | 1, 2,  8, 44, 155,  669, 2215,  6877, ...
  7 | 1, 2,  9, 58, 257, 1154, 4182, 14181, ...
  8 | 1, 2, 10, 74, 334, 1823, 8044, 28297, ...
		

Crossrefs

Cf. A000027 (n=1), A005282 (n=2), A096772 (n=3), A014206 (k=4), A370754 (k=5).

Programs

  • Python
    from itertools import count, islice, combinations_with_replacement
    def A347570_gen(): # generator of terms
        asets, alists, klist = [set()], [[]], [1]
        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(1)
            asets.append(set())
            alists.append([])
    A347570_list = list(islice(A347570_gen(),30)) # Chai Wah Wu, Sep 06 2023

A079848 Smallest primes such that a(j) - a(k) are all different.

Original entry on oeis.org

2, 3, 5, 11, 23, 37, 47, 97, 101, 149, 211, 233, 353, 383, 487, 641, 757, 797, 919, 1097, 1163, 1381, 1409, 1481, 1777, 1997, 2287, 2417, 2969, 3049, 3371, 3529, 3929, 4231, 4759, 5279, 5449, 5717, 5953, 6529, 6983, 7583, 8053, 8819, 9043, 10133, 10799
Offset: 1

Views

Author

Amarnath Murthy, Feb 18 2003

Keywords

Comments

This is the slowest-growing prime B2 sequence. See A005282. - T. D. Noe, Mar 24 2007

Crossrefs

Cf. A079849.

Programs

  • Mathematica
    terms = 100; a = Table[0, {terms}]; s={}; k=0; A079848list = Reap[For[p=2, p < 10^5, p = NextPrime[p], j=1; While[j <= k && FreeQ[s, p-a[[j]]], j++]; If[j>k, For[j=1, j <= k, j++, s = Union[s, {p-a[[j]]}]]; k++; a[[k]] = p; Print[p]; Sow[p]; If[k == terms, Break[]]]]][[2, 1]]; (* Jean-François Alcover, Nov 02 2016, adapted from Max Alekseyev's PARI code *)
  • PARI
    a=vector(100);s=Set();k=0;forprime(p=2,10^5,j=1;while(j<=k&&!setsearch(s,p-a[j]),j++);if(j>k, for(j=1,k,s=setunion(s,[p-a[j]]));k++;a[k]=p;print1(" ",p);if(k==100,break))) \\ Max Alekseyev, Feb 14 2005
    
  • Python
    from itertools import count, islice
    from sympy import nextprime
    def A079848_gen(): # generator of terms
        aset2, alist, k = set(), [], 0
        while (k:=nextprime(k)):
            bset2 = set()
            for a in alist:
                if (b:=k-a) in aset2:
                    break
                bset2.add(b)
            else:
                yield k
                alist.append(k)
                aset2.update(bset2)
    A079848_list = list(islice(A079848_gen(),30)) # Chai Wah Wu, Sep 11 2023

Extensions

More terms from Max Alekseyev, Feb 14 2005

A001856 A self-generating sequence: every positive integer occurs as a(i)-a(j) for a unique pair i,j.

Original entry on oeis.org

1, 2, 4, 8, 16, 21, 42, 51, 102, 112, 224, 235, 470, 486, 972, 990, 1980, 2002, 4004, 4027, 8054, 8078, 16156, 16181, 32362, 32389, 64778, 64806, 129612, 129641, 259282, 259313, 518626, 518658, 1037316, 1037349, 2074698, 2074734, 4149468
Offset: 1

Views

Author

Keywords

Comments

This is a B_2 sequence. More economical recursion: a(1)=1, a(2n)=2a(2n-1), a(2n+1)=a(2n)+r(n), where r(n) is the smallest positive integer not of the form a(j)-a(i) with 1<=iA247556. - Thomas Ordowski, Sep 28 2014

References

  • R. K. Guy, Unsolved Problems in Number Theory, E25.
  • W. Sierpiński, Elementary Theory of Numbers. Państ. Wydaw. Nauk., Warsaw, 1964, p. 444.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[2] = 2; a[n_?OddQ] := a[n] = 2*a[n-1]; a[n_?EvenQ] := a[n] = a[n-1] + r[(n-2)/2]; r[n_] := ( diff = Table[a[j] - a[i], {i, 1, 2*n+1}, {j, i+1, 2*n+1}] // Flatten // Union; max = diff // Last; notDiff = Complement[Range[max], diff]; If[notDiff == {}, max+1, notDiff // First]); Table[a[n], {n, 1, 39}] (* Jean-François Alcover, Dec 31 2012 *)

Formula

a(1)=1, a(2)=2, a(2n+1) = 2a(2n), a(2n+2) = a(2n+1) + r(n), where r(n) = smallest positive number not of form a(j) - a(i) with 1 <= i < j <= 2n+1.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 14 2000

A062295 A B_2 sequence: a(n) is the smallest square such that pairwise sums of not necessarily distinct elements are all distinct.

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 64, 81, 100, 169, 256, 289, 441, 484, 576, 625, 841, 1089, 1296, 1444, 1936, 2025, 2401, 2601, 3136, 4225, 4356, 4624, 5329, 5476, 5776, 6084, 7569, 9025, 10201, 11449, 11664, 12321, 12996, 13456, 14400, 16129, 17956, 20164, 22201
Offset: 1

Views

Author

Labos Elemer, Jul 02 2001

Keywords

Examples

			36 is in the sequence since the pairwise sums of {1, 4, 9, 16, 25, 36} are all distinct: 2, 5, 8, 10, 13, 17, 18, 20, 25, 26, 29, 32, 34, 37, 40, 41, 45, 50, 52, 61, 72.
49 is not in the sequence since 1 + 49 = 25 + 25.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A062295_gen(): # generator of terms
        aset1, aset2, alist = set(), set(), []
        for k in (n**2 for n 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
    A062295_list = list(islice(A062295_gen(),30)) # Chai Wah Wu, Sep 05 2023

Extensions

Edited, corrected and extended by Klaus Brockhaus, Sep 24 2007

A080201 Numbers that do not occur as differences between terms of the Mian-Chowla variant A051788.

Original entry on oeis.org

49, 50, 71, 72, 76, 82, 90, 93, 95, 96, 119, 128, 139, 143, 152, 162, 172, 173, 180, 182, 185, 188
Offset: 1

Views

Author

Hugo Pfoertner, Feb 05 2003

Keywords

Comments

Terms are only conjectures. Elements might be eliminated by higher terms of A051788, which was checked up to 4*10^6.

References

Crossrefs

A327762 a(n) = smallest positive number not already in the sequence such that all n(n+1)/2 numbers in the triangle of differences of the first n terms are distinct.

Original entry on oeis.org

1, 3, 9, 5, 12, 10, 23, 8, 22, 17, 42, 16, 43, 20, 38, 26, 45, 32, 65, 28, 64, 39, 76, 34, 81, 48, 98, 40, 92, 54, 109, 60, 116, 51, 114, 58, 117, 70, 136, 67, 135, 71, 145, 72, 147, 69, 146, 80, 164, 87, 166, 82, 170, 108, 198, 99
Offset: 1

Views

Author

N. J. A. Sloane, Sep 24 2019, revised Sep 25 2019

Keywords

Comments

Inspired by A327743.
From Rémy Sigrist, Sep 25 2019: (Start)
The sequence is finite, with 56 terms.
Let b and c be the first and second differences of a, respectively, hence:
- b(55) = a(56) - a(55) = 99 - 198 = -99,
- b(56) = a(57) - a(56) = a(57) - 99,
- c(55) = b(56) - b(55) = a(57), a contradiction.
(End)
Since this definition leads to a finite sequence, it is natural to ask instead for the "Lexicographically earliest infinite sequence of distinct positive integers such that for every k >= 1, all the k(k+1)/2 numbers in the triangle of differences of the first k terms are distinct." This is A327460.
If only first differences are considered, one gets the classical Mian-Chowla sequence A005282. - M. F. Hasler, Oct 09 2019

Examples

			Difference triangle of the first k=8 terms of the sequence:
  1, 3, 9, 5, 12, 10, 23, 8, ...
  2, 6, -4, 7, -2, 13, -15, ...
  4, -10, 11, -9, 15, -28, ...
  -14, 21, -20, 24, -43, ...
  35, -41, 44, -67, ...
  -76, 85, -111, ...
  161, -196, ...
  -357, ...
All 8*9/2 = 36 numbers are distinct.
		

Crossrefs

For first differences see A327458; for the leading column of the difference triangle see A327459.
Cf. A005282.

A034757 a(1)=1, a(n) = smallest odd number such that all sums of pairs of (not necessarily distinct) terms in the sequence are distinct.

Original entry on oeis.org

1, 3, 7, 15, 25, 41, 61, 89, 131, 161, 193, 245, 295, 363, 407, 503, 579, 721, 801, 949, 1129, 1185, 1323, 1549, 1643, 1831, 1939, 2031, 2317, 2623, 2789, 3045, 3143, 3641, 3791, 4057, 4507, 4757, 5019, 5559, 5849, 6309, 6707, 7181, 7593
Offset: 1

Views

Author

Wouter Meeussen, Jun 01 2000

Keywords

Comments

a(1) = 1, a(n) = least number such that every difference a(i)-a(j) is a distinct even number. - Amarnath Murthy, Apr 07 2004

Examples

			5 is not in the sequence since 5+1 is already obtainable from 3+3, 9 is excluded since 1, 3 and 7 are in the sequence and would collide with 1+9
		

Crossrefs

Partial sums of A287178.

Programs

  • Haskell
    a034757 = (subtract 1) . (* 2) . a005282  -- Reinhard Zumkeller, Dec 18 2012
    
  • Mathematica
    seq2={1, 3}; Do[le=Length[seq2]; t=Last[seq2]+2; While[Length[Expand[(Plus @@ (x^seq2) + x^t)^2]] < Pochhammer[3, le]/le!, t=t+2]; AppendTo[seq2, t], {20}]; Print@seq2
  • Python
    from itertools import count, islice
    def A034757_gen(): # generator of terms
        aset1, aset2, alist = set(), set(), []
        for k in count(1,2):
            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.update(bset2)
    A034757_list = list(islice(A034757_gen(),30)) # Chai Wah Wu, Sep 05 2023

Formula

a(n) = 2*A005282(n)-1. (David Wasserman)

Extensions

An incorrect comment from Amarnath Murthy, also dated Apr 07 2004, has been deleted.
Offset fixed by Reinhard Zumkeller, Dec 18 2012

A046185 A B2-sequence due to Rachel Lewis.

Original entry on oeis.org

1, 2, 4, 8, 13, 21, 31, 45, 66, 81, 97, 123, 148, 182, 204, 252, 291, 324, 352, 415, 486, 540, 651, 706, 781, 864, 963, 1003, 1148, 1217, 1371, 1409, 1523, 1673, 1974, 2105, 2191, 2317, 2496, 2652, 2726, 2858, 3219, 3268, 3500, 3605, 3864, 3962, 4237
Offset: 0

Views

Author

Keywords

Comments

"The first 68 elements of the sequence are [given], then the greedy algorithm is used." For this B2-sequence: "The reciprocal sum is at least 2.16086," greater than that of the Mian-Chowla sequence (A005282), which is at most 2.158533. - Danny Rorabaugh (with quotes by Rachel Lewis), Sep 29 2015

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 163-166, with section 2.20.2, Mian-Chowla and B2-Sequences

Crossrefs

Cf. A005282.

Formula

For n>67, a(n) is the least number such that all pairwise differences of distinct elements of {a(0), ..., a(n)} are distinct. - Danny Rorabaugh, Sep 29 2015

Extensions

a(34) corrected by Steven Finch in email with Danny Rorabaugh, Sep 29 2015

A058335 a(n) = least value such that sequence increases and pairwise differences are unique.

Original entry on oeis.org

1, 4, 5, 10, 12, 22, 35, 49, 64, 84, 100, 122, 141, 169, 225, 271, 295, 338, 399, 465, 547, 579, 670, 745, 816, 917, 993, 1033, 1172, 1258, 1401, 1533, 1644, 1789, 1878, 2106, 2257, 2419, 2571, 2724, 2942, 3006, 3148, 3308, 3475, 3719, 3991, 4272, 4428
Offset: 1

Views

Author

Gerald A. Mischke (Gerald.Mischke(AT)mutualofomaha.com), Dec 13 2000

Keywords

Comments

A variation on A005282 (Mian-Chowla, where positive differences of pairs of elements are unique) by starting with a(1) =1, a(2) = 4.

Crossrefs

A062294 A B_2 sequence: a(n) is the smallest prime such that the pairwise sums of distinct elements are all distinct.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 29, 47, 67, 83, 131, 163, 233, 307, 397, 443, 617, 727, 809, 941, 1063, 1217, 1399, 1487, 1579, 1931, 2029, 2137, 2237, 2659, 2777, 3187, 3659, 3917, 4549, 4877, 5197, 5471, 5981, 6733, 7207, 7349, 8039, 8291, 8543, 9283, 9689, 10037
Offset: 1

Views

Author

Labos Elemer, Jul 02 2001

Keywords

Crossrefs

Programs

  • Python
    from itertools import islice
    from sympy import nextprime
    def A062294_gen(): # generator of terms
        aset2, alist, k = set(), [], 0
        while (k:=nextprime(k)):
            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)
    A062294_list = list(islice(A062294_gen(),30)) # Chai Wah Wu, Sep 11 2023

Extensions

Edited, corrected and extended by Klaus Brockhaus, Sep 17 2007
Previous Showing 31-40 of 60 results. Next