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.
%I A129786 #26 Jul 06 2025 14:57:08 %S A129786 0,1,1,1,1,15,13,51,297,75,643,981,1761,897,2775,118113,44061,5851, %T A129786 18531,189093,69661 %N A129786 Least k such that 2^(2^n)+k is prime. %C A129786 It is conjectured that a(n)>=3 for n>=5. %C A129786 For n>11, 2^(2^n)+a(n) is a probable prime. By a comment in A000215, a(n) is not 2^m+1 for any m > 1. - _T. D. Noe_, Jul 19 2007 %H A129786 C. K. Caldwell, The Prime Glossary, <a href="https://t5k.org/glossary/page.php?sort=Fermats">Fermat prime</a>. %H A129786 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/FermatNumber.html">Fermat Number</a>. %H A129786 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/FermatPrime.html">Fermat Prime</a>. %t A129786 a[n_] := Module[{k = 0}, While[! PrimeQ[2^(2^n) + k], k++]; k]; Array[a, 12, 0] (* _Amiram Eldar_, Jun 11 2022 *) %o A129786 (PARI) a(n)=if(n<0,0,s=0;while(isprime(2^(2^n)+s)==0,s++);s) %o A129786 (Python) %o A129786 from sympy import nextprime %o A129786 def a(n): m = 2**(2**n); return nextprime(m-1) - m %o A129786 print([a(n) for n in range(12)]) # _Michael S. Branicky_, Jun 12 2022 %Y A129786 Cf. A000215, A019434. %Y A129786 Cf. A013597 (least k>0 such that 2^n+k is prime). %K A129786 nonn,more %O A129786 0,6 %A A129786 _Benoit Cloitre_, May 18 2007 %E A129786 More terms from _T. D. Noe_, Jul 19 2007 %E A129786 a(18)-a(19) by Makoto Morimoto, added by _Boyan Hu_, Jul 05 2025 %E A129786 a(20) by _Boyan Hu_, Jul 05 2025