login
A252669
a(n) is the smallest integer k such that n*k mod (n+k) = 1, or -1 if no such k exists.
0
1, 3, 2, 13, 8, 31, 3, 5, 32, 91, 50, 17, 4, 183, 98, 241, 12, 7, 162, 381, 5, 75, 30, 553, 288, 651, 46, 129, 392, 23, 6, 9, 76, 55, 578, 1261, 100, 47, 722, 1561, 17, 311, 7, 105, 968, 27, 18, 413, 1152, 11, 1250, 489, 228, 2863, 34, 3081, 8, 615, 1682, 217, 1800, 707
OFFSET
1,2
FORMULA
a(a(n)) <= n.
MATHEMATICA
sik[n_]:=Module[{k=1}, While[Mod[n*k, n+k]!=1, k++]; k]; Array[sik, 70] (* Harvey P. Dale, Aug 15 2015 *)
PROG
(Python)
import math
for n in range(1, 333):
res=-1
for k in range(2**31-1):
if ((n*k) % (n+k) == 1):
res=k
break
print(res, end=', ')
(PARI) a(n) = k=1; while ((n*k) % (n+k) != 1, k++); k; \\ Michel Marcus, Jan 08 2015
CROSSREFS
Cf. A063427.
Sequence in context: A226062 A245610 A191705 * A131050 A219374 A084416
KEYWORD
nonn,changed
AUTHOR
Alex Ratushnyak, Jan 02 2015
STATUS
approved