login
A043281
Maximal run length in base-7 representation of n.
5
1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1
OFFSET
1,8
LINKS
MATHEMATICA
Max[Length/@Split[IntegerDigits[#, 7]]]&/@Range[100] (* Harvey P. Dale, Mar 30 2016 *)
PROG
(PARI) A043281(n, b=7)={my(m, c=1); while(n>0, n%b==(n\=b)%b&&c++&&next; m=max(m, c); c=1); m} \\ M. F. Hasler, Jul 23 2013
(Python)
from itertools import groupby
from sympy.ntheory.factor_ import digits
def A043281(n): return max(len(list(g)) for k, g in groupby(digits(n, 7)[1:])) # Chai Wah Wu, Mar 09 2023
CROSSREFS
Cf. A007093 (base 7).
Cf. A043276-A043290 for base-2 to base-16 analogs.
Sequence in context: A341644 A198293 A368330 * A365634 A320267 A304327
KEYWORD
nonn,base
STATUS
approved