cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A214939 Number of squarefree words of length n in a 5-ary alphabet.

This page as a plain text file.
%I A214939 #10 May 20 2021 08:38:28
%S A214939 5,20,80,300,1140,4260,15960,59580,222600,830880,3102120,11578800,
%T A214939 43220940,161324400,602159940,2247585300,8389237320,31313155560,
%U A214939 116877700500,436250537520
%N A214939 Number of squarefree words of length n in a 5-ary alphabet.
%C A214939 All terms are multiples of 5 by symmetry. _Michael S. Branicky_, May 20 2021
%e A214939 Some solutions for n = 6:
%e A214939 ..4....2....0....2....3....3....4....4....4....2....0....1....1....0....1....4
%e A214939 ..2....1....4....4....1....2....0....3....0....4....2....0....3....3....0....3
%e A214939 ..4....2....1....2....3....0....1....2....2....2....3....3....1....1....3....4
%e A214939 ..0....4....2....3....4....1....4....1....3....3....0....2....2....2....4....2
%e A214939 ..1....0....4....4....0....2....2....3....4....1....4....1....0....4....0....4
%e A214939 ..0....1....1....2....1....1....0....4....3....3....3....0....3....1....4....1
%o A214939 (Python)
%o A214939 from itertools import product
%o A214939 def a(n):
%o A214939   if n == 1: return 5
%o A214939   squares = ["".join(u) + "".join(u)
%o A214939     for r in range(1, n//2 + 1) for u in product("01234", repeat = r)]
%o A214939   words = ("0"+"".join(w) for w in product("01234", repeat=n-1))
%o A214939   return 5*sum(all(s not in w for s in squares) for w in words)
%o A214939 print([a(n) for n in range(1, 10)]) # _Michael S. Branicky_, May 20 2021
%Y A214939 Column 4 of A214943.
%K A214939 nonn
%O A214939 1,1
%A A214939 _R. H. Hardin_ Jul 30 2012