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-10 of 12 results. Next

A135053 Greatest integer M(i)=n such that A085427(n)=A085427(n-1)/2 and k(i+1)>k(i) with A085427(n)=least k such that k*2^n-1 is prime ( Mersenne prime when k=1).

Original entry on oeis.org

2, 21, 23, 80, 96, 111, 168, 230, 281, 347, 558, 704
Offset: 1

Views

Author

Pierre CAMI, Nov 15 2007

Keywords

Examples

			A085427 =3,2,1,1,2,1,2,1,5,7,5,3,2,1,5,4,2,1,2,1,14,7,26,13,39,22
A(2)=1,A(1)=2 so A(2)=A(1)/2 so M(1)=1
A(5)=1,A(4)=2 but A(5)=A(2) ..........
A(21)=7,A(20)=14 A(21)=A(20)/2 and A(21)>A(2) so M(2)=21
		

Crossrefs

A135054 Greatest integer K(i)=A085427(n) such that A085427(n)=A085427(n-1)/2 and K(i+1)>K(i) with A085427(n)=least k such that k*2^n-1 is prime ( Mersenne prime when k=1).

Original entry on oeis.org

1, 7, 13, 15, 17, 75, 102, 173, 181, 229, 513, 539
Offset: 1

Views

Author

Pierre CAMI, Nov 15 2007

Keywords

Examples

			A085427 =3,2,1,1,2,1,2,1,5,7,5,3,2,1,5,4,2,1,2,1,14,7,26,13,39,22
A(2)=1,A(1)=2 so A(2)=A(1)/2 so K(1)=1
A(5)=1,A(4)=2 but A(5)=A(2) ..........
A(21)=7,A(20)=14 A(21)=A(20)/2 and A(21)>A(2) so K(2)=7
		

Crossrefs

A035050 a(n) is the smallest k such that k*2^n + 1 is prime.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 3, 2, 1, 15, 12, 6, 3, 5, 4, 2, 1, 6, 3, 11, 7, 11, 25, 20, 10, 5, 7, 15, 12, 6, 3, 35, 18, 9, 12, 6, 3, 15, 10, 5, 6, 3, 9, 9, 15, 35, 19, 27, 15, 14, 7, 14, 7, 20, 10, 5, 27, 29, 54, 27, 31, 36, 18, 9, 12, 6, 3, 9, 31, 23, 39, 39, 40, 20, 10, 5, 58, 29, 15, 36, 18, 9, 13
Offset: 0

Views

Author

Keywords

Comments

From Ulrich Krug (leuchtfeuer37(AT)gmx.de), Jun 05 2010: (Start)
If a(i) = 2 * m then a(i+1) = m.
Proof: (I) a(i) = 2*m, 2*m * 2^i + 1 = m*2^(i+1) + 1 prime, so a(i+1) <= m;
(II) if a(i+1) = m-d for an integer d > 0, (m-d) * 2^(i+1) + 1 = (2*m-2*d) * 2^i + 1 prime;
(2m-2d) < 2m contradiction to a(i) = 2 * m, d = 0.
(End)
Conjecture: for n > 0, a(n) = k < 2^n, so k*2^n + 1 is a Proth prime A080076. - Thomas Ordowski, Apr 13 2019

Examples

			a(3)=2 because 1*2^3 + 1 = 9 is composite, 2*2^3 + 1 = 17 is prime.
a(99)=219 because 2^99k + 1 is not prime for k=1,2,...,218. The first term which is not a composite number of this arithmetic progression is 2^99*219 + 1.
		

Crossrefs

