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.

A370975 a(n) = (A370952(n+1) - A370952(n)) /(2*n+1).

Original entry on oeis.org

1, 1, -1, 1, 1, 1, -2, 2, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -1, -1, 2, -2, 2, 1, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2
Offset: 1

Views

Author

N. J. A. Sloane, Apr 17 2024

Keywords

Crossrefs

Programs

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

A372052 Where n appears in A370952, or -1 if n never appears there.

Original entry on oeis.org

1, 4, 49, 2, 8, 24, 47, 22, 3, 20, 5, 18, 44, 16, 175, 14, 42, 12, 173, 10, 40, 6, 171, 88, 38, 335, 169, 86, 36, 333, 167, 84, 34, 331, 7, 82, 32, 329, 9, 80, 11, 327, 13, 78, 15, 325, 17, 76, 19, 323, 21, 74, 23, 321, 25, 72, 160, 319, 7468, 70, 158, 317, 25099
Offset: 1

Views

Author

N. J. A. Sloane, Apr 17 2024

Keywords

Crossrefs

Programs

  • Python
    from itertools import count
    def A372052(n):
        a, aset = 1, {0,1}
        for p in count(3,2):
            if a == n:
                return p>>1
            for b in count(a%p,p):
                if b not in aset:
                    aset.add(b)
                    a = b
                    break # Chai Wah Wu, Apr 17 2024
    
  • Python
    # faster for initial segment of sequence
    def A372052_gen(): # uses A370952_gen/imports from Chai Wah Wu in A370952
        adict, n = dict(), 1
        for i, v in enumerate(A370952_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(A372052_gen(), 63))) # Michael S. Branicky, Apr 18 2024

Extensions

More terms from Chai Wah Wu, Apr 17 2024
Showing 1-2 of 2 results.