A080501 Let f(n) be the smallest multiple of n that can be obtained by inserting digits anywhere in n except that f(n) is not equal to 10*n; a(n) = f(n)/n.
11, 6, 11, 6, 3, 6, 11, 6, 11, 11, 11, 11, 11, 11, 7, 11, 11, 6, 61, 6, 11, 11, 11, 11, 5, 11, 11, 26, 71, 11, 11, 11, 11, 11, 9, 11, 83, 36, 61, 6, 11, 11, 11, 11, 9, 31, 31, 26, 51, 3, 11, 11, 11, 11, 21, 26, 89, 26, 27, 6, 11, 11, 11, 26, 21, 51, 25, 26, 39, 11, 11, 11, 51, 51, 5
Offset: 1
Examples
a(1) = 11/1 = 11; a(15) = 105/15 = 7; a(18) = 108/18 = 6.
Programs
-
Python
def issub(s1, s2, i1, i2): if i1 == 0: return True if i2 == 0: return False if s1[i1-1] == s2[i2-1]: return issub(s1, s2, i1-1, i2-1) return issub(s1, s2, i1, i2-1) def a(n): k, kn, tenn, s, sk = 2, 2*n, 10*n, str(n), str(2*n) while kn == tenn or not issub(s, str(kn), len(s), len(sk)): kn += n; sk = str(kn) return kn//n print([a(n) for n in range(1, 76)]) # Michael S. Branicky, Nov 06 2021
Extensions
Corrected and extended by Ray Chandler, Oct 11 2003