A262680 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)).
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, 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, 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
Offset: 0
Keywords
Examples
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. 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.
Links
- Antti Karttunen, Table of n, a(n) for n = 0..10201
Comments