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.

A376273 a(n) is the smallest elated number of height n.

Original entry on oeis.org

1, 10, 13, 51, 67, 97, 668, 77, 746, 92, 717, 5369, 8888999999
Offset: 0

Views

Author

Michel Marcus, Sep 18 2024

Keywords

Comments

a(13) = 8158 * 10^13888887 - 1, per Fox et al., which is too large to include. - Michael S. Branicky, Sep 18 2024

Crossrefs

Cf. A376270 (map), A376272 (elated numbers).
A007013 is the analog for base 2 (with shifted offset).

Programs

  • PARI
    f(n) = if (n, my(d=digits(n)); d[1]*norml2(d), 0); \\ A376270
    g(n) = my(list=List()); listput(list, n); while(1, my(m=f(n)); if (m==1, return(#list)); if (#select(x->(x==m), Vec(list)), return(0)); listput(list, m); n=m); -1;
    a(n) = if (n==0, 1, my(k=2); while(g(k) != n, k++); k);
    
  • Python
    from itertools import count, islice, combinations_with_replacement as mc
    def f(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d)
    def iters(n):
        if n == 1: return 0
        traj, c = {n}, 0
        while (n:=f(n)) not in traj: traj.add(n); c += 1
        return c if 1 in traj else float('inf')
    def bgen():
        yield from (int(f+"".join(m)) for d in count(1) for f in "123456789" for m in mc("0123456789", d-1))
    def agen(): # generator of terms
        adict, n = dict(), 0
        for k in bgen():
            v = iters(k)
            if v not in adict:
                adict[v] = k
                while n in adict: yield adict[v]; n += 1
    print(list(islice(agen(), 13))) # Michael S. Branicky, Sep 18 2024