A043290 Maximal run length in base 16 representation of n.
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Crossrefs
Programs
-
Mathematica
A043290[n_]:=Max[Map[Length,Split[IntegerDigits[n,16]]]];Array[A043290,100] (* Paolo Xausa, Sep 27 2023 *)
-
PARI
A043290(n,b=16)={my(m,c=1);while(n>0,n%b==(n\=b)%b && c++ && next;m=max(m,c);c=1);m} \\ Use optional 2nd arg to get sequences A043276 through A043289. - M. F. Hasler, Jul 23 2013
-
Python
from itertools import groupby def A043290(n): return max(len(list(g)) for k, g in groupby(hex(n)[2:])) # Chai Wah Wu, Mar 09 2023
Extensions
More terms from Antti Karttunen, Sep 21 2018