cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239638 Numbers n such that the semiprime 2^n-1 is divisible by 2n+1.

This page as a plain text file.
%I A239638 #24 May 28 2022 22:08:45
%S A239638 11,23,83,131,3359,130439,406583
%N A239638 Numbers n such that the semiprime 2^n-1 is divisible by 2n+1.
%C A239638 All terms are primes == 5 modulo 6 (A005384 Sophie Germain primes).
%C A239638 a(8) >= 500000. - _Max Alekseyev_, May 28 2022
%e A239638 n = 11, 2^n -1 = 2047 = 23*89,
%e A239638 n = 23, 8388607 = 47*178481,
%e A239638 n = 131, 2722258935367507707706996859454145691647 =  263*10350794431055162386718619237468234569.
%t A239638 Select[Range[4000], PrimeQ[2*# + 1] && PowerMod[2, #, 2*# + 1] == 1 &&
%t A239638 PrimeQ[(2^# - 1)/(2*# + 1)] &] (* _Giovanni Resta_, Mar 23 2014 *)
%o A239638 (PARI) is(n)=n%6==5 && Mod(2,2*n+1)^n==1 && isprime(2*n+1) && ispseudoprime((2^n-1)/(2*n+1)) \\ _Charles R Greathouse IV_, Aug 25 2016
%o A239638 (Python)
%o A239638 from sympy import isprime, nextprime
%o A239638 A239638_list, p = [], 5
%o A239638 while p < 10**6:
%o A239638     if (p % 6) == 5:
%o A239638         n = (p-1)//2
%o A239638         if pow(2,n,p) == 1 and isprime((2**n-1)//p):
%o A239638             A239638_list.append(n)
%o A239638     p = nextprime(p) # _Chai Wah Wu_, Jun 05 2019
%Y A239638 Cf. A000043, A001348, A046051, A005384, A005420, A085724, A049479.
%K A239638 nonn,more
%O A239638 1,1
%A A239638 _Zak Seidov_, Mar 23 2014
%E A239638 a(5)-a(6) from _Giovanni Resta_, Mar 23 2014
%E A239638 a(7) from _Eric Chen_, added by _Max Alekseyev_, May 21 2022