This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A329340 #6 Nov 11 2019 15:26:23 %S A329340 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, %T A329340 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, %U A329340 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 %N A329340 Size of the orbit of n under "ghost iterations" A329201 (rule B). %C A329340 Or: Number of iterations of A329201 until a number is seen for the second time in the trajectory of n. %C A329340 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. %C A329340 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. %C A329340 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. %C A329340 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. %F A329340 a(n) = 1 <=> n is a fixed point of A329201 <=> n is a repdigit number (A010785). %F A329340 a(n) = a(n') if 11 <= n, n' <= 99 and n == n' (mod 11). %F A329340 a(n) = # orbit(n) where orbit(n) = { (A329201^k)(n); k >= 0 }. %e A329340 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. %e A329340 For others we have: %e A329340 10 -> 11, so a(10) = #{10, 11} = 2. %e A329340 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! %e A329340 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. %o A329340 (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]) %Y A329340 Cf. A329201, A329197 (analog for A329200), A329342 (list of cycles), A329341 (length of cycles), A329196, A329197 (cycles for A329200). %K A329340 nonn %O A329340 0,11 %A A329340 _M. F. Hasler_, Nov 11 2019