login
Primes p such that (p+1)/2 is prime.
(Formerly M2492)
109

%I M2492 #136 Sep 08 2022 08:44:33

%S 3,5,13,37,61,73,157,193,277,313,397,421,457,541,613,661,673,733,757,

%T 877,997,1093,1153,1201,1213,1237,1321,1381,1453,1621,1657,1753,1873,

%U 1933,1993,2017,2137,2341,2473,2557,2593,2797,2857,2917,3061,3217,3253

%N Primes p such that (p+1)/2 is prime.

%C Also, n such that sigma(n)/2 is prime. - _Joseph L. Pe_, Dec 10 2001; confirmed by _Vladeta Jovovic_, Dec 12 2002

%C Primes that are followed by twice a prime, i.e., are followed by a semiprime. (For primes followed by two semiprimes, see A036570.) - _Zak Seidov_, Aug 03 2013, Dec 31 2015

%C If A005382(n) is in A168421 then a(n) is a twin prime with a Ramanujan prime, A104272(k) = a(n) - 2. - _John W. Nicholson_, Jan 07 2016

%C Starting with 13 all terms are congruent to 1 mod 12. - _Zak Seidov_, Feb 16 2017

%C Numbers n such that both n and n+12 are terms are 61, 661, 1201, 4261, 5101, 6121, 6361 (all congruent to 1 mod 60). - _Zak Seidov_, Mar 16 2017

%C Primes p for which there exists a prime q < p such that 2q == 1 (mod p). Proof: q = (p + 1)/2. - _David James Sycamore_, Nov 10 2018

%C Prime numbers n such that phi(sigma(2n)) = phi(2n), excluding n=3 and n=5; as well as phi(sigma(3n)) = phi(3n), excluding n=3 only. - _Richard R. Forberg_, Dec 22 2020

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H T. D. Noe, <a href="/A005383/b005383.txt">Table of n, a(n) for n = 1..10000</a>

%H M. Abramowitz and I. A. Stegun, eds., <a href="http://www.convertit.com/Go/ConvertIt/Reference/AMS55.ASP">Handbook of Mathematical Functions</a>, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].

%H R. P. Boas & N. J. A. Sloane, <a href="/A005381/a005381.pdf">Correspondence, 1974</a>

%H Benoit Cloitre, <a href="https://web.archive.org/web/20150923071043/http://bcmathematics.monsite-orange.fr/FractalOrderOfPrimes.pdf">On the fractal behavior of primes</a>, 2011.

%F a(n) = A129521(n)/A005382(n). - _Reinhard Zumkeller_, Apr 19 2007

%F A000035(a(n))*A010051(a(n))*A010051((a(n)+1)/2) = 1. - _Reinhard Zumkeller_, Nov 06 2012

%F a(n) = 2*A005382(n) - 1. - _Zak Seidov_, Nov 19 2012

%F a(n) = A005382(n) + phi(A005382(n)) = A005382(n) + A000010(A005382(n)). - _Torlach Rush_, Mar 10 2014

%e Both 3 and (3+1)/2 = 2 are primes, both 5 and (5+1)/2 = 3 are primes. - _Zak Seidov_, Nov 19 2012

%p for n to 300 do

%p X := ithprime(n);

%p Y := ithprime(n+1);

%p Z := 1/2 mod Y;

%p if isprime(Z) then print(Y);

%p end if:

%p end do:

%p # _David James Sycamore_, Nov 11 2018

%t Select[Prime[Range[1000]], PrimeQ[(# + 1)/2] &] (* _Zak Seidov_, Nov 19 2012 *)

%o (MATLAB) LIMIT = 8000 % Find all members of A005383 less than LIMIT A = primes(LIMIT); n = length(A); %n is number of primes less than LIMIT B = 2*A - 1; C = ones(n, 1)*A; %C is an n X n matrix, with C(i, j) = j-th prime D = B'*ones(1, n); %D is an n X n matrix, with D(i, j) = (i-th prime)*2 - 1 [i, j] = find(C == D); A(j)

%o (Magma) [n: n in [1..3300] | IsPrime(n) and IsPrime((n+1) div 2) ]; // _Vincenzo Librandi_, Sep 25 2012

%o (PARI) A005383_list(n) = select(m->isprime(m\2+1),primes(n)[2..n]) \\ _Charles R Greathouse IV_, Sep 25 2012

%o (Haskell)

%o a005383 n = a005383_list !! (n-1)

%o a005383_list = [p | p <- a065091_list, a010051 ((p + 1) `div` 2) == 1]

%o -- _Reinhard Zumkeller_, Nov 06 2012

%o (Python)

%o from sympy import isprime

%o [n for n in range(3, 5000) if isprime(n) and isprime((n + 1)/2)]

%o # _Indranil Ghosh_, Mar 17 2017

%o (Sage)

%o [n for n in prime_range(3, 1000) if is_prime((n + 1) // 2)]

%o # _F. Chapoton_, Dec 17 2019

%Y Cf. A005382, A057326, A057327, A057328, A057329, A057330, A005603.

%Y A subsequence of A000040 which has A036570 as subsequence.

%Y Cf. A005385, A010051, A065091, A048161, A036570.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_

%E More terms from _David Wasserman_, Jan 18 2002

%E Name changed by _Jianing Song_, Nov 27 2021