login
A386680
a(n) is the least k such that the concatenation of k, k-1, ..., 1 is divisible by 2*n-1, or -1 if there is no such k.
1
1, 2, -1, 2, 8, 14, 15, -1, 9, 5, 2, 16, -1, 26, 4, 25, 14, -1, 21, 15, 40, 67, -1, 78, 54, 9, 66, -1, 5, 25, 111, 44, -1, 161, 18, 49, 30, -1, 73, 15, 27, 27, -1, 41, 20, 54, 47, -1, 63, 18, 98, 102, -1, 3, 99, 21, 92, -1, 17, 216, 18, 41, -1, 296, 132, 71, 147, -1, 22, 367, 78, 95, -1, 54, 4, 48
OFFSET
1,2
COMMENTS
a(n) = -1 if n == 3 (mod 5).
LINKS
FORMULA
If a(n) > 0, A000422(a(n)) == 0 (mod n).
EXAMPLE
a(9) = 8 because 87654321 is divisible by 9, but none of 1, 21, 321, ..., 7654321 are divisible by 9.
MAPLE
F:= proc(n) local k, x, l;
if n mod 5 = 0 then return -1 fi;
x:= 1; l:= 1;
for k from 2 do
x:= k * 10^l+x mod n;
if x = 0 then return k fi;
l:= l + 1 + ilog10(k);
od;
end proc;
F(1):= 1:
map(F, [seq(i, i=1..201, 2)]);
CROSSREFS
Sequence in context: A219109 A137305 A282885 * A242841 A143208 A353581
KEYWORD
sign,base
AUTHOR
Robert Israel, Oct 24 2025
STATUS
approved