The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A178905 Numbers without 3 consecutive equal digits in any base b >= 2. 2

%I #15 Mar 28 2022 01:31:52

%S 0,1,2,3,4,5,6,9,10,11,12,18,19,20,22,25,36,37,38,44,45,50,51,52,74,

%T 75,76,77,89,90,100,101,102,105,109,147,150,153,154,165,166,173,178,

%U 179,180,181,204,205,210,212,214,217,293,294,299,300,301,306,308,309,329

%N Numbers without 3 consecutive equal digits in any base b >= 2.

%H Michael S. Branicky, <a href="/A178905/b178905.txt">Table of n, a(n) for n = 1..10000</a>

%t Prepend[Cases[Range[329], n_ /; NoneTrue[Range[2, (Sqrt[4 n - 3] - 1)/2], MatchQ[IntegerDigits[n, #], {___, d_, d_, d_, ___}] &]], 0] (* _Vladimir Reshetnikov_, Mar 20 2022 *)

%o (Python)

%o from sympy.ntheory.digits import digits

%o def three_in_a_row(s):

%o return any(s[i] == s[i+1] == s[i+2] for i in range(len(s) - 2))

%o def ok(n):

%o if n < 7: return True

%o b = 2

%o d = digits(n, b)[1:]

%o while len(d) >= 3:

%o if three_in_a_row(d): return False

%o b += 1

%o d = digits(n, b)[1:]

%o return True

%o print([k for k in range(331) if ok(k)]) # _Michael S. Branicky_, Mar 27 2022

%Y Cf. A063037.

%K base,nonn

%O 1,3

%A _Joonas Pohjonen_, Jun 22 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 13 09:49 EDT 2024. Contains 372504 sequences. (Running on oeis4.)