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.

Showing 1-3 of 3 results.

A360597 Ratios of consecutive terms of A084337: a(n) = max(A084337(n), A084337(n+1)) / min(A084337(n), A084337(n+1)).

Original entry on oeis.org

2, 3, 4, 8, 5, 6, 18, 7, 9, 45, 10, 11, 77, 12, 30, 13, 14, 91, 16, 15, 160, 17, 19, 228, 20, 21, 510, 22, 28, 23, 24, 276, 25, 26, 1100, 27, 39, 29, 31, 279, 32, 58, 33, 34, 561, 35, 56, 36, 40, 37, 38, 1332, 41, 42, 1558, 43, 44, 1419, 46, 47, 2632, 48, 49
Offset: 0

Views

Author

Rémy Sigrist, Feb 13 2023

Keywords

Comments

All terms are distinct.

Examples

			For n = 20:
    A084337(20) = 1920 and A084337(21) = 12,
    so a(20) = 1920 / 12 = 160.
For n = 21:
    A084337(21) = 12 and A084337(22) = 204,
    so a(21) = 204 / 12 = 17.
		

Crossrefs

Cf. A084337.

Programs

  • PARI
    See Links section.

A371282 a(1)=1; for n>1, a(n) = a(n-1) * k or a(n-1) - k to give the smallest, distinct positive integer, where each k can be used only once.

Original entry on oeis.org

1, 2, 6, 5, 20, 3, 15, 4, 24, 8, 56, 7, 63, 9, 72, 10, 100, 11, 132, 12, 156, 13, 182, 14, 210, 16, 288, 17, 323, 18, 360, 19, 399, 21, 462, 22, 506, 23, 552, 25, 625, 26, 676, 27, 729, 28, 784, 29, 841, 30, 900, 31, 961, 32, 1024, 33, 1089, 34, 1156, 35, 1225
Offset: 1

Views

Author

Neal Gersh Tolunsky, Mar 17 2024

Keywords

Comments

The sequence is a permutation of the positive integers.

Crossrefs

Cf. A371295 (k values), A081145 (add or subtract), A084337 (multiply or divide).

Programs

  • Python
    from itertools import islice
    def agen(): # generator of terms
        mina, an, aset, mink, kset = 1, 1, {1}, 1, set()
        while True:
            yield an
            k1, ak1, k2 = 0, mina, mink
            if mina < an:
                for ak1 in range(mina, an-mink+1):
                    if ak1 not in aset and an - ak1 not in kset:
                        k1 = an - ak1
                        break
            while k2 in kset or an*k2 in aset:
                k2 += 1
            an, k = (an-k1, k1) if k1 > 0 else (an*k2, k2)
            aset.add(an)
            kset.add(k)
            while mina in aset: mina += 1
            while mink in kset: mink += 1
    print(list(islice(agen(), 61))) # Michael S. Branicky, Mar 18 2024

Extensions

a(13) and beyond from Michael S. Branicky, Mar 18 2024

A360598 Lexicographically earliest sequence of positive integers such that the ratios between successive terms, { max(a(n), a(n+1)) / min(a(n), a(n+1)), n > 0 }, are distinct integers.

Original entry on oeis.org

1, 1, 2, 6, 1, 4, 20, 1, 7, 56, 1, 9, 90, 1, 11, 132, 1, 13, 182, 1, 15, 240, 1, 17, 306, 1, 19, 399, 1, 22, 506, 1, 24, 600, 1, 26, 702, 1, 28, 812, 1, 30, 930, 1, 32, 1056, 1, 34, 1190, 1, 36, 1332, 1, 38, 1482, 1, 40, 1640, 1, 42, 1806, 1, 44, 1980, 1, 46
Offset: 1

Views

Author

Rémy Sigrist, Feb 13 2023

Keywords

Comments

See A360599 for the corresponding ratios.

Examples

			The first terms, alongside the corresponding ratios, are:
  n   a(n)  Ratio between a(n) and a(n+1)
  --  ----  -----------------------------
   1     1       1
   2     1       2
   3     2       3
   4     6       6
   5     1       4
   6     4       5
   7    20      20
   8     1       7
   9     7       8
  10    56      56
  11     1       9
  12     9      10
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        an, ratios = 1, set()
        while True:
            yield an
            k = 1
            q, r = divmod(max(k, an), min(k, an))
            while r != 0 or q in ratios:
                k += 1
                q, r = divmod(max(k, an), min(k, an))
            an = k
            ratios.add(q)
    print(list(islice(agen(), 66))) # Michael S. Branicky, Feb 13 2023
Showing 1-3 of 3 results.