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.

A366913 a(n) is the least k such that A366912(k) = n.

Original entry on oeis.org

1, 2, 3, 4, 9, 10, 23, 28, 29, 84, 170, 353, 805, 850, 2171, 4860, 11815, 28025, 31539, 131252, 318231, 406904, 1612758, 2461032, 9917597, 11551434, 36824781, 80492173, 206009383, 505512671, 1361256869, 2467754261
Offset: 0

Views

Author

Rémy Sigrist, Oct 27 2023

Keywords

Comments

a(n) corresponds to the index of the first term of A364054 with height n.

Crossrefs

Programs

  • PARI
    See Links section.
    (C++) See Links section.
    
  • Python
    from itertools import count
    from sympy import nextprime
    def A366913(n):
        a, aset, p, c = 1, {0,1}, 2, 0
        for i in count(1):
            if c == n:
                return i
            k, b = divmod(a,p)
            for j in count(-k):
                if b not in aset:
                    aset.add(b)
                    a, p = b, nextprime(p)
                    c += j
                    break
                b += p # Chai Wah Wu, Oct 27 2023

Extensions

a(29) from Chai Wah Wu, Oct 27 2023
a(30)-a(31) from Chai Wah Wu, Oct 28 2023

A366911 a(n) = (A364054(n+1) - A364054(n)) / prime(n) (where prime(n) denotes the n-th prime number).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 27 2023

Keywords

Comments

a(n) is the number of steps of size prime(n) in going from A364054(n) to A364054(n+1).

Examples

			a(7) = (A364054(8) - A364054(7)) / prime(7) = (19 - 2) / 17 = 1.
		

Crossrefs

Cf. A160357, A364054, A366912 (partial sums).

Programs

  • Mathematica
    nn = 2^16; c[] := False; m[] := 0; j = 1; c[0] = c[1] = True;
      Monitor[Do[p = Prime[n - 1]; r = Mod[j, p];
        While[Set[k, p m[p] + r ]; c[k], m[p]++];
        Set[{a[n - 1], c[k], j}, {(k - j)/p, True, k}], {n, 2, nn + 1}], n];
    Array[a, nn] (* Michael De Vlieger, Oct 27 2023 *)
  • PARI
    See Links section.
    
  • Python
    from itertools import count, islice
    from sympy import nextprime
    def A366911_gen(): # generator of terms
        a, aset, p = 1, {0,1}, 2
        while True:
            k, b = divmod(a,p)
            for i in count(-k):
                if b not in aset:
                    aset.add(b)
                    a, p = b, nextprime(p)
                    yield i
                    break
                b += p
    A366911_list = list(islice(A366911_gen(),30)) # Chai Wah Wu, Oct 27 2023
Showing 1-2 of 2 results.