Analogous case is A034693. Special subscripts (n's for a(n)=1) are the exponents of known Fermat primes: A000215. See also Fermat numbers A000051.

Programs

  • Magma
    sol:=[];m:=1; for n in [0..82] do k:=0; while not IsPrime(k*2^n+1) do k:=k+1; end while; sol[m]:=k; m:=m+1; end for; sol; // Marius A. Burtea, Jun 05 2019
  • Mathematica
    a = {}; Do[k = 0; While[ ! PrimeQ[k 2^n + 1], k++ ]; AppendTo[a, k], {n, 0, 100}]; a (* Artur Jasinski *)
    Table[Module[{k=1,n2=2^n},While[!PrimeQ[k*n2+1],k++];k],{n,0,90}] (* Harvey P. Dale, May 25 2024 *)
  • PARI
    a(n) = {my(k = 1); while (! isprime(2^n*k+1), k++); k;}
    

Formula

a(n) << 19^n by Xylouris' improvement to Linnik's theorem. - Charles R Greathouse IV, Dec 10 2013

A057778 a(n) is the least odd k such that k*2^n + 1 is prime.

Original entry on oeis.org

1, 1, 1, 5, 1, 3, 3, 5, 1, 15, 13, 9, 3, 5, 7, 5, 1, 9, 3, 11, 7, 11, 25, 45, 45, 5, 7, 15, 13, 23, 3, 35, 43, 9, 75, 59, 3, 15, 15, 5, 27, 3, 9, 9, 15, 35, 19, 27, 15, 23, 7, 17, 7, 51, 49, 5, 27, 29, 99, 27, 31, 53, 105, 9, 25, 9, 3, 9, 31, 23, 39, 39, 127, 23, 67, 5, 93, 29, 15, 249
Offset: 0

Views

Author

Labos Elemer, Nov 02 2000

Keywords

Comments

There are no SierpiƄski numbers in the sequence. See A076336. - Thomas Ordowski, Aug 13 2017
Conjecture: for n > 0, a(n) = k < 2^n, so k*2^n + 1 is a Proth prime A080076. - Thomas Ordowski, Apr 13 2019

Examples

			For n = 10, the first primes in the 1024k + 1 arithmetic progression occur at k = 12, 13, 15, 18, 19, ...; 13 is the first odd number, so a(10)=13, while A035050(10)=12. The corresponding primes are 12289 and 13313.
For n = 79, the first primes in the (2^79)k + 1 = 604462909807314587353088k + 1 progression occur at k = 36, 44, 104, 249, 296, 299, so a(79)=249, the first odd number, while A035050(79)=36. The two primes arising are 21760664753063325144711169 and 150511264542021332250918913, respectively.
		

Crossrefs

Terms are not necessarily in A035050.

Programs

  • Mathematica
    Table[k = 1; While[! PrimeQ[k 2^n + 1], k += 2]; k, {n, 0, 80}] (* Michael De Vlieger, Jul 04 2016 *)
  • PARI
    a(n) = k=1; while(!isprime(k*2^n+1), k+=2); k; \\ Michel Marcus, Dec 10 2013

Formula

a(n) = Min{k: 1+2^n*k is prime and k is odd}.
a(n) << 19^n by Xylouris's improvement to Linnik's theorem. - Charles R Greathouse IV, Dec 10 2013
Conjecture: a(n) = O(n*log(n)). - Thomas Ordowski, Oct 16 2014

A127587 Smallest nonnegative integer k such that (k+1)*2^n-1 is prime.

Original entry on oeis.org

2, 1, 0, 0, 1, 0, 1, 0, 4, 6, 4, 2, 1, 0, 4, 3, 1, 0, 1, 0, 13, 6, 25, 12, 38, 21, 10, 15, 7, 3, 1, 0, 4, 5, 2, 23, 11, 5, 2, 24, 23, 11, 5, 2, 13, 6, 19, 9, 4, 18, 10, 20, 19, 9, 4, 2, 31, 15, 7, 3, 1, 0, 11, 5, 2, 66, 62, 42, 62, 39, 19, 9, 4, 14, 11, 5, 2, 54, 46, 29, 14, 29, 14, 63, 31, 15, 7
Offset: 0

Views

Author

Artur Jasinski, Jan 19 2007

Keywords

Comments

The associated prime number list is (k+1)*2^n-1 = 2,3,3,7,31,31,127,127,1279,3583,5119,6143,... for n=0,1,2,3,4,... - R. J. Mathar, Jan 22 2007

Crossrefs

Programs

  • Maple
    A127587 := proc(n) local k; k:=0 ; while true do if isprime( (k+1)*2^n-1) then RETURN(k) ; fi ; k := k+1 ; od ; end: for n from 0 to 100 do printf("%d, ",A127587(n)) ; od ; # R. J. Mathar, Jan 22 2007
  • Mathematica
    a = {}; Do[k = 0; While[ ! PrimeQ[k 2^n + 2^n - 1], k++ ]; AppendTo[a, k], {n, 0, 50}]; a

Formula

a[A000043(j)]=0 for j=1,2,3,4,... - R. J. Mathar, Jan 22 2007
a(n) = A085427(n) - 1. - Filip Zaludek, Dec 16 2016

Extensions

More terms from R. J. Mathar, Jan 22 2007

A126717 Least odd k such that k*2^n-1 is prime.

Original entry on oeis.org

3, 3, 1, 1, 3, 1, 3, 1, 5, 7, 5, 3, 5, 1, 5, 9, 17, 1, 3, 1, 17, 7, 33, 13, 39, 57, 11, 21, 27, 7, 213, 1, 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, 1, 53, 9, 3, 67, 63, 43, 63, 51, 27, 73, 5, 15, 21, 25, 3, 55, 47, 69
Offset: 0

Views

Author

Bernardo Boncompagni, Feb 13 2007

Keywords

Comments

If a(n)=1 then n is a Mersenne exponent (A000043). - Pierre CAMI, Apr 22 2013
From Pierre CAMI, Apr 03 2017: (Start)
Empirically, as N increases, (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} n) tends to log(2); this is consistent with the prime number theorem as the probability that x*2^n - 1 is prime is ~ 1/(n*log(2)) if n is large enough.
For n=1 to 10000, a(n)/n < 7.5.
a(n)*2^n - 1 and a(n)*2^n + 1 are twin primes for n = 1, 2, 6, 18, 22, 63, 211, 282, 546, 726, 1032, 1156, 1321, 1553, 2821, 4901, 6634, 8335, 8529; corresponding values of a(n) are 3, 1, 3, 3, 33, 9, 9, 165, 297, 213, 177, 1035, 1065, 291, 6075, 2403, 2565, 4737, 3975, 459. (End)

