A354254 a(n) is the least m >= 0 such that n = f^k(m) for some k >= 0 (where f^k denotes the k-th iterate of A092391).
0, 1, 1, 1, 4, 1, 6, 1, 6, 6, 1, 6, 1, 13, 1, 15, 13, 1, 18, 1, 18, 21, 1, 23, 21, 1, 21, 23, 1, 21, 30, 1, 32, 21, 30, 21, 1, 37, 1, 39, 37, 1, 37, 39, 1, 37, 46, 1, 48, 37, 46, 51, 1, 46, 54, 1, 56, 46, 54, 56, 1, 46, 54, 63, 1, 1, 46, 1, 46, 63, 1, 71, 63
Offset: 0
Examples
The first terms, alongside f(n), are: n a(n) f(n) -- ---- ---- 0 0 0 1 1 2 2 1 3 3 1 5 4 4 5 5 1 7 6 6 8 7 1 10 8 6 9 9 6 11 10 1 12 11 6 14 12 1 14 13 13 16 14 1 17
Programs
-
PARI
a = vector(73, n, n-1); for (n=0, #a-1, m=n+hammingweight(n); if (m<#a, a[1+m]=min(a[1+n],a[1+m]))); print (a)