login
A217578
a(n) is the least multiple of n, greater than n, such that all digits of a(n) are even (resp. odd) if n is even (resp. odd).
2
3, 4, 9, 8, 15, 24, 35, 24, 99, 20, 33, 24, 39, 28, 75, 48, 51, 288, 57, 40, 315, 44, 115, 48, 75, 208, 135, 84, 319, 60, 93, 64, 99, 68, 175, 288, 111, 228, 117, 80, 533, 84, 559, 88, 135, 460, 517, 240, 539, 200, 153, 208, 159, 486, 715, 224, 171, 406, 177
OFFSET
1,1
COMMENTS
Inspired by Problem 300 in Mathematical Excalibur, Vol. 13, No. 1, February-April, 2008.
LINKS
Kin Y. Li, Problem 300, Mathematical Excalibur, Vol. 13, No. 1, February-April, 2008.
MATHEMATICA
Table[k = 2; While[d = IntegerDigits[k*n]; If[OddQ[n], done = And @@ OddQ[d], done = And @@ EvenQ[d]]; ! done, k++]; k*n, {n, 100}] (* T. D. Noe, Oct 09 2012 *)
PROG
(PARI) digs(val, imod2) = {while(val, if ((val%10) % 2 != imod2, return (0)); val = floor(val/10); ); return (1); } digi(i, imod2) = {local(v); v = 2*i; while (! digs(v, imod2), v += i; ); return (v); } digv(n) = {local(i, v); for (i=1, n, v = digi(i, i % 2); print1(v, ", "); ); }
CROSSREFS
Sequence in context: A239384 A242219 A106833 * A280616 A317099 A317715
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Oct 07 2012
STATUS
approved