login
A266110
If A082284(n) = 0, a(n) = 0, otherwise a(n) = 1 + a(A082284(n)), where A082284(n) = smallest number k such that k - d(k) = n, or 0 if no such number exists, and d(n) = the number of divisors of n (A000005).
4
4, 3, 4, 2, 1, 1, 3, 0, 0, 2, 2, 1, 3, 0, 1, 2, 1, 1, 2, 0, 0, 6, 1, 5, 0, 0, 2, 4, 0, 3, 4, 2, 1, 0, 3, 1, 0, 0, 2, 2, 0, 1, 2, 0, 1, 8, 1, 7, 1, 0, 0, 6, 0, 5, 3, 0, 0, 4, 2, 3, 7, 2, 1, 0, 0, 1, 0, 0, 0, 4, 1, 3, 6, 2, 0, 0, 8, 1, 4, 0, 1, 7, 3, 6, 5, 0, 2, 5, 0, 4, 12, 5, 1, 3, 11, 4, 4, 3, 0, 2, 0, 1, 10, 0, 3, 2, 9, 1, 0, 0, 1, 1, 0, 0, 8, 2, 0, 0, 7, 1, 2, 6
OFFSET
0,1
COMMENTS
Starting from n, search for a smallest number k such that k - d(k) = n, and if found such a number, replace n with k and repeat the procedure. When eventually such k is no longer found, then (new) n must be one of the terms of A045765. The number of times the procedure can be repeated before that happens is the value of a(n). Sequence A266116 gives the stopping value of n.
LINKS
EXAMPLE
Starting from n = 21, we get the following chain: 21 -> 23 -> 27 -> 29 -> 31 -> 35 -> 37, with A082284 iterated 6 times before the final term 37 (for which A060990(37) = A082284(37) = 0) is encountered. Thus a(21) = 6.
PROG
(Scheme, with memoization-macro definec)
(definec (A266110 n) (cond ((A082284 n) => (lambda (lad) (if (zero? lad) 0 (+ 1 (A266110 lad)))))))
CROSSREFS
One less than A266111.
Cf. A045765 (positions of zeros).
Cf. tree A263267 (and its illustration).
Cf. also A264970.
Sequence in context: A239735 A196826 A215597 * A204819 A161882 A276789
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 21 2015
STATUS
approved