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.

A264098 Smallest odd number k divisible by 3 such that k*2^n + 1 is prime.

Original entry on oeis.org

3, 3, 9, 15, 3, 3, 9, 3, 15, 15, 9, 3, 33, 9, 81, 21, 9, 3, 27, 27, 33, 27, 45, 45, 33, 27, 15, 33, 45, 3, 39, 81, 9, 75, 81, 3, 15, 15, 81, 27, 3, 9, 9, 15, 189, 27, 27, 15, 105, 27, 75, 93, 51, 177, 57, 27, 75, 99, 27, 45, 105, 105, 9, 27, 9, 3, 9, 237
Offset: 1

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 approach 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 is 1/(n*log(2)+log(k))/2 for k multiple of 3 so ~ 1/(2*n*log(2)) as n increases, if k ~ 2*n*log(2) then k/(2*n*log(2)) ~ 1.

Examples

			3*2^1 + 1 = 7 is prime so a(1) = 3.
3*2^2 + 1 = 13 is prime so a(2) = 3.
3*2^3 + 1 = 25 is composite; 9*2^3 + 1 = 73 is prime so a(3) = 9.
		

Crossrefs

Programs

  • Maple
    for n from 1 to 100 do
      for k from 3 by 6 do
        if isprime(k*2^n+1) then
          A[n]:= k; break
       fi
     od
    od:
    seq(A[n],n=1..100); # Robert Israel, Jan 22 2016
  • Mathematica
    Table[k = 3; While[! PrimeQ[k 2^n + 1], k += 6]; k, {n, 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