A061807 Smallest positive multiple of n containing only even digits.
2, 2, 6, 4, 20, 6, 28, 8, 288, 20, 22, 24, 26, 28, 60, 48, 68, 288, 228, 20, 42, 22, 46, 24, 200, 26, 486, 28, 406, 60, 62, 64, 66, 68, 280, 288, 222, 228, 468, 40, 82, 42, 86, 44, 2880, 46, 282, 48, 686, 200, 204, 208, 424, 486, 220, 224, 228, 406, 826, 60, 244, 62
Offset: 1
Examples
a(7) = 28 because among the multiples of 7, that is, 7, 14, 21, 28,... 28 is the smallest multiple with only even digits. a(16) = 48 is the first example where k(n) = a(n)/n > 1 is odd. The next examples are k(54) = 9, k(58) = 7, k(74) = 3, k(76) = 3, k(92) = 5, k(94) = 3, k(96) = 3, k(98) = 7. - _M. F. Hasler_, Mar 03 2025
Links
- Paul Tek, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[k = n; While[Length[Intersection[{1, 3, 5, 7, 9}, IntegerDigits[k]]] > 0, k = k + n]; k, {n, 100}] (* T. D. Noe, Jun 03 2013 *) spme[n_]:=Module[{k=1},While[AnyTrue[IntegerDigits[k*n],OddQ],k++];k*n]; Array[spme,70] (* Harvey P. Dale, Mar 19 2024 *)
-
PARI
apply( {A061807(n)=forstep(k=if(n%2,n*=2,n),oo,n, digits(k)%2||return(k))}, [1..99]) \\ M. F. Hasler, Mar 03 2025
-
Python
A061807 = lambda n: next(n*k for k in range(1+n%2, 9<<99, 1+n%2)if not any(int(d)&1 for d in str(n*k))) # M. F. Hasler, Mar 03 2025
Formula
a(n) = n if n has only even digits, else 2n if n has only digits < 5, else 2*R(3k+3)+6*R(2k+2) if n = m*(10^k-1) with m = 1, 2, 4 or 8, else 10*a(n/5) if n = 5*(10^n-1). - M. F. Hasler, Mar 03 2025
Extensions
Corrected and extended by Larry Reeves (larryr(AT)acm.org), May 29 2001