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 A384128 #19 Jun 13 2025 21:47:04 %S A384128 0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1, %T A384128 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1, %U A384128 1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,3,2,3,5,6,5,6 %N A384128 Number of iterations for the circular absolute first-difference on decimal digits to reach a repdigit. %C A384128 a(n) = least t >= 0 such that the t-fold iteration of the circular absolute first-difference applied to the decimal digits of n yields a repdigit. The map sends n with decimal digits d_{k-1}...d_0 to the number whose digits are |d_{k-1}-d_{k-2}|, |d_{k-2}-d_{k-3}|, ..., |d_{0}-d_{k-1}|. Let F(n) = Sum_{i=0..k-1} |floor(n/10^i) mod 10 - floor(n/10^{(i+1) mod k}) mod 10|* 10^i. Then a(n) = min {t >= 0 : F^t(n) has all digits equal}. %C A384128 a(n)=0 iff all decimal digits of n are equal. %C A384128 a(n) <= 11 for n < 10000. %e A384128 The first value > 1 is a(100) = 3. %e A384128 a(21) = |2-1| |1-2| = 11 -> repdigit at t = 1, so a(21) = 1. %e A384128 a(109) = 109 -> 198 -> 817 -> 761 -> 156 -> 415 -> 341 -> 132 -> 211 -> 101 -> 110 -> 11 requires 11 steps, so a(109) = 11. %t A384128 SingleRepQ[x_Integer] := SameQ @@ IntegerDigits[x] %t A384128 CAD[x_Integer] := FromDigits@Abs[IntegerDigits[x] - RotateLeft[IntegerDigits[x]]] %t A384128 A384128[n_Integer] := Module[{x = n, cnt = 0}, While[! SingleRepQ[x], x = CAD[x]; cnt++]; cnt] %t A384128 Table[A384128[n], {n, 1, 200}] %Y A384128 Cf. A010785. %K A384128 nonn,base %O A384128 1,100 %A A384128 _Pietro Tiaraju Giavarina dos Santos_, May 20 2025 %E A384128 Data corrected by _Sean A. Irvine_, Jun 13 2025