login
A394357
a(n) is the least k such that k and 10^k - n are coprime but k and 10^k - j are not coprime for 1 <= j < n.
2
1, 3, 6, 526235, 286, 58395, 2860, 31278555, 5310
OFFSET
1,2
COMMENTS
a(n) is the least k such that A394352(k) = n.
a(10) > 10^9.
a(11) = 210630.
a(13) = 55515460.
a(17) = 878370.
EXAMPLE
a(3) = 6 because 10^6 - 1 and 10^6 - 2 are not coprime to 6 but 10^6 - 3 is, and 6 is the smallest number that works.
MAPLE
h:= proc(n) local q, k;
for k from 1 do
q:= 10 &^ n - k mod n;
if igcd(q, n) = 1 then return k fi;
od
end proc:
V:= Vector(9): count:= 0:
for k from 1 while count < 9 do
v:= h(k);
if V[v] = 0 then V[v]:= k; count:= count+1 fi;
od:
convert(V, list);
MATHEMATICA
h[n_]:=Module[{k=1, q}, While[True, q=Mod[PowerMod[10, n, n]-k, n]; If[GCD[q, n]==1, Return[k]]; k++]]; V=ConstantArray[0, 9]; count=0; k=1; While[count<9, v=h[k]; If[v<=9&&V[[v]]==0, V[[v]]=k; count++]; k++]; V (* Vincenzo Librandi, Mar 21 2026 *)
CROSSREFS
Sequence in context: A157596 A111316 A297530 * A222010 A390640 A152590
KEYWORD
nonn,more
AUTHOR
Robert Israel, Mar 17 2026
STATUS
approved