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.

This page as a plain text file.
%I A376273 #21 Sep 21 2024 11:10:57
%S A376273 1,10,13,51,67,97,668,77,746,92,717,5369,8888999999
%N A376273 a(n) is the smallest elated number of height n.
%C A376273 a(13) = 8158 * 10^13888887 - 1, per Fox et al., which is too large to include. - _Michael S. Branicky_, Sep 18 2024
%H A376273 N. Bradley Fox et al., <a href="https://arxiv.org/abs/2409.09863">Elated Numbers</a>, arXiv:2409.09863 [math.NT], 2024.
%o A376273 (PARI) f(n) = if (n, my(d=digits(n)); d[1]*norml2(d), 0); \\ A376270
%o A376273 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;
%o A376273 a(n) = if (n==0, 1, my(k=2); while(g(k) != n, k++); k);
%o A376273 (Python)
%o A376273 from itertools import count, islice, combinations_with_replacement as mc
%o A376273 def f(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d)
%o A376273 def iters(n):
%o A376273     if n == 1: return 0
%o A376273     traj, c = {n}, 0
%o A376273     while (n:=f(n)) not in traj: traj.add(n); c += 1
%o A376273     return c if 1 in traj else float('inf')
%o A376273 def bgen():
%o A376273     yield from (int(f+"".join(m)) for d in count(1) for f in "123456789" for m in mc("0123456789", d-1))
%o A376273 def agen(): # generator of terms
%o A376273     adict, n = dict(), 0
%o A376273     for k in bgen():
%o A376273         v = iters(k)
%o A376273         if v not in adict:
%o A376273             adict[v] = k
%o A376273             while n in adict: yield adict[v]; n += 1
%o A376273 print(list(islice(agen(), 13))) # _Michael S. Branicky_, Sep 18 2024
%Y A376273 Cf. A376270 (map), A376272 (elated numbers).
%Y A376273 A007013 is the analog for base 2 (with shifted offset).
%K A376273 nonn,base
%O A376273 0,2
%A A376273 _Michel Marcus_, Sep 18 2024