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!)
A068539 Number of quinternary cubefree words of length n. 0

%I #12 Apr 18 2021 05:44:13

%S 1,5,25,120,580,2800,13500,65100,313940,1513820,7299760,35200020,

%T 169736780,818482260,3946776920,19031623000

%N Number of quinternary cubefree words of length n.

%o (Python)

%o from itertools import product

%o def cf(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]*2 == s[i+l:i+3*l]: return False

%o return True

%o def a(n):

%o if n == 0: return 1

%o return 5*sum(cf("0"+"".join(w)) for w in product("01234", repeat=n-1))

%o print([a(n) for n in range(0, 10)]) # _Michael S. Branicky_, Apr 16 2021

%Y Cf. A028445, A051042, A051043.

%K more,nonn

%O 0,2

%A _Sascha Kurz_, Mar 22 2002

%E a(0) prepended and a(14)-a(15) by _Michael S. Branicky_, Apr 16 2021

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 April 24 17:10 EDT 2024. Contains 371962 sequences. (Running on oeis4.)