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

A084712 Smallest prime of the form (2n)^k + 1, or 0 if no such number exists.

Original entry on oeis.org

3, 5, 7, 0, 11, 13, 197, 17, 19, 401, 23, 577, 677, 29, 31, 0, 1336337, 37
Offset: 1

Views

Author

Amarnath Murthy, Jun 10 2003

Keywords

Comments

It has not been proved that a(19), a(25), a(31), a(34), a(43) and a(46) are 0; if these values do exist, they have > 4000 digits. The other zeros are definite. - David Wasserman, Jan 03 2005
a((p-1)/2) = p for primes p > 2, or a(n) = 2n+1 for n = (p-1)/2. All other positive a(n) belong to A002496 = primes of form m^2 + 1. Corresponding positive exponents k are powers of 2. They are listed in A079706. - Alexander Adamchuk, Sep 17 2006
Because k must be a power of 2, numbers of the form (2n)^k+1 are called generalized Fermat numbers with base 2n. These numbers, like the regular Fermat numbers, are seldom prime. I checked n=19, 25, 31, 34, 43, 46 with k up to 2^16 without finding any primes. - T. D. Noe, May 13 2008
Comments from N. J. A. Sloane, Jan 27 2024: (Start)
As pointed out by Max Alekseyev, the previous version violated the OEIS rules, since a(19) has not been confirmed. I therefore removed the terms starting at a(19).
The previous DATA line read:
3, 5, 7, 0, 11, 13, 197, 17, 19, 401, 23, 577, 677, 29, 31, 0, 1336337, 37, 0, 41, 43, 197352587024076973231046657, 47, 5308417, 0, 53, 2917, 3137, 59, 61, 0, 0, 67, 0, 71, 73, 5477, 1238846438084943599707227160577, 79, 40960001, 83, 7057, 0, 89
The old b-file has been changed to an a-file.
(End)

Examples

			a(7) = 197 = 14^2 + 1 as 14 + 1 = 15 is not a prime.
		

Crossrefs

Programs

  • Mathematica
    Table[k=1; While[p=1+(2n)^k; k<1024 && !PrimeQ[p], k=2k]; If[k==1024, 0, p], {n,44}] (* T. D. Noe, May 13 2008 *)

Extensions

More terms from David Wasserman, Jan 03 2005
Edited by N. J. A. Sloane, Jan 27 2024 at the suggestion of Max Alekseyev

A255707 Least number k > 0 such that (2*n-1)^k - 2 is prime, or 0 if no such number exists.

Original entry on oeis.org

0, 2, 1, 1, 1, 4, 1, 1, 6, 1, 1, 24, 1, 2, 2, 1, 1, 2, 2, 1, 4, 1, 1, 2, 1, 8, 4, 1, 12, 4, 1, 1, 8, 3, 1, 2, 1, 1, 2, 38, 1, 4, 1, 4, 2, 1, 2, 4, 747, 1, 4, 1, 1, 2, 1, 1, 10, 1, 2, 2, 2, 6, 42, 2, 1, 2, 1, 2, 10, 1, 1, 4, 2, 16, 50, 1, 1, 2, 22, 1, 2, 38
Offset: 1

Views

Author

Robert Price, Mar 02 2015

Keywords

Crossrefs

Programs

  • Mathematica
    lst = {0}; For[n = 2, n ≤ 143, n++, For[k = 1, k >= 1, k++, If[PrimeQ[(2*n - 1)^k - 2], AppendTo[lst, k]; Break[]]]]; lst
  • PARI
    a(n)=if(n==1,return(0));k=1;while(k,if(ispseudoprime((2*n-1)^k-2),return(k));k++)
    vector(50,n,a(n)) \\ Derek Orr, Mar 03 2015

Formula

a(A098090(n)) = 1. - Michel Marcus, Mar 03 2015

A250200 Least number k>1 such that (2n-1)^k - 2 is prime, or 0 if no such number exists.

Original entry on oeis.org

0, 2, 2, 2, 2, 4, 2, 2, 6, 2, 2, 24, 7, 2, 2, 3, 2, 2, 2, 4, 4, 2, 11, 2, 2, 8, 4, 2, 12, 4, 2, 2, 8, 3, 2, 2, 4, 2, 2, 38, 130, 4, 4, 4, 2, 3, 2, 4, 747, 3, 4, 2, 10, 2, 3, 17, 10, 13, 2, 2, 2, 6, 42, 2, 3, 2, 6, 2, 10, 2, 4, 4, 2, 16, 50, 3, 9, 2, 22, 25
Offset: 1

