cp's OEIS Frontend

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.

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

This page as a plain text file.
%I A043562 #17 Jan 08 2025 16:19:59
%S A043562 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 A043562 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 A043562 2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,1,2
%N A043562 Number of runs in base-10 representation of n.
%C A043562 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 A043562 Every positive integers occurs infinitely many times.  See A297770 for a guide to related sequences. - _Clark Kimberling_, Feb 04 2018
%H A043562 Clark Kimberling, <a href="/A043562/b043562.txt">Table of n, a(n) for n = 0..10000</a>
%H A043562 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 A043562 Table[Length[Split[IntegerDigits[n]]],{n,0,90}] (* _Harvey P. Dale_, Aug 24 2016 *)
%o A043562 (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 A043562 (Python)
%o A043562 def a(n): return len(s:=str(n))-sum(1 for i in range(1, len(s)) if s[i-1] == s[i])
%o A043562 print([a(n) for n in range(90)]) # _Michael S. Branicky_, Jan 08 2025 after _Charles R Greathouse IV_
%Y A043562 Cf. A297778 (number of distinct runs), A297770.
%K A043562 nonn,base,easy
%O A043562 0,11
%A A043562 _Clark Kimberling_