A214716 Least m>0 such that 3^n-m and n-m are relatively prime.
2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 4
Offset: 1
Examples
gcd(3^7-1,6) = 2, gcd(3^7-2,5) = 5, gcd(3^7-3,4) = 4, gcd(3^7-4,3) = 1, so a(7) = 4.
Links
- Clark Kimberling, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Table[m = 1; While[GCD[3^n - m, n - m] != 1, m++]; m, {n, 1, 140}] lm[n_]:=Module[{m=1,n3=3^n},While[!CoprimeQ[n3-m,n-m],m++];m]; Array[ lm,90] (* Harvey P. Dale, May 10 2016 *)