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.

A152414 a(n) = least positive k such that k*2^n*(2^n-1) - 1 or k*2^n*(2^n-1) + 1 is prime.

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 3, 6, 1, 1, 4, 2, 5, 3, 9, 8, 4, 1, 3, 4, 36, 5, 2, 4, 10, 4, 18, 3, 21, 9, 6, 1, 6, 8, 12, 2, 51, 1, 2, 2, 21, 6, 6, 12, 1, 5, 5, 3, 10, 1, 11, 53, 9, 4, 3, 2, 1, 5, 12, 10, 9, 8, 5, 9, 7, 6, 62, 29, 16, 51, 12, 3, 30, 56, 2, 23, 70, 3, 23
Offset: 1

Views

Author

Pierre CAMI, Dec 03 2008

Keywords

Comments

All values in the b-file are verified and primes certified using PFGW from Primeform group.

Examples

			For n = 1, 1*2^1*(2^1-1)+1 = 3 is prime, so a(1) = 1.
For n = 2, 1*2^2*(2^2-1)-1 = 11 is prime, as well as 1*2^2*(2^2-1)+1 = 13, so a(2) = 1.
For n = 3, k = 2 is the least k satisfying the condition: 2*2^3*(2^3-1)+1 = 113 is prime, so a(3) = 2.
		

Crossrefs

Cf. A153091.

Programs

  • Mathematica
    A152414[n_] := Module[{k = 0}, While[NoneTrue[++k*# + {-1, 1}, PrimeQ]] & [4^n-2^n]; k];
    Array[A152414, 100] (* Paolo Xausa, Jun 30 2025 *)
  • PARI
    a(n) = {k = 1; while (! (isprime(k*2^n*(2^n-1)+1) || isprime(k*2^n*(2^n-1)-1)), k++); return (k);} \\ Michel Marcus, Mar 07 2013

Formula

From Pierre CAMI, Dec 04 2008: (Start)
Lim_{n->oo} ( (Sum_{i=1..n} a(i)) / (n*(n+1)/2) ) = 1/4.
Lim_{n->oo} ( (Sum_{i=1..n} a(2*i)) / (n*(n+1)) ) = log(2)/4.
Lim_{n->oo} ( (Sum_{i=0..n} a(2*i+1)) / (n*(n+2)) ) = 1/2 - log(2)/4. (End)