A350536 a(n) is the smallest proper multiple of 2n+1 which contains only odd digits, or -1 if no such multiple exists.
3, 9, 15, 35, 99, 33, 39, 75, 51, 57, 315, 115, 75, 135, 319, 93, 99, 175, 111, 117, 533, 559, 135, 517, 539, 153, 159, 715, 171, 177, 793, 315, 195, 335, 759, 355, 511, 375, 539, 395, 1377, 913, 595, 957, 979, 1911, 1395, 1995, 3395, 9999, 1111, 515, 315, 535, 1199, 333
Offset: 0
Examples
a(10) = 315 = 21 * 15 is the smallest multiple of 21 which contains only odd digits. a(4998) = 33339995 = 9997 * 3335 is the smallest multiple of 9997 which contains only odd digits, so this is the answer to the IMTS problem.
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..10000
- International Mathematical Talent Search, Problem 1/2, Round 2.
- Index to sequences related to Olympiads and other Mathematical Competitions.
Programs
-
Mathematica
a[n_] := Module[{m = 2*n + 1, k}, k = 3*m; While[!AllTrue[IntegerDigits[k], OddQ], k += 2*m]; k]; Array[a, 50, 0] (* Amiram Eldar, Jan 04 2022 *)
-
PARI
isok(k) = my(d=digits(k)); #d == #select(x->((x%2)==1), d); a(n) = my(k=6*n+3); while (!isok(k), k+=4*n+2); k; \\ Michel Marcus, Jan 04 2022
-
Python
from itertools import product, count def A350536(n): m = 2*n+1 for l in count(len(str(m))): for s in product('13579',repeat=l): k = int(''.join(s)) if k > m and k % m == 0: return k # Chai Wah Wu, Jan 11 2022
Extensions
More terms from Michel Marcus, Jan 04 2022
Comments