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

A084714 a(n) = smallest prime of the form (2n-1)^k - 2, or 0 if no such number exists.

Original entry on oeis.org

0, 7, 3, 5, 7, 14639, 11, 13, 24137567, 17, 19, 480250763996501976790165756943039, 23, 727, 839, 29, 31, 1223, 1367, 37, 2825759, 41, 43, 2207, 47, 45767944570399, 7890479, 53, 1176246293903439667999, 12117359, 59, 61, 318644812890623
Offset: 1

Views

Author

Amarnath Murthy, Jun 10 2003

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[ !PrimeQ[(2*n - 1)^k - 2], k++ ]; (2*n - 1)^k - 2]; Table[ f[n], {n, 2, 34}]

Extensions

Edited, corrected and extended by Robert G. Wilson v, Jun 11 2003

A079706 Smallest positive exponent k such that (2n)^k+1 is prime, or -1 if no such k exists.

Original entry on oeis.org

1, 1, 1, -1, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, -1, 4, 1
Offset: 1

Views

Author

Jon Perry, Jan 31 2003

Keywords

Comments

All nonzero a(n) are equal to powers of 2. a((p-1)/2) = 1 for prime p>2. - Alexander Adamchuk, Sep 17 2006
Further comments from Alexander Adamchuk, Oct 01 2006: (Start)
a(19) is unknown.
a(20)-a(24) = {1,1,16,1,4}.
a(26)-a(30) = {1,2,2,1,1}.
a(32) = -1.
a(33) = 1.
a(35)-a(42) = {1,1,2,16,1,4,1,2}.
a(44)-a(45) = {1,2}.
a(47)-a(48) = {2,1}.
a(50)-a(51) = {1,1}.
a(53)-a(60) = {1,1,2,1,32,2,4,2}.
a(62)-a(63) = {2,1}.
a(64) = -1.
a(65)-a(71) = {1,4,2,1,1,4,4}.
a(73)-a(83) = {2,1,1,8,4,1,16,2,1,4,1}.
a(85)-a(90) = {2,1,4,2,1,1}.
a(92) = 2.
a(94)-a(99) = {16,1,1,4,1,1}.
a(102)-a(105) = {2,2,8,1}.
a(n) is unknown for n = {19,25,31,34,43,46,49,52,61,72,84,91,93,100,101,...}.
Corresponding smallest primes of the form (2n)^k +1 are listed in A084712[n] = {3,5,7,0,11,13,197,17,19,401,23,577,677,29,31,0,1336337,37,...} Smallest prime of the form (2n)^k +1, or 0 if no such number exists.
The first occurrence of a(k) = 2^n is k = {1,7,17,76,22,57,137,117,307,...} = A122528[n] Minimum number k such that (2k)^(2^n) + 1 is prime, or A079706[A122528(n)] = 2^n.
Corresponding primes A084712[A122528(n)] = {3,197,1336337,284936905588473857,197352587024076973231046657,...}. (End)
The terms a(32) and a(64) are known to be -1 because 2^(6k)+1 and 2^(7k)+1 are divisible by 4^k+1 and 2^k+1, respectively, for all k >0. Also, a(45)=2 because 8101 is prime. - T. D. Noe, May 13 2008
a(19) >= 2^20 or a(19) = -1. - Robert Price, Mar 02 2015
From Robert G. Wilson v, Aug 30 2016: (Start)
n = 1: 1, 2, 3, 5, 6, 8, 9, 11, 14, 15, 18, 20, 21, 23, 26, 29, 30, 33, 35, 36, 39, 41, 44, 48, 50, 51, 53, 54, 56, 63, 65, 68, 69, 74, 75, 78, 81, 83, 86, 89, 90, 95, 96, 98, 99, 105, 111, 113, 114, 116, 119, 120, 125, 128, 131, 134, ..., ;
n = 2: 7, 10, 12, 13, 27, 28, 37, 42, 45, 47, 55, 58, 60, 62, 67, 73, 80, 85, 88, 92, 102, 103, 112, 115, 118, 130, 132, 142, 150, 157, 163, 170, 175, 192, 193, 203, 218, 220, 222, 232, 235, 237, 248, 268, 272, 292, 297, 317, 318, 322, ..., ;
n = 4: 17, 24, 40, 59, 66, 70, 71, 77, 82, 87, 97, 110, 121, 124, 127, 133, 136, 139, 144, 148, 160, 164, 167, 182, 187, 207, 236, 238, 244, 246, 247, 252, 258, 263, 275, 277, 283, 291, 312, 314, 328, 351, 355, 365, 374, 379, 389, 394, ..., ;
n = 8: 76, 104, 145, 196, 213, 217, 255, 271, 298, 305, 332, 391, 433, 442, 446, 458, 467, 478, 511, 514, 560, 612, 616, 628, 642, 655, 695, 801, 814, 841, 934, 968, 1039, 1045, 1050, 1097, 1137, 1141, 1164, 1181, 1189, 1240, 1245, ..., ;
n = 16: 22, 38, 79, 94, 159, 185, 226, 280, 344, 368, 387, 388, 395, 415, 416, 417, 423, 450, 486, 492, 522, 539, 607, 706, 764, 867, 906, 917, 928, 945, 992, 1036, 1078, 1104, 1109, 1115, 1142, 1159, 1176, 1224, 1231, 1281, 1456, 1631, ..., ;
n = 32: 57, 166, 171, 180, 188, 214, 294, 402, 425, 599, 839, 857, 909, 980, 1059, 1209, 1217, 1334, 1387, 1393, 1422, 1434, 1521, 1522, 1599, 1744, 1748, 1757, 1904, 2217, 2245, 2250, 2266, 2458, 2467, 2532, 541, 2579, 2606, 2610, ..., ;
n = 64: 137, 206, 364, 542, 815, 902, 1082, 1247, 1262, 1307, 1392, 1512, 1639, 1814, 1847, 1875, 2015, 2029, 2083, 2162, 2359, 2607, 2859, 2947, 3218, 3346, 3421, 3456, 3481, 3542, 3566, 4065, 4261, 4416, 4494, 4496, 4570, 4720, ..., ;
n = 128: 117, 253, 266, 274, 1738, 2894, 3040, 3375, 3846, 4853, 5119, 5497, 5716, 5777, 6850, 7007, 7144, 7783, 8485, 8980, 96965, ..., ;
n = 256: 307, 449, 674, 787, 969, 1061, 1139, 1381, 1717, 2047, 2102, 2856, 2872, 4322, 4381, 4404, 4571, 5446, 6103, 6610, 6611, 6685, 6869, 7057, 7963, 8128, 8358, 9671, ..., ;
n = 512: 671, 1577, 1939, 2232, 2344, 2687, 2849, 2885, 3193, 3341, 3694, 4339, 4396, 5734, 6377, 6599, 6888, 7367, 8413, 9457, ..., ;
n = 1024: 412, 738, 816, 1242, 1532, 3320, 4535, 6274, 6497, 8823, 9168, 9782, ..., ;
n = 2048: 1279, 6618, 7524,..., ;
n = 4098: 767, 8791, 9112,..., ;
n = 8192: 35926,..., ;
n = 16384: 50915,..., ;
n = 32768: 35453,..., ;
n = 65536: 24297,..., ; etc.
(End)

Examples

			14+1=15, however 14^2+1=197 is prime, hence a(7)=2.
		

Crossrefs

Programs

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

Extensions

More terms from Alexander Adamchuk, Sep 17 2006

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