Let a(n) be the number of n-digit beastly squares, where a square is beastly if its decimal representation contains the string "666" but not the string "6666". The sequence starts: 0, 0, 0, 0, 0, 0, 3, 21, 78, 302, 1139, 4156 Jim Buddenhagen :-)