login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of runs in base-10 representation of n.
11

%I #17 Jan 08 2025 16:19:59

%S 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,

%T 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,

%U 2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,1,2

%N Number of runs in base-10 representation of n.

%C 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

%C Every positive integers occurs infinitely many times. See A297770 for a guide to related sequences. - _Clark Kimberling_, Feb 04 2018

%H Clark Kimberling, <a href="/A043562/b043562.txt">Table of n, a(n) for n = 0..10000</a>

%H Richard Blecksmith, Michael Filaseta, and Charles Nicol, <a href="http://www.math.sc.edu/~filaseta/papers/blockpaper.pdf">A result on the digits of a^n</a>, Acta Arithmetica 64 (1993), pp. 331-339.

%t Table[Length[Split[IntegerDigits[n]]],{n,0,90}] (* _Harvey P. Dale_, Aug 24 2016 *)

%o (PARI) a(n)=my(d=digits(n)); #d-sum(i=2,#d,d[i]==d[i-1]) \\ _Charles R Greathouse IV_, Jan 29 2014

%o (Python)

%o def a(n): return len(s:=str(n))-sum(1 for i in range(1, len(s)) if s[i-1] == s[i])

%o print([a(n) for n in range(90)]) # _Michael S. Branicky_, Jan 08 2025 after _Charles R Greathouse IV_

%Y Cf. A297778 (number of distinct runs), A297770.

%K nonn,base,easy

%O 0,11

%A _Clark Kimberling_