A213852 Least m>0 such that n+1+m and n-m are relatively prime.
2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 5, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1
Offset: 1
Examples
gcd(9,6) = 3, gcd(10,5) = 5, gcd(11,4) = 1, so that a(7) = 3.
Links
- Clark Kimberling, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Table[m = 1; While[GCD[n+1+m,n-m] != 1, m++]; m, {n, 1, 140}]
Comments