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.

A368383 a(n) = index of n in A368382, or -1 if n is missing from that sequence.

Original entry on oeis.org

1, 7, 2, 5, 13, 3, 67, 35, 11, 33, 4, 31, 6, 29, 8, 27, 63, 25, 327, 23, 61, 21, 325, 19, 59, 17, 323, 15, 57, 9, 321, 175, 55, 173, 15490, 171, 53, 169, 317, 167, 51, 165, 1167, 163, 49, 161, 10, 159, 47, 157, 12, 155, 45, 153, 14, 151, 16, 149, 18, 147, 20, 145, 22, 143, 24, 141, 26, 139, 28, 137, 30, 135, 32, 133, 34
Offset: 1

Views

Author

N. J. A. Sloane, Mar 03 2024

Keywords

Programs

  • Python
    from itertools import count
    def A368383(n):
        a, aset, p = 1, {0,1}, 2
        for c in count(1):
            if a==n: return c
            for b in count(a%p,p):
                if b not in aset:
                    aset.add(b)
                    a, p = b, 3 if p == 2 else p+2
                    break # Chai Wah Wu, Mar 05 2024
    
  • Python
    # faster for initial segment of sequence
    def A368383_gen(): # uses A368382_gen/imports from Chai Wah Wu in A368382
        adict, n = dict(), 1
        for i, v in enumerate(A368382_gen(), 1):
            if v >= n and v not in adict:
                adict[v] = i
                while n in adict:
                    yield adict[n]; del adict[n]; n += 1
    print(list(islice(A368383_gen(), 63))) # Michael S. Branicky, Apr 18 2024

A370952 a(1) = 1; for n > 1, a(n) is the least positive integer not already in the sequence such that a(n) == a(n-1) (mod 2*n-1).

Original entry on oeis.org

1, 4, 9, 2, 11, 22, 35, 5, 39, 20, 41, 18, 43, 16, 45, 14, 47, 12, 49, 10, 51, 8, 53, 6, 55, 106, 159, 104, 161, 102, 163, 37, 167, 33, 171, 29, 175, 25, 179, 21, 183, 17, 187, 13, 191, 100, 7, 197, 3, 201, 302, 96, 306, 92, 310, 88, 314, 84, 318, 80, 322, 76, 326, 72, 330, 68, 334, 64, 338, 60, 342, 56, 346, 52, 350
Offset: 1

Views

Author

N. J. A. Sloane, Mar 07 2024

Keywords

Comments

Very similar to A368382, except that there the differences are controlled by the sequence {2,3,5,7,9,11,13,15,...} (A004280), whereas here they are controlled by {3,5,7,9,11,13,15,...}.

Crossrefs

Cf. A004280, A368382, A370975, A372052 (where n appears).

Programs

  • Python
    from itertools import count, islice
    def A370952_gen(): # generator of terms
        a, aset = 1, {0,1}
        for p in count(3,2):
            yield a
            for b in count(a%p,p):
                if b not in aset:
                    aset.add(b)
                    a = b
                    break
    A370952_list = list(islice(A370952_gen(),20)) # Chai Wah Wu, Apr 17 2024
Showing 1-2 of 2 results.