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

A247202 Smallest odd k > 1 such that k*2^n - 1 is a prime number.

Original entry on oeis.org

3, 3, 3, 3, 7, 3, 3, 5, 7, 5, 3, 5, 9, 5, 9, 17, 7, 3, 51, 17, 7, 33, 13, 39, 57, 11, 21, 27, 7, 213, 15, 5, 31, 3, 25, 17, 21, 3, 25, 107, 15, 33, 3, 35, 7, 23, 31, 5, 19, 11, 21, 65, 147, 5, 3, 33, 51, 77, 45, 17, 69, 53, 9, 3, 67, 63, 43, 63, 51, 27, 73, 5
Offset: 1

Views

Author

Pierre CAMI, Nov 25 2014

Keywords

Comments

Limit_{N->oo} (Sum_{n=1..N} a(n))/(Sum_{n=1..N} n) = log(2). [[Is there a proof or is this a conjecture? - Peter Luschny, Feb 06 2015]]
Records: 3, 7, 9, 17, 51, 57, 213, 255, 267, 321, 615, 651, 867, 901, 909, 1001, 1255, 1729, 1905, 2163, 3003, 3007, 3515, 3797, 3825, 4261, 4335, 5425, 5717, 6233, 6525, 6763, 11413, 11919, 12935, 20475, 20869, 25845, 30695, 31039, 31309, 42991, 55999, ... . - Robert G. Wilson v, Feb 08 2015

Crossrefs

Programs

  • Maple
    f:= proc(n)
    local k,p;
      p:= 2^n;
    for k from 3 by 2 do if isprime(k*p-1) then return k fi od;
    end proc:
    seq(f(n), n=1 .. 100); # Robert Israel, Feb 05 2015
  • Mathematica
    f[n_] := Block[{k = 3, p = 2^n}, While[ !PrimeQ[k*p - 1], k += 2]; k]; Array[f, 70]
  • PARI
    a(n) = {k=3; while (!isprime(k*2^n-1), k+=2); k;} \\ Michel Marcus, Nov 25 2014

Formula

a(A002235(n)) = 3.

A128979 Least exponent k such that p_n*(2^k) - 1 is prime.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 2, 1, 4, 4, 1, 1, 2, 7, 4, 2, 12, 3, 5, 2, 7, 1, 2, 4, 1, 10, 3, 10, 9, 8, 25, 2, 2, 1, 4, 5, 1, 3, 4, 2, 8, 3, 226, 3, 2, 1, 1, 3, 2, 1, 4, 4, 11, 6, 4, 2, 8, 1, 5, 2, 11, 2, 1, 26, 3, 6, 1, 1, 18, 3, 4, 4, 1, 7, 1, 2, 20, 5, 10, 3, 4, 7, 2, 3, 1, 6, 112, 9, 10, 7, 2, 12, 5, 46, 1, 2, 8
Offset: 1

Views

Author

Pierre CAMI and Robert G. Wilson v, Feb 16 2007

Keywords

Comments

Supposedly the difference from A101050 is that the k here are required to be strictly positive (nonzero positive). - R. J. Mathar, Dec 13 2008

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1, p = Prime@n}, While[ !PrimeQ[p*2^k - 1], k++ ]; k]; Array[f, 97]

A245441 a(1)=3, then a(n) = smallest odd k > Ceiling(a(n-1)/2) such that k*2^n-1 is prime.

Original entry on oeis.org

3, 3, 3, 3, 7, 17, 13, 27, 25, 15, 25, 23, 21, 15, 9, 17, 15, 21, 51, 35, 19, 33, 25, 39, 57, 57, 81, 45, 45, 213, 111, 57, 31, 131, 99, 83, 45, 27, 25, 107, 55, 33, 33, 35, 67, 141, 91, 89, 69, 41, 129, 89, 147, 101, 195, 129, 79, 77, 45, 77, 69, 53, 61
Offset: 1

Views

Author

Pierre CAMI, Jul 22 2014

Keywords

Comments

A126715(n) = smallest odd k such that k*2^n-1 is prime, the primes are not always in increasing order.
Here the primes k*2^n-1 are always in increasing order.
The ratio sum_{1..N}a(n)/sum_{1..N}n is near 2*log(2) as N increases.
The ratio a(n)/n is always < 8 for n from 1 to 6000.

Examples

			3*2^1-1 = 5 is prime, a(1)=3 by definition.
