A376273 a(n) is the smallest elated number of height n.
1, 10, 13, 51, 67, 97, 668, 77, 746, 92, 717, 5369, 8888999999
Offset: 0
Links
- N. Bradley Fox et al., Elated Numbers, arXiv:2409.09863 [math.NT], 2024.
Crossrefs
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
Comments