A043562 Number of runs in base-10 representation of n.
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
Links
- Clark Kimberling, Table of n, a(n) for n = 0..10000
- Richard Blecksmith, Michael Filaseta, and Charles Nicol, A result on the digits of a^n, Acta Arithmetica 64 (1993), pp. 331-339.
Programs
-
Mathematica
Table[Length[Split[IntegerDigits[n]]],{n,0,90}] (* Harvey P. Dale, Aug 24 2016 *)
-
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
Comments