%I #19 May 14 2021 12:17:35
%S 2,2,2,2,2,2,2,2,2,3,11,3,4,4,2,2,2,2,2,0,3,19,3,3,2,2,2,2,2,3,11,3,5,
%T 7,2,2,2,2,2,0,3,5,3,14,2,2,2,2,2,5,11,8,4,4,3,11,8,4,4,0,3,7,3,4,5,
%U 13,10,4,4,3,11,3,4,4,6,6,5,3,6,0,7,5,6,3,9,3,8,7,10
%N Factors of alternators which produce least alternating proper multiples.
%C 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).
%C 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.
%C If n is congruent to 0 mod 20, a(n) is set to zero to indicate that n is not an alternator.
%H The IMO Compendium, <a href="https://imomath.com/othercomp/I/Imo2004.pdf">Problem 6</a>, 45th IMO 2004.
%F a(n) >= A110305(n).
%e 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.
%p f:= proc(n) local k,L;
%p if n mod 20 = 0 then return 0 fi;
%p if n <= 4 then return 2 fi;
%p for k from 2 do
%p L:= convert(k*n,base,10) mod 2;
%p if convert(L[1..-2]+L[2..-1],set) = {1} then return k fi;
%p od
%p end proc:
%p map(f, [$1..100]); # _Robert Israel_, Apr 15 2021
%t 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 *)
%Y Cf. A030141, A110303, A110304, A110305, A343335.
%K nonn,base
%O 1,1
%A _Bernard Schott_, Apr 15 2021
%E Name edited by _Michel Marcus_, May 12 2021
|