[go: up one dir, main page]

login
A131880
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.
3
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, 38, 31, 56, 29, 61, 31, 62, 39, 50, 36, 97, 37, 56, 45, 97, 41, 74, 43, 86, 53, 70, 47, 122, 49, 85, 59, 98, 53, 103, 58, 122, 66, 88, 59, 173, 61, 92, 74, 127, 67, 125, 67, 127, 81
OFFSET
1,2
COMMENTS
If n is prime then a(n) = n. - Robert Israel, Dec 19 2017
LINKS
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
Sequence in context: A223702 A120726 A060203 * A045790 A159842 A085102
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 23 2007
EXTENSIONS
More terms from R. J. Mathar, Aug 01 2007
STATUS
approved