OFFSET
1,2
COMMENTS
If n is prime then a(n) = n. - Robert Israel, Dec 19 2017
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
2^6 -1 = 63. a(6) is the 6th positive integer which is coprime to 63. So a(6) = 10.
MAPLE
f:= proc(n) local t, k, count;
if isprime(n) then return n fi;
t:= 2^n-1; count:= 0;
for k from 1 do
if igcd(k, t) = 1 then
count:= count+1;
if count = n then return k fi
fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Dec 19 2017
MATHEMATICA
a[n_] := Module[{cnt = 0, k}, For[k = 1, True, k++, If[CoprimeQ[2^n-1, k], cnt++; If[cnt == n, Return[k]]]]];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 07 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 23 2007
EXTENSIONS
More terms from R. J. Mathar, Aug 01 2007
STATUS
approved