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”).
%I #21 Apr 25 2016 11:50:03
%S 2,2,2,7,5,109,23,3,2,2843,1879,643,809,1153,653,2969,4679,241,19,
%T 9749,6247,13,2003,5639,3061,13799,73,2,6733,113,2917,24977,2411,19,
%U 6473,12457,3187,6133,4967,22643,26723,1279,2837,5347,353,9721,19,433
%N Smallest prime Q such that prime(n)*(2*Q)^prime(n)-1 is prime.
%H Pierre CAMI and Jens Kruse Andersen, <a href="/A245600/b245600.txt">Table of n, a(n) for n = 1..200</a> (first 100 terms from Pierre CAMI)
%e 2*(2*2)^2-1 = 31 prime so a(1) = 2.
%e 3*(2*2)^3-1 = 191 prime so a(2) = 2.
%p A:= proc(n)
%p local p,q;
%p p:= ithprime(n);
%p q:= 1;
%p do
%p q:= nextprime(q);
%p if isprime(p*(2*q)^p-1) then return(q) fi
%p od:
%p end proc:
%p seq(A(n),n=1..50); # _Robert Israel_, Aug 05 2014
%t a245600[n_Integer] := Catch[
%t Do[
%t If[And[PrimeQ[Q], PrimeQ[Prime[n]*(2*Q)^Prime[n] - 1]] == True,
%t Throw[Q]],
%t {Q, 1000000}]
%t ]; Map[a245600, Range[50]] (* _Michael De Vlieger_, Aug 03 2014 *)
%o (PFGW & SCRIPT)
%o SCRIPT
%o DIM i,0
%o DIM n
%o DIMS t
%o OPENFILEOUT myf,b(n).txt
%o LABEL loop1
%o SET i,i+1
%o IF i>100 THEN END
%o SET n,0
%o LABEL loop2
%o SET n,n+1
%o SETS t,%d,%d\,;p(i);p(n)
%o PRP p(i)*(2*p(n))^p(i)-1,t
%o IF ISPRP THEN GOTO a
%o GOTO loop2
%o LABEL a
%o WRITE myf,t
%o GOTO loop1
%o (PARI) a(n)=for(k=1,10^5,if(ispseudoprime(prime(n)*(2*prime(k))^prime(n)-1),return(prime(k))))
%o n=1;while(n<100,print1(a(n),", ");n++) \\ _Derek Orr_, Jul 27 2014
%Y Cf. A245597, A245598, A245601.
%K nonn
%O 1,1
%A _Pierre CAMI_, Jul 27 2014