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.

A214940 Number of squarefree words of length n in a 6-ary alphabet.

This page as a plain text file.
%I A214940 #10 Jul 22 2025 23:20:35
%S A214940 6,30,150,720,3480,16680,80040,383520,1838160,8807400,42202560,
%T A214940 202209720,968880960,4642304520,22243228680,106576361760,510651000360
%N A214940 Number of squarefree words of length n in a 6-ary alphabet.
%C A214940 Column 5 of A214943
%e A214940 Some solutions for n=6
%e A214940 ..4....4....4....1....5....5....4....5....2....1....5....4....2....1....4....5
%e A214940 ..0....5....5....4....2....4....1....1....1....3....3....1....4....2....1....2
%e A214940 ..5....3....0....5....3....2....4....4....0....1....4....0....3....0....2....1
%e A214940 ..3....4....3....3....2....5....2....5....5....4....0....3....5....4....4....0
%e A214940 ..5....1....4....5....1....3....3....3....2....5....3....4....0....2....5....5
%e A214940 ..0....0....5....2....3....4....2....5....3....2....4....2....2....4....1....1
%o A214940 (Python)
%o A214940 from itertools import product
%o A214940 def a(n):
%o A214940     if n == 1: return 6
%o A214940     squares = ["".join(u) + "".join(u)
%o A214940         for r in range(1, n//2 + 1) for u in product("012345", repeat=r)]
%o A214940     words = ("0"+"".join(w) for w in product("012345", repeat=n-1))
%o A214940     return 6*sum(all(s not in w for s in squares) for w in words)
%o A214940 print([a(n) for n in range(1, 9)]) # _Michael S. Branicky_, Jun 30 2021
%K A214940 nonn
%O A214940 1,1
%A A214940 _R. H. Hardin_ Jul 30 2012