login
Number of iterations required for elated number A376272(n) to converge to 1.
1

%I #10 Oct 16 2024 20:53:43

%S 0,1,2,2,2,3,4,7,4,9,5,1,2,4,3,2,3,4,4,2,2,5,4,3,5,3,4,5,4,3,3,3,3,5,

%T 2,2,4,4,3,3,3,3,3,3,7,9,7,4,5,9,5,6,4,6,9,4,7,10,5,5,8,10,8,6,8,8,7,

%U 10,6,4,5,6,7,6,2,5,7,2,7,4,7,9,5,9,5,5

%N Number of iterations required for elated number A376272(n) to converge to 1.

%H Nathan Fox, <a href="/A377083/b377083.txt">Table of n, a(n) for n = 1..7832</a>

%H N. Bradley Fox et al., <a href="https://arxiv.org/abs/2409.09863">Elated Numbers</a>, arXiv:2409.09863 [math.NT], 2024.

%e 21 is the 4th elated number and iterating the map A376270 yields 10 then 1, so a(4)=2.

%o (Python)

%o from itertools import count, islice

%o def f(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d)

%o def ok_count(n):

%o if n == 1: return True, 0

%o traj, c = {n}, 0

%o while (n:=f(n)) not in traj: traj.add(n); c += 1

%o return 1 in traj, c

%o def agen(): # generator of terms

%o for n in count(1):

%o elated, iterations = ok_count(n)

%o if elated: yield iterations

%o print(list(islice(agen(), 90))) # _Michael S. Branicky_, Oct 16 2024

%Y Cf. A376270, A376272.

%Y A090425 is the analog for happy numbers, with a different convention used.

%K nonn,base

%O 1,3

%A N. Bradley Fox, _Nathan Fox_, Helen Grundman, Rachel Lynn, Changningphaabi Namoijam, Mary Vanderschoot, Oct 15 2024