login
A043562
Number of runs in base-10 representation of n.
12
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2
OFFSET
0,11
COMMENTS
Blecksmith, Filaseta, & Nicol show that lim a(k^n) = infinity whenever k is not a power of 10. More generally, in base b, the limit is infinity exactly when log k/log b is irrational. - Charles R Greathouse IV, Jan 29 2014
Every positive integers occurs infinitely many times. See A297770 for a guide to related sequences. - Clark Kimberling, Feb 04 2018
LINKS
Richard Blecksmith, Michael Filaseta, and Charles Nicol, A result on the digits of a^n, Acta Arithmetica 64 (1993), pp. 331-339.
MATHEMATICA
Table[Length[Split[IntegerDigits[n]]], {n, 0, 90}] (* Harvey P. Dale, Aug 24 2016 *)
PROG
(PARI) a(n)=my(d=digits(n)); #d-sum(i=2, #d, d[i]==d[i-1]) \\ Charles R Greathouse IV, Jan 29 2014
(Python)
def a(n): return len(s:=str(n))-sum(1 for i in range(1, len(s)) if s[i-1] == s[i])
print([a(n) for n in range(90)]) # Michael S. Branicky, Jan 08 2025 after Charles R Greathouse IV
CROSSREFS
Cf. A297778 (number of distinct runs), A297770.
Sequence in context: A043536 A043561 A297778 * A043537 A047726 A297779
KEYWORD
nonn,base,easy
STATUS
approved