Views

Author

Robert Price, Mar 02 2015

Keywords

Crossrefs

Programs

  • Mathematica
    lst = {0}; For[n = 2, n ≤ 143, n++, For[k = 2, k >= 1, k++, If[PrimeQ[(2*n - 1)^k - 2], AppendTo[lst, k]; Break[]]]]; lst
    lnk[n_]:=Module[{k=2,c=2n-1},While[!PrimeQ[c^k-2],k++];k]; Join[{0}, Array[ lnk,80,2]] (* Harvey P. Dale, Jul 24 2017 *)

A228101 a(n) is the least k such that (2n)^(2^k) + 1 is a prime; a(n) = -1 if a prime (2n)^(2^k) + 1 is unknown, or = -2 if impossible.

Original entry on oeis.org

0, 0, 0, -2, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, -2, 2, 0, -1, 0, 0, 4, 0, 2, -1, 0, 1, 1, 0, 0, -1, -2, 0, -1, 0, 0, 1, 4, 0, 2, 0, 1, -1, 0, 1, -1, 1, 0, -1, 0, 0, -1, 0, 0, 1, 0, 5, 1, 2, 1, -1, 1, 0, -2, 0, 2, 1, 0, 0, 2, 2, -1, 1, 0, 0, 3, 2, 0, 4, 1, 0, 2, 0
Offset: 1

Views

Author

Yves Gallot (galloty(AT)wanadoo.fr) and Robert G. Wilson v, Aug 14 2013

Keywords

Comments

A prime number of the form b^(2^k) + 1 is called a generalized Fermat prime to base b.
See the hyperlink for more information and links.
The impossibility case, a(n) = -2, occurs exactly if 2n is a member of A070265. Or equivalently, n is in A126032. - Jeppe Stig Nielsen, Jul 02 2017

Crossrefs

