login
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

%I #17 Dec 28 2022 05:43:41

%S 3,4,9,8,15,24,35,24,99,20,33,24,39,28,75,48,51,288,57,40,315,44,115,

%T 48,75,208,135,84,319,60,93,64,99,68,175,288,111,228,117,80,533,84,

%U 559,88,135,460,517,240,539,200,153,208,159,486,715,224,171,406,177

%N 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).

%C Inspired by Problem 300 in Mathematical Excalibur, Vol. 13, No. 1, February-April, 2008.

%H Michel Marcus, <a href="/A217578/b217578.txt">Table of n, a(n) for n = 1..1000</a>

%H Kin Y. Li, <a href="http://www.math.ust.hk/excalibur/v13_n1.pdf">Problem 300</a>, Mathematical Excalibur, Vol. 13, No. 1, February-April, 2008.

%t 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 *)

%o (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,", "););}

%K nonn,base

%O 1,1

%A _Michel Marcus_, Oct 07 2012