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