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.

A332847 a(n) is the smallest k such that exactly one of k*2^(2^n) - 2*k + 1 and k*2^(2^n) + 2*k - 1 is a prime.

This page as a plain text file.
%I A332847 #27 Jun 16 2025 09:04:23
%S A332847 1,4,1,1,1,3,3,10,17,8,83,92,525,1888,20,6804,11390
%N A332847 a(n) is the smallest k such that exactly one of k*2^(2^n) - 2*k + 1 and k*2^(2^n) + 2*k - 1 is a prime.
%C A332847 Conjecture: a(n) > 1 for all n > 4.
%C A332847 a(n) = 1, n > 1, is equivalent to F(n) = 2^(2^n) + 1 being a Fermat prime, because the Mersenne number M(2^n) = 2^(2^n) - 1 is prime only for n = 1 (since divisible by 3 for all n >= 1), where F(1) is also prime. - The two considered numbers can also be written 2*k*A077585(n) + 1 resp. 2*k*A000051(A000225(n)) - 1. - _M. F. Hasler_, Mar 05 2020
%e A332847 a(0) = 1 because 1*2^(2^0) - 2*1 + 1 = 1 is a nonprime and 1*2^(2^0) + 2*1 - 1 = 3 is a prime.
%e A332847 a(1) = 4 because 4*2^(2^1) - 2*4 + 1 = 9 is a composite and 4*2^(2^1) + 2*4 - 1 = 23 is a prime.
%e A332847 a(2) = 1 because 1*2^(2^2) - 2*1 + 1 = 15 is a composite and 1*2^(2^2) + 2*1 - 1 = 17 is a prime.
%e A332847 a(3) = 1 because 1*2^(2^3) - 2*1 + 1 = 255 is a composite and 1*2^(2^3) + 2*1 - 1 = 257 is a prime.
%e A332847 a(4) = 1 because 1*2^(2^4) - 2*1 + 1 = 65535 is a composite and 1*2^(2^4) + 2*1 - 1 = 65537 is a prime.
%t A332847 Table[Module[{k=1},While[Total[Boole[PrimeQ[k*2^(2^n)+{2k-1,-2k+1}]]]!=1,k++];k],{n,0,14}] (* _Harvey P. Dale_, Jun 03 2025 *)
%o A332847 (PARI) a(n) = {my(k=1, m=2^2^n); while(ispseudoprime(k*m-2*k+1)-ispseudoprime(k*m+2*k-1)==0, k++); k; } \\ _Jinyuan Wang_, Feb 26 2020
%Y A332847 Cf. A019434, A331487.
%Y A332847 Cf. A000215 (Fermat numbers 2^2^n + 1), A000225 (Mersenne numbers 2^n - 1).
%K A332847 nonn,more
%O A332847 0,2
%A A332847 _Juri-Stepan Gerasimov_, Feb 26 2020
%E A332847 Offset changed to 0 and a(11)-a(14) from _Jinyuan Wang_, Feb 26 2020
%E A332847 a(15)-a(16) from _Michael S. Branicky_, Jun 16 2025