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.

A246005 Least k such that ((2n+1)^k-1)/2n is prime, or 0 if no such k exists.

Original entry on oeis.org

3, 3, 5, 0, 17, 5, 3, 3, 19, 3, 5, 0, 3, 5, 7, 3, 313, 13, 349, 3, 5, 19, 127, 0, 4229, 11, 17, 3, 3, 7, 5, 19, 19, 3, 3, 5, 3, 3, 5, 0, 5, 5, 7, 3, 4421, 7, 7, 17, 3, 3, 19, 3, 17, 17, 3, 23, 7, 3, 3, 0, 43, 0, 5, 5, 3, 13, 1171, 11, 163, 3, 3, 5, 3, 7, 13, 3, 3, 17, 13, 3, 7, 5, 3, 0, 181, 3, 5, 5, 19, 17, 223
Offset: 1

Views

Author

Eric Chen, Nov 13 2014

Keywords

Comments

a(92) > 10000, a(93)..a(133) = {37, 3, 17, 5, 11, 31, 577, 271, 3, 19, 13, 3, 41, 137, 3, 281, 13, 7, 239, 0, 5, 11, 3, 113, 7, 7, 5, 17, 0, 3, 17, 5, 7, 19, 5, 23, 2011, 31, 5, 5, 13}, a(134) > 10000, a(135)..a(139) = {41, 37, 5, 5, 3}, a(140) > 10000, a(141)..a(150) = {29, 5, 3, 0, 13, 3, 17, 17, 113, 193}.

Examples

			a(23) = 127 because 2 * 23 + 1 = 47, (47^k-1)/46 is composite for k = 2, 3, ..., 126 and prime for k = 127.
		

Crossrefs

Programs

  • PARI
    a(n) = {l=List([4, 12, 24, 40, 60, 62, 84]); for(q=1, 91, if(n==l[q], return(0))); k=1; while(k, s=((2*n+1)^prime(k)-1)/(2*n); if(ispseudoprime(s), return(prime(k))); k++)} \\ Eric Chen, Nov 14 2014

Formula

a(n) = A084740(2n+1).