login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = gcd(prime(n)+1, n).
5

%I #14 May 05 2017 08:15:22

%S 1,2,3,4,1,2,1,4,3,10,1,2,1,2,3,2,1,2,1,4,1,2,1,6,1,2,1,4,1,6,1,4,3,2,

%T 5,4,1,2,3,2,1,14,1,2,9,2,1,16,1,10,3,4,1,18,1,8,3,2,1,6,1,2,7,8,1,6,

%U 1,2,3,70,1,72,1,2,5,4,1,2,1,10,3,2,1,14,5,2,3,2,1,2,13,4,1,2,5,24,1,2,1,2

%N a(n) = gcd(prime(n)+1, n).

%H Ivan Neretin, <a href="/A084310/b084310.txt">Table of n, a(n) for n = 1..10000</a>

%p A084310:= n-> igcd(ithprime(n)+1,n): seq(A084310(n), n=1..150); # _Wesley Ivan Hurt_, Jan 27 2017

%t Table[GCD[Prime[w]+1, w], {w, 128}]

%o (PARI) a(n) = gcd(prime(n)+1, n); \\ _Michel Marcus_, Jan 27 2017

%Y Cf. A084309, A084311, A084312, A084313, A084314, A084315, A084316.

%K nonn,easy

%O 1,2

%A _Labos Elemer_, Jun 13 2003