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.

A345014 a(n) is the least nonnegative integer k such that 2^n - k is a Sophie Germain prime.

This page as a plain text file.
%I A345014 #20 Oct 28 2021 16:07:36
%S A345014 0,1,3,5,3,11,15,5,3,5,9,23,81,83,135,143,9,23,117,5,9,161,159,317,
%T A345014 339,203,219,95,693,35,105,5,321,425,69,23,201,191,219,983,1101,371,
%U A345014 747,287,429,743,2649,1355,81,233,237,635,2403,395,1125,1997,69,9005
%N A345014 a(n) is the least nonnegative integer k such that 2^n - k is a Sophie Germain prime.
%H A345014 Artsiom Palkounikau, <a href="/A345014/b345014.txt">Table of n, a(n) for n = 1..3072</a>
%F A345014 a(n) = (A057821(n+1) + 1)/2.
%t A345014 Table[k=0;While[!(PrimeQ[p=2^n-k]&&PrimeQ[2p+1]),k++];k,{n,58}] (* _Giorgos Kalogeropoulos_, Sep 15 2021 *)
%o A345014 (Python)
%o A345014 from sympy import isprime
%o A345014 def a(n):
%o A345014     k = 0
%o A345014     while True:
%o A345014         if isprime(2 ** n - k) and isprime(2 * (2 ** n - k) + 1):
%o A345014             return k
%o A345014         k += 1
%o A345014 print([a(i) for i in range(1, 21)])
%o A345014 (PARI) a(n) = my(k=0,p); while (!(isprime(p=2^n-k) && isprime(2*p+1)), k++); k; \\ _Michel Marcus_, Sep 15 2021
%Y A345014 Cf. A005384, A057821, A013603, A243916.
%K A345014 nonn
%O A345014 1,3
%A A345014 _Artsiom Palkounikau_, Sep 15 2021