Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

%I #12 Nov 21 2018 00:33:05

%S 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,

%T 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,

%U 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

%N 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).

%C 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.

%H Antti Karttunen, <a href="/A266110/b266110.txt">Table of n, a(n) for n = 0..124340</a>

%e 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.

%o (Scheme, with memoization-macro definec)

%o (definec (A266110 n) (cond ((A082284 n) => (lambda (lad) (if (zero? lad) 0 (+ 1 (A266110 lad)))))))

%Y One less than A266111.

%Y Cf. A000005, A060990, A082284, A266116.

%Y Cf. A045765 (positions of zeros).

%Y Cf. tree A263267 (and its illustration).

%Y Cf. also A264970.

%K nonn

%O 0,1

%A _Antti Karttunen_, Dec 21 2015