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-2 of 2 results.

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

Original entry on oeis.org

1, 2, 3, 6, 4, 5, 20, 7, 8, 56, 9, 10, 90, 11, 12, 132, 13, 14, 182, 15, 16, 240, 17, 18, 306, 19, 21, 399, 22, 23, 506, 24, 25, 600, 26, 27, 702, 28, 29, 812, 30, 31, 930, 32, 33, 1056, 34, 35, 1190, 36, 37, 1332, 38, 39, 1482, 40, 41, 1640, 42, 43, 1806, 44
Offset: 1

Views

Author

Rémy Sigrist, Feb 13 2023

Keywords

Comments

This sequence is a permutation of the positive integers with inverse A360600:
- we already know that all terms are distinct, so we just have to show that all integers appear,
- by contradiction: let r be the least value missing from this sequence,
- once the values 1..r-1 have appeared in this sequence, the sequence A360598 can only decrease finitely many times,
- the next increase in A360598 will correspond to the ratio r.

Examples

			For n = 15:
    A360598(15) = 11 and A360598(16) = 132,
    so a(15) = 132 / 11 = 12.
For n = 16:
    A360598(16) = 132 and A360598(17) = 1,
    so a(16) = 132 / 1 = 132.
		

Crossrefs

Cf. A360597, A360598, A360600 (inverse).

Programs

  • PARI
    See Links section.
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        an, ratios = 1, set()
        while True:
            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)
            yield q
    print(list(islice(agen(), 66))) # Michael S. Branicky, Feb 13 2023

A371295 Value k at the n-th step of A371282, where multiplied values are positive and subtracted values are negative.

Original entry on oeis.org

2, 3, -1, 4, -17, 5, -11, 6, -16, 7, -49, 9, -54, 8, -62, 10, -89, 12, -120, 13, -143, 14, -168, 15, -194, 18, -271, 19, -305, 20, -341, 21, -378, 22, -440, 23, -483, 24, -527, 25, -599, 26, -649, 27, -701, 28, -755, 29, -811, 30, -869, 31, -929, 32, -991, 33
Offset: 1

Views

Author

Neal Gersh Tolunsky, Mar 17 2024

Keywords

Examples

			At the first step of A371282, to get from A371282(1)=1 to A371282(2)=2, we multiply by 2, so a(1)=2.
At the fifth step of A371282, to get from A371282(5)=20 to A371282(6)=3, we subtract 17, so a(5)=-17.
		

Crossrefs

Cf. A371282, A099004 (steps of add or subtract), A360597 (steps of 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:
            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)
            yield -k if k1 > 0 else k
            aset.add(an)
            kset.add(k)
            while mina in aset: mina += 1
            while mink in kset: mink += 1
    print(list(islice(agen(), 56))) # Michael S. Branicky, Mar 18 2024

Extensions

a(12) and beyond from Michael S. Branicky, Mar 18 2024
Showing 1-2 of 2 results.