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!)
A349955 Numbers whose representation in any base b >= 2 is a cubefree word. 1

%I #19 Mar 28 2022 07:43:43

%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,214,217,293,294,300,301,306,308,309,329,330

%N Numbers whose representation in any base b >= 2 is a cubefree word.

%C A subsequence of A178905. A subsequence of A286262.

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

%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CubefreeWord.html">Cubefree Word</a>.

%t Prepend[Cases[Range[330], n_ /; NoneTrue[Range[2, (Sqrt[4 n - 3] - 1)/2], MatchQ[IntegerDigits[n, #], {___, d__, d__, d__, ___}] &]], 0]

%o (Python)

%o from sympy.ntheory.digits import digits

%o def hascube(s):

%o for l in range(1, len(s)//3 + 1):

%o for i in range(len(s) - 3*l + 1):

%o if s[i:i+l] == s[i+l:i+2*l] == s[i+2*l:i+3*l]: return True

%o return False

%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 hascube(d):

%o 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. A178905, A286262.

%K nonn,base

%O 1,3

%A _Vladimir Reshetnikov_, Mar 20 2022

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 9 23:14 EDT 2024. Contains 372354 sequences. (Running on oeis4.)