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.

A307535 a(n) is the smallest k >= 0 such that 2^(2^n) + k*2^n + 1 is prime.

This page as a plain text file.
%I A307535 #44 Jun 05 2024 14:04:45
%S A307535 0,0,0,0,0,12,15,3,9,202,56,304,635,11095,8948,6415,14441,877,37436
%N A307535 a(n) is the smallest k >= 0 such that 2^(2^n) + k*2^n + 1 is prime.
%C A307535 2^(2^n) + a(n)*2^n + 1 = A019434(n) for n <= 4, the known Fermat primes.
%C A307535 Conjecture: 2^(2^n) + a(n)*2^n + 1 = A307532(n) for all n > 4.
%C A307535 Note that a(9) = A030239(9) = 202.
%F A307535 a(n) == 1 (mod 2^n).
%e A307535 For n = 5, k = 12; 2^(2^5) + 12*2^5 + 1 = 4294967681 is prime, a(5) = 12.
%t A307535 a[n_] := Module[{k = 0}, While[! PrimeQ[2^(2^n) + k*2^n + 1], k++];
%t A307535   k]; Array[a, 10, 0]
%o A307535 (PARI) isok(k, n) = isprime(2^(2^n) + k*2^n + 1);
%o A307535 a(n) = my(k=0); while (!isok(k, n), k++); k; \\ _Michel Marcus_, Apr 15 2019
%o A307535 (Python)
%o A307535 from sympy import isprime
%o A307535 def A307535(n):
%o A307535     r = 2**n
%o A307535     m, k = 2**r+1, 0
%o A307535     w = m
%o A307535     while not isprime(w):
%o A307535         k += 1
%o A307535         w += r
%o A307535     return k # _Chai Wah Wu_, Apr 29 2019
%Y A307535 Cf. A019434, A030239, A307532.
%K A307535 nonn,more,hard
%O A307535 0,6
%A A307535 _Amiram Eldar_ and _Thomas Ordowski_, Apr 13 2019
%E A307535 a(15) from _Daniel Suteu_, Apr 14 2019
%E A307535 a(16)-a(17) from _Chai Wah Wu_, Apr 30 2019
%E A307535 a(18) from _Michael S. Branicky_, Jun 05 2024