Programs

  • Mathematica
    f[b_?EvenQ] := f[b] = Block[{k = 0}, While[! PrimeQ[b^(2^k) + 1], k++]; k];
    lst = {38, 50, 62, 68, 86, 92, 98, 104, 122, 144, 168, 182, 186, 200, 202, 212, 214, 218, 244, 246, 252, 258, 286, 294, 298, 302, 304, 308, 322, 324, 338, 344, 354, 356, 362, 368, 380, 390, 394, 398, 402, 404, 410, 416, 422, 424, 446, 450, 454, 458, 468, 480, 482, 484, 500, 514, 518, 524, 528, 530, 534, 538, 552, 558, 564, 572, 574, 578, 580, 590, 602, 604, 608, 620, 622, 626, 632, 638, 648, 650, 662, 666, 668, 670, 678, 684, 692, 694, 698, 706, 712, 720, 722, 724, 734, 744, 746, 752, 754, 762, 766, 770, 792, 794, 802, 806, 812, 814, 818, 836, 840, 842, 844, 848, 854, 868, 870, 872, 878, 888, 896, 902, 904, 908, 922, 924, 926, 932, 938, 942, 944, 948, 954, 958, 964, 968, 974, 978, 980, 988, 994, 998}; (f[#] = -1) & /@ lst;
    lst = {8, 32, 64, 128, 216, 512, 1000}; (f[#] = -2) & /@ lst; Table[ f[b], {b, 2, 1000, 2}]
    (* Second program: *)
    Module[{r = 83, nn = 12, s = {}, k}, Do[If[b > r, Break[], Do[If[Set[k, b^m/2] > r, Break[], AppendTo[s, k]], {m, 3, Infinity, 2}]], {b, 2, Infinity, 2}]; Table[If[MemberQ[s, n], -2, SelectFirst[Range[0, nn], PrimeQ[(2 n)^(2^#) + 1] &] /. x_ /; MissingQ@ x -> -1], {n, r}]] (* Michael De Vlieger, Jul 04 2017, Version 10.2 *)

Extensions

Definition rewritten by Jeppe Stig Nielsen, Jul 02 2017

A122528 Minimal number k such that (2k)^(2^n) + 1 is prime, but (2k)^(2^m) + 1 is composite for m < n.

Original entry on oeis.org

1, 7, 17, 76, 22, 57, 137, 117, 307, 671, 412, 1279, 767, 35926, 50915, 35453, 24297, 114094, 12259, 37949, 459722
Offset: 0

Views

Author

Alexander Adamchuk, Sep 17 2006

Keywords

Comments

A079706(a(n)) = 2^n which is the first occurrence of 2^n in A079706.
Corresponding primes A084712(a(n)) are {3, 197, 1336337, 284936905588473857, 197352587024076973231046657, ...}.

Examples

			a(0) = 1 because (2*1)^(2^0) + 1 = 2 + 1 = 3 is prime.
a(1) = 7 because (2*7)^(2^1) + 1 = 14^2 + 1 = 197 is prime but 14 + 1 = 15 is composite.
		

Crossrefs

Programs

  • PARI
    a(n)=for(k=1,+oo,if(ispseudoprime((2*k)^(2^n)+1),for(m=0,n-1,ispseudoprime((2*k)^(2^m)+1)&&next(2));return(k))) \\ Jeppe Stig Nielsen, Mar 10 2018

Extensions

Definition corrected by T. D. Noe, May 14 2008
a(9) through a(16) from the extensive tables of generalized Fermat primes compiled by Yves Gallot and others. - T. D. Noe, May 14 2008
a(17)-a(20) from Jeppe Stig Nielsen, Mar 10 2018

A253242 Least k>=0 such that n^(2^k)+1 is prime (for even n), or (n^(2^k)+1)/2 is prime (for odd n); -1 if no such k exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, -1, 0, 0, 1, 0, 0, 1, 1, 0, 2, 0, 1, 1, 0, 0, 2, 1, 0, 1, -1, 0, 1, 0
Offset: 2

Views

Author

Eric Chen, Apr 19 2015

Keywords

Comments

Least k such that the generalized Fermat number in base n (GFN(k,n)) is prime.
a(n) = -1 if n is in A070265 (perfect powers with an odd exponent).
a(n) is currently unknown for n = {31, 38, 50, 55, 62, 63, 67, 68, 77, 83, 86, 89, 91, 92, 97, 98, 99, 104, 107, 109, 122, 123, 127, 135, 137, ...}
Corresponding primes are {3, 2, 5, 3, 7, 1201, 0, 5, 11, 61, 13, 7, 197, 113, 17, 41761, 19, 181, 401, 11, 23, 139921, 577, 13, 677, 0, 29, 421, 31, ...}. (use 0 if a(n) = -1)
All 2 <= n <= 1500 and 0 <= k <= 14 are checked, the first occurrence of k (start with k = 0) in a(n) are {2, 11, 7, 43, 41, 75, 274, 234, 331, 1342, 824, ...}.

Examples

			a(7) = 2 since (7^(2^0)+1)/2 and (7^(2^1)+1)/2 are not primes, but (7^(2^2)+1)/2 = 1201 is prime.
a(14) = 1 since 14^(2^0)+1 is not prime, but 14^(2^1)+1 = 197 is prime.
		

Crossrefs

Programs

  • Mathematica
    Table[k=0; While[p=If[EvenQ[n], (2n)^(2^k)+1, ((2n)^(2^k)+1)/2]; k<12 && !PrimeQ[p], k=k+1]; If[k==12, -1, k], {n, 2, 1500}]
  • PARI
    f(n) = for(k=0, 11, if(ispseudoprime(n^(2^k)+1), return(k))); -1
    g(n) = for(k=0, 11, if(ispseudoprime((n^(2^k)+1)/2), return(k))); -1
    a(n) = if(n%2==0, f(n), g(n))
    
  • PARI
    f(n,k)=if(n%2, (n^(2^k)+1)/2, n^(2^k)+1)
    a(n)=if(ispower(-n), -1, my(k); while(!ispseudoprime(f(n,k)), k++); k) \\ Charles R Greathouse IV, Apr 20 2015

Formula

a(2n) = A228101(n) = log_2(A079706(n)).
a(A006093(n)) = 0, a(A076274(n)) = 0, a(A070265(n)) = -1.
Showing 1-6 of 6 results.