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.

A335313 Smallest k such that 2^(3*2^n) - k is a safe prime.

This page as a plain text file.
%I A335313 #49 Jun 06 2022 11:23:24
%S A335313 1,5,17,317,5297,3449,41213,59057,468857,1503317,1103717,40207829,
%T A335313 154474973,1162354373,18153497
%N A335313 Smallest k such that 2^(3*2^n) - k is a safe prime.
%e A335313 a(1) = 5 because 2^(3*2^1)-5 = 2^6-5 = 59 is the largest safe prime less than 64.
%o A335313 (PARI) a(n) = {my(k=0); while (!(isprime(p=2^(3*2^n) - k) && isprime((p-1)/2)), k++); k;} \\ _Michel Marcus_, Jun 01 2020
%o A335313 (Python)
%o A335313 from sympy import isprime, prevprime
%o A335313 def A335313(n):
%o A335313     m = 2**(3*2**n)
%o A335313     p = prevprime(m)
%o A335313     while not isprime((p-1)//2):
%o A335313         p = prevprime(p)
%o A335313     return m-p # _Chai Wah Wu_, Jul 09 2020
%Y A335313 Cf. A005385 (safe primes), A057821, A181356.
%K A335313 nonn,more
%O A335313 0,2
%A A335313 _Artsiom Palkounikau_, Jun 01 2020
%E A335313 a(13) from _Artsiom Palkounikau_, Oct 13 2021
%E A335313 a(14) from _Mark Andreas_, Jun 06 2022