%I #17 Feb 07 2023 08:15:35
%S 1,2,3,7,5,10,7,14,10,16,11,31,13,20,17,31,17,32,19,46,24,34,23,62,25,
%T 38,31,56,29,61,31,62,39,50,36,97,37,56,45,97,41,74,43,86,53,70,47,
%U 122,49,85,59,98,53,103,58,122,66,88,59,173,61,92,74,127,67,125,67,127,81
%N a(n) = the n-th positive integer which is coprime to (2^n -1). a(n) = the n-th term of row n in triangle A131879.
%C If n is prime then a(n) = n. - _Robert Israel_, Dec 19 2017
%H Robert Israel, <a href="/A131880/b131880.txt">Table of n, a(n) for n = 1..10000</a>
%e 2^6 -1 = 63. a(6) is the 6th positive integer which is coprime to 63. So a(6) = 10.
%p f:= proc(n) local t,k,count;
%p if isprime(n) then return n fi;
%p t:= 2^n-1; count:= 0;
%p for k from 1 do
%p if igcd(k,t) = 1 then
%p count:= count+1;
%p if count = n then return k fi
%p fi
%p od
%p end proc:
%p map(f, [$1..100]); # _Robert Israel_, Dec 19 2017
%t a[n_] := Module[{cnt = 0, k}, For[k = 1, True, k++, If[CoprimeQ[2^n-1, k], cnt++; If[cnt == n, Return[k]]]]];
%t Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Feb 07 2023 *)
%Y Cf. A000225, A131879.
%K nonn
%O 1,2
%A _Leroy Quet_, Jul 23 2007
%E More terms from _R. J. Mathar_, Aug 01 2007