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.

Showing 1-3 of 3 results.

A238694 Smallest k such that 2^n - k and k*2^n - 1 are both prime or 0 if no such k exists.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 1, 5, 25, 5, 31, 5, 1, 15, 49, 17, 1, 5, 1, 17, 9, 33, 69, 89, 61, 111, 199, 309, 75, 297, 1, 5, 49, 131, 31, 17, 31, 131, 165, 437, 55, 33, 309, 495, 361, 437, 999, 89, 139, 195, 129, 183, 685, 315, 915, 189, 585, 1035, 931, 93, 1, 57, 165
Offset: 1

Views

Author

Keywords

Comments

If a(n)=1, then the two primes are same and they are Mersenne primes (A000668).

Examples

			a(9) = 25 because 2^9 - 25  = 487 and 25*2^9 - 1 = 12799 are both prime.
		

Crossrefs

Cf. A238554.

Programs

  • Maple
    a:= proc(n) local k, p; p:= 2^n;
          for k while not (isprime(p-k) and isprime(k*p-1))
            do if k>=p then return 0 fi od; k
        end:
    seq(a(n), n=1..70);  # Alois P. Heinz, Mar 03 2014
  • Mathematica
    a[n_] := Module[{k, p}, p = 2^n;
         For[k = 1, !(PrimeQ[p - k] && PrimeQ[k*p - 1]), k++,
               If[k >= p, Return[0]]]; k];
    Table[a[n], {n, 1, 70}] (* Jean-François Alcover, Feb 18 2022, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Mar 03 2014

A238735 Number of prime pairs {2^n + (2k + 1), (2k + 1)*2^n + 1}, k < n.

Original entry on oeis.org

1, 2, 1, 2, 0, 3, 2, 2, 0, 1, 0, 2, 0, 0, 0, 3, 0, 1, 0, 3, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

If k = 0, then the two numbers in the "prime pair" are actually the same number, 2^n + 1 (which is either 2 or a Fermat prime; see A019434, A092506).

Examples

			a(1) = 1 because 2^1+(2*0+1)=3 and (2*0+1)*2^1+1=3 is prime pair for k=0,
a(2) = 2 because 2^2+(2*0+1)=5 and (2*0+1)*2^2+1=5 is prime pair for k=0, 2^2+(2*1+1)=7 and (2*1+1)*2^2+1=13 is prime pair for k=1,
a(3) = 1 because 2^3+(2*2+1)=13 and (2*2+1)*2^3+1=41 is prime pair for k=2.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Length@Select[Range[0, n-1], PrimeQ[2^n + (2*# + 1)] && PrimeQ[(2*# + 1)*2^n + 1] &]; Array[a, 100] (* Giovanni Resta, Mar 04 2014 *)
  • PARI
    a(n)=sum(k=0,n-1,isprime(2^n+2*k+1)&&isprime((2*k+1)<Charles R Greathouse IV, Mar 06 2014

Extensions

a(47)-a(87) from Giovanni Resta, Mar 04 2014

A238739 Numbers n such that 2^n + 3 and 3*2^n + 1 are both prime.

Original entry on oeis.org

1, 2, 6, 12, 18, 30
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 04 2014

Keywords

Comments

Intersection of A057732 and A002253. - Joerg Arndt, Mar 04 2014
By checking primality of 2^n+3 for values n in A002253, it follows a(7) > 7033641. - Giovanni Resta, Mar 08 2014
Exponents of second Fermat prime pairs. - Juri-Stepan Gerasimov, Mar 08 2014
From Juri-Stepan Gerasimov, Mar 04 2014: (Start)
If prime pair {2^n + (2k+1), (2k+1)*2^n + 1} is called a Fermat prime pair, then numbers n such that 2^n + (2k + 1) and (2k + 1)*2^n + 1 are both prime:
for k = 0: 0, 1, 2, 4, 8, 16, ... the exponents first Fermat prime pairs;
for k = 1: 1, 2, 6, 12, 18, 30, ... the exponents second Fermat prime pairs;
for k = 2: 1, 3, ... the exponents third Fermat prime pairs;
for k = 3: 2, 4, 6, 20, 174, ... the exponents fourth Fermat prime pairs;
for k = 4: 1, 2, 3, 6, 7, ... the exponents fifth Fermat prime pairs;
for k = 5: 1, 3, 5, 7, ... the exponents sixth Fermat prime pairs;
for k = 6: 2, 8, 20, ... the exponents seventh Fermat prime pairs;
for k = 7: 1, 2, 4, 10, 12, ... the exponents eighth Fermat prime pairs;
for k = 8:
for k = 9: 6, ... the exponents tenth Fermat prime pairs;
for k = 10: 1, 4, 5, 7, 16, ... the exponents eleventh Fermat prime pairs;
for k = 11:
for k = 12: 2, 4, 6, 10, 20, 22, ...the exponents thirteenth Fermat prime pairs;
for k = 13: 2, 4, 16, 40, 44, ... the exponents fourteenth Fermat prime pairs;
for k = 14: 1, 3, 5, 27, 43, ... the exponents fifteenth Fermat prime pairs.
Semiprimes of the form (2^m+2k+1)*((2k+1)*2^m+1): 4, 9, 25, 35, 77, 91, 209, 289, 319, 481, 527, 533, 901, 989, ...
(End)

Examples

			a(1) = 1 because 2^1 + 3 = 5 and 3*2^1 + 1 = 7 are both prime,
a(2) = 2 because 2^2 + 3 = 7 and 3^2^2 + 1 = 13 are both prime,
a(3) = 6 because 2^6 + 3 = 67 and 3*2^6 + 1 = 193 are both prime.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..30] | IsPrime(2^n+3) and IsPrime(3*2^n+1)]; // Arkadiusz Wesolowski, Jan 23 2016
  • Mathematica
    Select[Range[30],AllTrue[{2^#+3,3*2^#+1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 08 2015 *)
  • PARI
    isok(n) = isprime(2^n + 3) && isprime(3*2^n + 1); \\ Michel Marcus, Mar 04 2014
    
Showing 1-3 of 3 results.