login
A329340
Size of the orbit of n under "ghost iterations" A329201 (rule B).
2
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2, 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2, 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2, 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2, 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2, 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2, 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2, 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2, 1, 3, 4, 3, 6, 3, 5, 3, 5, 3, 5, 2, 1, 3, 2, 3, 2, 5, 2, 9, 2, 4
OFFSET
0,11
COMMENTS
Or: Number of iterations of A329201 until a number is seen for the second time in the trajectory of n.
A329201 consists of subtracting from or adding to n, depending on whether it is even or odd, the number A040115(n) whose digits are the differences of adjacent digits of n.
The trajectory of all numbers < 8000 ends in a repdigit (A010785), which are fixed points of this map. Some larger numbers enter nontrivial cycles, cf. A329342. In both cases, some number(s) will appear infinitely often in the trajectory. This sequence gives the number of iterations until a value is repeated for the first time in the trajectory of n. This is also the size of n's orbit, i.e. the total number of distinct values that will occur.
If n is part of a cycle (n in A329342), a(n) gives the length of the cycle; in particular a(n) = 1 for fixed points.
For 11 <= n <= 99 the pattern ( 1, 3, 2, 3, 2, 3, 2, 4, 2, 5, 2) of length 11 repeats. But the trajectory of those n with same a(n) does not always end in the corresponding repdigit.
FORMULA
a(n) = 1 <=> n is a fixed point of A329201 <=> n is a repdigit number (A010785).
a(n) = a(n') if 11 <= n, n' <= 99 and n == n' (mod 11).
a(n) = # orbit(n) where orbit(n) = { (A329201^k)(n); k >= 0 }.
EXAMPLE
For repdigits A010785 and in particular single-digit numbers, {0, 1, ..., 9, 11, 22, ...}, A329201(n) = n, so O(n) = {n} and a(n) = 1.
For others we have:
10 -> 11, so a(10) = #{10, 11} = 2.
12 -> 13 -> 11, so a(10) = #{12, 13, 11} = 2. Also 23 -> 24 -> 22, so a(23) = 3, and similarly for 34, 45, 56, 67 and 78. But 89 -> 90 -> 99, the next *larger* repdigit!
20 -> 18 -> 25 -> 28 -> 22, whence a(20) = 5. Similarly, 31 -> 29 -> 36 -> 39 -> 33, a(31) = 5, too. But 42 -> 40 -> 36 -> 39 -> 33 goes to the next *lower* repdigit, yet still has a(42) = 5.
PROG
(PARI) apply( A329340(n, M=oo, U=[n])={for(k=1, M, setsearch(U, n=A329201(n))&&return(k); U=setunion(U, [n]))}, [0..122])
CROSSREFS
Cf. A329201, A329197 (analog for A329200), A329342 (list of cycles), A329341 (length of cycles), A329196, A329197 (cycles for A329200).
Sequence in context: A270755 A305030 A110917 * A070956 A237127 A262746
KEYWORD
nonn
AUTHOR
M. F. Hasler, Nov 11 2019
STATUS
approved