A382137 Smallest integer that cannot be converted to a multiple of n by changing at most one of its decimal digit.
545, 51, 44, 31, 21, 21, 22, 21, 21, 11, 15, 11, 11, 11, 11, 11, 12, 11, 11, 11, 14, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12
Offset: 11
Examples
For n=12, any number<50 can be converted to a multiple of 12 by changing its last digit. Since a) there is no multiple of 12 between 50 and 59 so changing the last digit is useless, b) 50 can be converted to 60=5*12 and c) changing the "5" of 51 gives only odd (non multiples of 12) numbers, then a(12)=51.
Links
- Mickaël Launay, Le démon des multiples, L’énigme maths du "Monde" n°48. In French.
Programs
-
Python
import math def test(N,M): t = True for i in range(0,math.floor(math.log(N,10))+1): for j in range(0,10): t = t and ((N+(j-N // 10**i % 10)*10**i)%M != 0) return t for M in range(11,100): N = 1 while (not test(N,M)): N += 1 print(N, end=', ')
Comments