A beastly number (A051003) is a number with substring 666.
It is easy enough to prove that for each positive integer n, there is an
integer k such that kn is beastly. Let f(n) be the smallest such k.
Show that f(n) is bounded over all integers n. What is the largest possible
value of f(n)?