login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A290838 a(n) = smallest prime p such that 2p - 2n + 1 is prime. 2

%I #20 Dec 14 2017 20:06:13

%S 2,2,3,5,5,7,7,13,11,11,11,13,13,19,17,17,17,19,19,37,23,23,23,29,29,

%T 31,29,29,29,31,31,37,37,41,37,37,37,43,41,41,41,43,43,61,47,47,47,53,

%U 53,67,53,53,53,59,59,61,59,59,59,61,61,67,67,71,67,67,67,73

%N a(n) = smallest prime p such that 2p - 2n + 1 is prime.

%C a(n) > n. - _Iain Fox_, Nov 13 2017

%H Iain Fox, <a href="/A290838/b290838.txt">Table of n, a(n) for n = 0..20000</a>

%F a(-n) = A290839(n+1) - _Iain Fox_, Dec 14 2017

%t Table[j=0; found=False; While[!found,j++; found=PrimeQ[2Prime[j]-2n+1] && 2Prime[j]-2n+1>0]; Prime[j],{n,67}]

%t (* Second program: *)

%t Table[SelectFirst[Prime@ Range[n^2], And[# > 0, PrimeQ@ #] &[2 # - 2 n + 1] &], {n, 67}] (* _Michael De Vlieger_, Aug 14 2017 *)

%o (PARI) a(n) = {my(p=2); while(!isprime(2*p-2*n+1), p = nextprime(p+1)); p; } \\ _Michel Marcus_, Aug 12 2017

%o (PARI) a(n) = forprime(p=n+1, , if(isprime(2*p - 2*n + 1), return(p))) \\ _Iain Fox_, Nov 13 2017

%Y Cf. A005382, A063908, A063909, A063910, A063911, A063912, A063913, A020483, A290839.

%K nonn,easy

%O 0,1

%A _XU Pingya_, Aug 11 2017

%E a(0) prepended by _Iain Fox_, Dec 14 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 20:05 EDT 2024. Contains 371254 sequences. (Running on oeis4.)