3*2^2-1 = 11 is prime, 3 > 3/2 so a(2) = 3.
3*2^3-1 = 23 is prime, so a(3) = 3.
3*2^4-1 = 47 is prime, so a(4) = 3.
3*2^5-1 = 95 is composite.
5*2^5-1 = 159 is composite.
7*2^5-1 = 223 is prime so a(5) = 7.
		

Crossrefs

Cf. A126715.

Programs

  • PARI
    a=[3]; for(n=2, 100, k=floor(a[n-1]/2)+2; if(k%2==0, k++); t=2^n; while(!isprime(k*t-1), k+=2); a=concat(a, k)); a \\ Colin Barker, Jul 22 2014

A179289 Smallest index k such that prime(k)*2^n-1 is prime, or zero if there is no prime.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 2, 3, 4, 3, 2, 1, 11, 3, 22, 1, 4, 1, 18, 7, 4, 23, 6, 23, 18, 5, 44, 23, 4, 1, 14, 3, 11, 2, 11, 7, 11, 2, 18, 28, 8, 16, 2, 102, 4, 9, 11, 3, 8, 5, 174, 24, 63, 3, 2, 103, 22, 23, 130, 1, 22, 16, 18, 2, 19, 55, 14, 41, 34, 15
Offset: 1

Views

Author

Pierre CAMI, Jul 09 2010

Keywords

Comments

Define partial sum S(N)=Sum(n=1...N) of n , T(N)=Sum(n=1...N) of k(n) The ratio T(N)/S(N) --> approx 0.5236 as N --> infinity.
It is conjectured that a(42228) is the first 0 term. This corresponds to the first Riesel number, 509203, which happens to be prime. See A101036. - T. D. Noe, Mar 23 2011

Crossrefs

Cf. A126715.

Programs

  • Mathematica
    sik[n_]:=Module[{c=2^n,k=1},While[!PrimeQ[Prime[k]*c-1],k++];k]; Array[ sik,70] (* The program will NOT identify cases where no prime satisfies the definition.  See the second comment. *) (* Harvey P. Dale, Jan 10 2016 *)
  • Other
    SCRIPT / DIM nn,0 / DIM kk / DIMS st / LABEL loopn / SET nn,nn+1 / IF nn>10000 THEN END / SET kk,0 / LABEL loopk / SET kk,kk+1 / SET st,%d,%d,%d\,;nn;kk;p(kk) / PRP p(kk)*2^nn-1 / IF ISPRIME THEN GOTO loopn / GOTO loopk / / This file is the in.txt file / The command is PFGW -f in.txt / The results are in the file pfgw-prime.log for small n / and in the pfgw.log file for greatest n / Program PFGW from Primeform Group /
    
  • PARI
    a(n) = {my(k=1); while (!isprime(prime(k)*2^n-1), k++); k;} \\ Michel Marcus, Sep 16 2019

Formula

a(n) = 1 for n = A000043(k) - 1, the Mersenne exponents minus 1. - T. D. Noe, Mar 23 2011

A187467 Least k > 1 such that prime(k)*2^n - 1 is prime, or zero if never prime.

Original entry on oeis.org

2, 2, 2, 2, 4, 2, 2, 3, 4, 3, 2, 3, 11, 3, 22, 7, 4, 2, 18, 7, 4, 23, 6, 23, 18, 5, 44, 23, 4, 98, 14, 3, 11, 2, 11, 7, 11, 2, 18, 28, 8, 16, 2, 102, 4, 9, 11, 3, 8, 5, 174, 24, 63, 3, 2, 103, 22, 23, 130, 7, 22, 16, 18, 2
Offset: 1

Views

Author

Pierre CAMI, Mar 10 2011

Keywords

Comments

As N increases, it appears that (Sum_{i=1..N} a(i)) / (Sum_{i=1..N} i) tends to 1/2, i.e., the partial sums grow roughly proportional to the triangular numbers.
It is conjectured that a(42228) is the first 0 term. This corresponds to the first Riesel number, 509203, which happens to be prime. See A101036. - T. D. Noe, Mar 23 2011

Crossrefs

Programs

  • Maple
    A187467 := proc(n) local k; for k from 2 do if isprime( ithprime(k)*2^n-1) then return k; end if; end do: end proc: # R. J. Mathar, Mar 19 2011

Formula

a(n) = primepi(A126715(n)). - T. D. Noe, Mar 10 2011
a(n) >= A179289(n). - R. J. Mathar, Mar 19 2011
Showing 1-5 of 5 results.