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-2 of 2 results.

A253027 Smallest odd number k>1 such that k*2^A000043(n)+1 is a prime number.

Original entry on oeis.org

3, 5, 3, 5, 5, 9, 11, 35, 53, 51, 105, 5, 233, 347, 125, 369, 2063, 89, 4715, 1145, 885, 4839, 2711, 30611, 5859, 2543, 21509, 114071, 309, 60191, 524489, 33305, 306363, 987537, 509765
Offset: 1

Views

Author

Pierre CAMI, Dec 26 2014

Keywords

Examples

			3*2^2+1=13 prime so a(1)=3 as A000043(1)=2.
3*2^3+1=25 composite, 5*2^3+1=41 prime so a(2)=5 as A000043(2)=3.
3*2^5+1=97 prime so a(3)=3 as A000043(3)=5.
		

Crossrefs

Programs

  • Mathematica
    a253027[n_] :=
    Block[{k, t = Select[Prime[Range[n]], PrimeQ[2^# - 1] &], l},
      l = Length[t];
    Table[k = 3; While[! PrimeQ[k*2^t[[i]] + 1], k = k + 2]; k, {i, l}]]; a253027[600] (* Michael De Vlieger, Dec 26 2014 *)
  • PARI
    lista(nn) = {forprime (n=1, nn, if (isprime(2^n-1), k=3; while (!isprime(k*2^n+1), k += 2); print1(k, ", ");););} \\ Michel Marcus, Dec 27 2014
  • PFGW
    Command pfgw64 -f -e1000000 in.txt
    in.txt file :
    ABC2 a$*2^756839+$b // {number_primes,$b,1}
    b: from 1 to 1
    a: from 1 to 1000000
    

Extensions

a(33)-a(35) from Pierre CAMI, Apr 06 2015

A249806 Smallest odd number k>1 such that k*2^prime(n)-1 is also prime.

Original entry on oeis.org

3, 3, 7, 3, 3, 9, 7, 51, 13, 7, 15, 21, 15, 3, 31, 147, 45, 69, 43, 73, 15, 69, 91, 19, 51, 81, 3, 25, 9, 85, 103, 55, 169, 225, 109, 145, 15, 103, 615, 69, 259, 69, 63, 45, 285, 471, 9, 255, 169, 489, 69, 273, 427, 43, 391, 169, 201, 21
Offset: 1

Views

Author

Pierre CAMI, Nov 06 2014

Keywords

Comments

If prime(n) is a Mersenne prime exponent then 2^prime(n)-1 is a prime < k*2^prime(n)-1.

Crossrefs

Cf. A135434.

Programs

  • Maple
    3*2^2-1=11 prime so a(1)=3.
    3*2^3-1=23 prime so a(2)=3.
    3*2^5-1=95 composite, 5*2^5-1=159 composite, 7*2^5-1=223 prime so a(3)=7.
  • Mathematica
    a249806[n_Integer] := Catch[Module[{k}, For[k = 3, k < 10^5, k += 2, If[PrimeQ[k*2^Prime[n] - 1], Throw[k], 0]]]]; a249806 /@ Range[120] (* Michael De Vlieger, Nov 11 2014 *)
  • PARI
    s=[]; forprime(p=2, 500, k=3; q=2^p; while(!ispseudoprime(k*q-1), k+=2); s=concat(s, k)); s \\ Colin Barker, Nov 06 2014
Showing 1-2 of 2 results.