Examples

			a(10)=5 because 5*2^10-1 is prime but 1*2^10-1 and 3*2^10-1 are not.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[ !PrimeQ[k*2^n - 1], k += 2]; k]; Table[f@n, {n, 0, 80}] (* Robert G. Wilson v, Feb 20 2007 *)
  • PARI
    a(n) = {my(k=1); while(!isprime(k*2^n - 1), k+=2); k}; \\ Indranil Ghosh, Apr 03 2017
    
  • Python
    from sympy import isprime
    def a(n):
        k=1
        while True:
            if isprime(k*2**n - 1): return k
            k+=2
    print([a(n) for n in range(101)]) # Indranil Ghosh, Apr 03 2017

Formula

a(n) << 19^n by Xylouris' improvement to Linnik's theorem. - Charles R Greathouse IV, Dec 10 2013
Conjecture: a(n) = O(n log n). - Thomas Ordowski, Oct 15 2014

Extensions

More terms from Robert G. Wilson v, Feb 20 2007

A176994 Least odd prime p such that p#*2^n-1 is prime, with p# the primorial A034386(p).

Original entry on oeis.org

3, 3, 3, 3, 5, 3, 3, 7, 7, 5, 3, 109, 17, 5, 13, 17, 5, 3, 17, 67, 11, 89, 13, 17, 7, 89, 31, 29, 19, 37, 5, 7, 29, 3, 79, 43, 41, 3, 11, 53, 5, 13, 3, 29, 11, 137, 179, 227, 11, 11, 97, 59, 53, 11, 3, 83, 17, 47, 19, 19, 29, 73, 41, 3, 7, 11, 79, 71, 13, 41, 257, 19, 5, 151, 79, 3, 31, 19, 79, 5, 281, 5, 37, 263, 139, 17, 23, 127, 223, 151, 149, 131, 113, 3, 47, 41, 59, 31, 23, 89
Offset: 0

Views

Author

Pierre CAMI, Dec 08 2010

Keywords

Crossrefs

Cf. A085427.

Programs

  • Mathematica
    Table[p=3; prod=6; While[! PrimeQ[prod*2^n-1], p=NextPrime[p]; prod=prod*p]; p, {n, 0, 100}]
  • Sage
    primorial = lambda n: prod(primes(n+1)) # includes n, if prime
    A176994 = lambda n: next(p for p in Primes() if p > 2 and is_pseudoprime(primorial(p)*2**n-1)) # D. S. McNeil, Dec 09 2010

A264097 Smallest odd number k divisible by 3 such that k*2^n-1 is a prime.

Original entry on oeis.org

3, 3, 3, 3, 3, 15, 3, 3, 27, 45, 15, 3, 87, 9, 15, 9, 45, 15, 3, 51, 57, 9, 33, 69, 39, 57, 57, 21, 27, 45, 213, 15, 57, 147, 3, 33, 45, 21, 3, 63, 117, 15, 33, 3, 57, 165, 33, 213, 117, 69, 87, 21, 183, 147, 45, 3, 33, 51, 111, 45, 93, 69, 57, 9, 3, 99, 63
Offset: 0

