OFFSET
1,1
COMMENTS
Every positive integer that is not multiple of 20 is called an alternator (A110303) because it has a multiple in which parity of the decimal digits alternates and that is called an alternating integer (A030141).
If n is an alternator, n <> 20*k, a(n) is the smallest q > 1, such that q*n is a proper alternating multiple of n; this is a variant of A110305 where q = 1 is authorized when n is an alternating alternator.
If n is congruent to 0 mod 20, a(n) is set to zero to indicate that n is not an alternator.
LINKS
The IMO Compendium, Problem 6, 45th IMO 2004.
FORMULA
a(n) >= A110305(n).
EXAMPLE
a(14) = 4 because the successive proper multiples of 14 are 28, 42 that are not alternating, then, 4*14 = 56 is alternating because 5 is odd and 6 is even.
MAPLE
f:= proc(n) local k, L;
if n mod 20 = 0 then return 0 fi;
if n <= 4 then return 2 fi;
for k from 2 do
L:= convert(k*n, base, 10) mod 2;
if convert(L[1..-2]+L[2..-1], set) = {1} then return k fi;
od
end proc:
map(f, [$1..100]); # Robert Israel, Apr 15 2021
MATHEMATICA
altQ[n_] := (r = Mod[IntegerDigits[n], 2]) == Split[r, UnsameQ][[1]]; a[n_] := If[Divisible[n, 20], 0, Module[{k = 2*n}, While[! altQ[k], k += n]; k/n]]; Array[a, 100] (* Amiram Eldar, Apr 15 2021 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Apr 15 2021
EXTENSIONS
Name edited by Michel Marcus, May 12 2021
STATUS
approved