login
Number of squares encountered before zero is reached when iterating A049820 starting from n: a(0) = 0 and for n >= 1, a(n) = A010052(n) + a(A049820(n)).
11

%I #36 Oct 04 2015 02:39:35

%S 0,1,0,1,2,1,0,1,2,1,0,1,0,1,0,1,2,1,0,1,0,1,0,1,2,1,0,1,0,1,0,1,0,1,

%T 0,1,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,1,0,1,

%U 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1

%N Number of squares encountered before zero is reached when iterating A049820 starting from n: a(0) = 0 and for n >= 1, a(n) = A010052(n) + a(A049820(n)).

%C Number of perfect squares (A000290) encountered before zero is reached when starting from k = n and repeatedly applying the map that replaces k by k - d(k), where d(k) is the number of divisors of k (A000005). This count includes n itself if it is a square, but excludes the final zero.

%C Also number of times the parity (of numbers encountered) changes until zero is reached when iterating A049820. This count includes also the last parity change 1 - d(1) -> 0 if coming to zero through 1.

%C There is a lower bound for this sequence that grows without limit if and only if either (1) A259934 is indeed the unique sequence (satisfying its given condition) and it contains an infinite number of squares (see A262514), or (2) more generally, if each one of all (hypothetically multiple) infinite branches of the tree (defined by parent-child relation A049820(child) = parent) contains an infinite number of squares. See also comments in A262509.

%H Antti Karttunen, <a href="/A262680/b262680.txt">Table of n, a(n) for n = 0..10201</a>

%e For n=1, we subtract 1 - A000005(1) = 0, thus we reach zero in one step, and the starting value 1 is a square, thus a(1) = 1. Also, the parity changes once, from odd to even as we go from 1 to 0.

%e For n=24, when we start repeatedly subtracting the number of divisors (A000005), we obtain the following numbers: 24 - A000005(24) = 24 - 8 = 16, 16 - A000005(16) = 16 - 5 = 11, 11 - 2 = 9, 9 - 3 = 6, 6 - 4 = 2, 2 - 2 = 0. Of these numbers, 16 and 9 are squares larger than zero, thus a(24)=2. Also, we see that the parity changes twice: from even to odd at 16 and then back from odd to even at 9.

%o (Scheme, with memoization-macro definec)

%o (definec (A262680 n) (if (zero? n) n (+ (A010052 n) (A262680 (A049820 n)))))

%Y Bisections: A262681, A262682.

%Y Cf. A262687 (positions of records).

%Y Cf. A000005, A000290, A010052, A049820, A155043, A259934, A261088, A262509, A262514, A262676, A262677.

%K nonn

%O 0,5

%A _Antti Karttunen_, Oct 03 2015