Views

Author

Pierre CAMI, Nov 03 2015

Keywords

Comments

As N increases, (Sum_{n=1..N} a(n))/(Sum_{n=1..N} n) appears to tend to 2*log(2), as can be seen by plotting the first 31000 terms.
This observation is consistent with the prime number theorem as the probability that k*2^n-1 is prime where k is a multiple of 3 is 1/(2*(n*log(2)+log(k))) ~ 1/(2*n*log(2)).

Examples

			3*2^0-1=2 prime so a(0)=3.
3*2^1-1=5 prime so a(1)=3.
3*2^2-1=11 prime so a(2)=3.
3*2^3-1=23 prime so a(3)=3.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 3; While[! PrimeQ[k 2^n - 1], k += 6]; k, {n, 0, 68}] (* Michael De Vlieger, Nov 03 2015 *)
  • PARI
    a(n) = {k = 3; while (!isprime(k*2^n-1), k += 6); k;} \\ Michel Marcus, Nov 03 2015

A266909 Table read by rows: for each k < n and coprime to n, the least x>=0 such that x*n+k is prime.

Original entry on oeis.org

1, 2, 0, 1, 0, 2, 0, 0, 3, 1, 0, 4, 0, 0, 1, 0, 1, 2, 0, 0, 0, 2, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 3, 0, 1, 0, 1, 2, 3, 1, 0, 0, 0, 4, 0, 0, 1, 0, 1, 0, 3, 4, 1, 0, 7, 2, 0, 0, 1, 0, 0, 2, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 2, 0, 0, 1, 6, 0, 0, 5, 0, 1, 0, 3, 2, 3, 0, 1, 0, 1, 4, 3, 1, 0, 0, 0, 0, 0, 10, 0
Offset: 1

Views

Author

Robert Israel, Jan 05 2016

Keywords

Comments

By Dirichlet's theorem, such x exists whenever k is coprime to n.
By Linnik's theorem, there exist constants b and c such that T(n,k) <= b n^c for all n and all k < n coprime to n.
T(n,1) = A034693(n).
T(n,n-1) = A053989(n)-1.
T(prime(n),1) = A035096(n).
T(2^n,1) = A035050(n).
A085427(n) = T(2^n,2^n-1) + 1.
A126717(n) = 2*T(2^(n+1),2^n-1) + 1.
A257378(n) = 2*T(n*2^(n+1),n*2^n+1) + 1.
A257379(n) = 2*T(n*2^(n+1),n*2^n-1) + 1.

Examples

			The first few rows are
n=2: 1
n=3: 2, 0
n=4: 1, 0
n=5: 2, 0, 0, 3
n=6: 1, 0
		

Crossrefs

Programs

  • Maple
    T:= proc(n,k) local x;
        if igcd(n,k) <> 1 then return NULL fi;
        for x from 0 do if isprime(x*n+k) then return x fi
        od
    end proc:
    seq(seq(T(n,k),k=1..n-1),n=2..30);
  • Mathematica
    Table[Map[Catch@ Do[x = 0; While[! PrimeQ[x n + #], x++]; Throw@ x, {10^3}] &, Range@ n /. k_ /; GCD[k, n] > 1 -> Nothing], {n, 2, 19}] // Flatten (* Michael De Vlieger, Jan 06 2016 *)

A074717 Least k such that floor(2^n/k) is prime.

Original entry on oeis.org

1, 2, 3, 3, 6, 9, 11, 11, 7, 9, 5, 10, 19, 11, 5, 10, 9, 11, 22, 35, 39, 9, 5, 10, 20, 27, 11, 19, 9, 18, 36, 25, 29, 27, 5, 10, 20, 40, 61, 13, 21, 42, 29, 27, 39, 9, 17, 29, 58, 49, 27, 25, 50, 11, 22, 44, 39, 11, 22, 44, 29, 58, 116, 53, 19, 38, 76, 152, 237, 139, 5, 10, 20
Offset: 1

Views

Author

Benoit Cloitre, Sep 04 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[! PrimeQ @ Floor[2^n/k], k++]; k]; Array[a, 100] (* Amiram Eldar, Aug 31 2020 *)
  • PARI
    a(n)=if(n<0,0,k=1; while(isprime(floor(2^n/k)) == 0,k++); k)

Formula

There is probably a constant c such that Sum_{i=1..n} a(i) is asymptotic to c*n^2 (0 < c < 1/2).
Showing 1-10 of 12 results. Next