%I #8 May 31 2015 17:13:19
%S 2,1,2,1,2,1,2,1,2,2,6,1,2,1,2,2,2,1,2,1,2,1,2,1,2,1,4,2,4,1,2,1,2,1,
%T 2,1,2,1,2,2,2,1,2,1,2,2,6,1,2,1,2,2,6,1,2,2,2,1,4,1,2,1,2,2,4,1,2,1,
%U 2,1,2,1,2,1,2,2,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,2,4,1,2,1,2
%N Least m>0 such that prime(n)+m and n-m are relatively prime.
%H Clark Kimberling, <a href="/A214069/b214069.txt">Table of n, a(n) for n = 1..1000</a>
%e gcd(12,10) = 2 and gcd(13,9) = 1, so that a(11) = 2.
%t Table[m = 1; While[GCD[Prime[n] + m, n - m] != 1, m++]; m, {n, 1, 140}]
%o (PARI) vector(100,n,m=1;while(gcd(prime(n)+m,n-m)!=1,m++);m) \\ _Derek Orr_, May 30 2015
%Y Cf. A214052.
%K nonn,easy
%O 1,1
%A _Clark Kimberling_, Jul 26 2012
|