login
A384128
Number of iterations for the circular absolute first-difference on decimal digits to reach a repdigit.
1
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, 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, 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
OFFSET
1,100
COMMENTS
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}.
a(n)=0 iff all decimal digits of n are equal.
a(n) <= 11 for n < 10000.
EXAMPLE
The first value > 1 is a(100) = 3.
a(21) = |2-1| |1-2| = 11 -> repdigit at t = 1, so a(21) = 1.
a(109) = 109 -> 198 -> 817 -> 761 -> 156 -> 415 -> 341 -> 132 -> 211 -> 101 -> 110 -> 11 requires 11 steps, so a(109) = 11.
MATHEMATICA
SingleRepQ[x_Integer] := SameQ @@ IntegerDigits[x]
CAD[x_Integer] := FromDigits@Abs[IntegerDigits[x] - RotateLeft[IntegerDigits[x]]]
A384128[n_Integer] := Module[{x = n, cnt = 0}, While[! SingleRepQ[x], x = CAD[x]; cnt++]; cnt]
Table[A384128[n], {n, 1, 200}]
CROSSREFS
Cf. A010785.
Sequence in context: A223542 A182003 A347266 * A050060 A247829 A351705
KEYWORD
nonn,base
EXTENSIONS
Data corrected by Sean A. Irvine, Jun 13 2025
STATUS
approved