A329793 Smallest positive multiple of n that contains only the digits 1,2,3,4,5, or -1 if no such multiple exists.
-1, 1, 2, 3, 4, 5, 12, 14, 24, 45, -1, 11, 12, 13, 14, 15, 32, 34, 54, 114, -1, 21, 22, 23, 24, 25, 52, 54, 112, 145, -1, 31, 32, 33, 34, 35, 144, 111, 114, 234, -1, 41, 42, 43, 44, 45, 322, 141, 144, 245, -1, 51, 52, 53, 54, 55, 112, 114, 232, 354, -1, 122, 124, 252, 512, 325, 132, 134, 544, 345, -1
Offset: 0
References
- G. Galperin and Y. J. Ionin (Proposers), and M. Reid (Solver), Problem 12034, Amer. Math. Monthly, 126:10, 950-951, Dec. 2019.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..25000
- Rémy Sigrist, PARI program for A329793
Programs
-
PARI
\\ See Links section.
-
Python
def A329793(n): if n % 10: m, s = n, set('12345') while not set(str(m)) <= s: m += n return m else: return -1 # Chai Wah Wu, Dec 04 2019
Comments