%I #41 Nov 20 2017 03:30:52
%S 2,2,3,2,3,2,5,2,5,2,3,3,7,2,3,2,3,2,5,2,3,5,5,2,5,3,3,2,5,2,13,3,3,2,
%T 3,2,11,2,5,5,3,3,5,2,3,2,5,3,5,2,19,5,3,7,7,2,3,2,5,2,7,11,3,2,5,2,5,
%U 3,11,5,3,5,13,5,5,2,3,2,7,2,7,5,3,2,5,2,3,2,17,2,7,3,5,2,3,3,11,2,5,5
%N a(n) is the minimal prime q such that n*(q+1)-1 is prime, that is, the smallest prime q so that n = (p+1)/(q+1) with p prime; or a(n) = -1 if no such q exists.
%C A conjecture of Schinzel, if true, would imply that such a q always exists.
%H T. D. Noe, <a href="/A060324/b060324.txt">Table of n, a(n) for n = 1..10000</a>
%H Matthew M. Conroy, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL4/CONROY/conroy.html">A sequence related to a conjecture of Schinzel</a>, J. Integ. Seqs. Vol. 4 (2001), #01.1.7.
%H Peter Luschny, <a href="/wiki/User:Peter_Luschny/SchinzelSierpinskiConjectureAndCalkinWilfTree"> Schinzel-Sierpinski conjecture and Calkin-Wilf tree.</a>
%F a(n) = (A062251(n)+1) / n - 1. - _Reinhard Zumkeller_, Aug 28 2014
%e 1 = (2+1)/(2+1), so the first term is 2; 3(2+1) - 1 = 8 which is not prime, yet 3(3+1) - 1 = 11 is prime (3 = (11+1)/(3+1)) so the 3rd term is 3.
%p a:= proc(n) local q;
%p q:= 2;
%p while not isprime(n*(q+1)-1) do
%p q:= nextprime(q);
%p od; q
%p end:
%p seq(a(n), n=1..300); # _Alois P. Heinz_, Feb 11 2011
%t a[n_] := (q = 2; While[!PrimeQ[n*(q + 1) - 1], q = NextPrime[q]]; q); a /@ Range[100] (* _Jean-François Alcover_, Jul 20 2011, after Maple prog. *)
%o (Haskell)
%o a060324 n = head [q | q <- a000040_list, a010051' (n * (q + 1) - 1) == 1]
%o -- _Reinhard Zumkeller_, Aug 28 2014
%o (PARI) a(n) = {my(q=2); while (!isprime(n*(q+1)-1), q = nextprime(q+1)); q;} \\ _Michel Marcus_, Nov 20 2017
%Y Cf. A060424. Values of p are given in A062251.
%Y Cf. A000040, A010051.
%K nonn,nice,easy
%O 1,1
%A _Matthew Conroy_, Mar 29 2001
|