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 A118955 #42 Nov 27 2024 08:50:17 %S A118955 3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,23,24,25,27,29,30,31, %T A118955 32,33,34,35,37,38,39,41,42,43,44,45,47,48,49,51,53,54,55,57,59,60,61, %U A118955 62,63,65,66,67,68,69,71,72,73,74,75,77,79,80,81,83,84,85,87,89,90,91,93 %N A118955 Numbers of the form 2^k + prime. %C A118955 A109925(a(n)) > 0, complement of A118954; %C A118955 The lower density is at least 0.09368 (Pintz) and upper density is at most 0.49095 (Habsieger & Roblot). The density, if it exists, is called Romanov's constant. Romani conjectures that it is around 0.434. - _Charles R Greathouse IV_, Mar 12 2008 %C A118955 Elsholtz & Schlage-Puchta improve the bound on lower density to 0.107648. Unpublished work by Jie Wu improves this to 0.110114, see Remark 1 in Elsholtz & Schlage-Puchta. - _Charles R Greathouse IV_, Aug 06 2021 %D A118955 Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 2.1, p. 87. %H A118955 Charles R Greathouse IV, <a href="/A118955/b118955.txt">Table of n, a(n) for n = 1..10000</a>. %H A118955 Christian Elsholtz and Jan-Christoph Schlage-Puchta, <a href="https://www.mathematik.uni-rostock.de/storages/uni-rostock/Alle_MNF/Mathematik/Struktur/Lehrstuehle/Algebra/papers/Rom6k.pdf">On Romanov's constant</a>, Mathematische Zeitschrift, Vol. 288 (2018), pp. 713-724. %H A118955 Laurent Habsieger and Xavier-Francois Roblot, <a href="https://www.impan.pl/en/publishing-house/journals-and-series/acta-arithmetica/all/122/1/82462/on-integers-of-the-form-p-2-k">On integers of the form p + 2^k</a>, Acta Arithmetica 122:1 (2006), pp. 45-50. %H A118955 J. Pintz, <a href="http://dx.doi.org/10.1007/s10474-006-0060-6">A note on Romanov's constant</a>, Acta Mathematica Hungarica 112:1-2 (2006), pp. 1-14. %H A118955 F. Romani, <a href="http://dx.doi.org/10.1007/BF02576468">Computations concerning primes and powers of two</a>, Calcolo 20 (1983), pp. 319-336. %t A118955 Select[Range[100], (For[r=False; k=1, #>k, k*=2, If[PrimeQ[#-k], r=True]]; r)& ] (* _Jean-François Alcover_, Dec 26 2013, after _Charles R Greathouse IV_ *) %o A118955 (PARI) is(n)=my(k=1);while(n>k,if(isprime(n-k),return(1),k*=2));0 \\ _Charles R Greathouse IV_, Mar 12 2008 %o A118955 (PARI) list(lim)=my(v=List(),t=1); while(t<lim, forprime(p=2,lim-t, listput(v,p+t)); t<<=1); Set(v) \\ _Charles R Greathouse IV_, Aug 06 2021 %o A118955 (Haskell) %o A118955 a118955 n = a118955_list !! (n-1) %o A118955 a118955_list = filter f [1..] where %o A118955 f x = any (== 1) $ map (a010051 . (x -)) $ takeWhile (< x) a000079_list %o A118955 -- _Reinhard Zumkeller_, Jan 03 2014 %o A118955 (Python) %o A118955 from itertools import count, islice %o A118955 from sympy import isprime %o A118955 def A118955_gen(startvalue=1): # generator of terms >= startvalue %o A118955 return filter(lambda n: any(isprime(n-(1<<i)) for i in range(n.bit_length()-1,-1,-1)), count(max(startvalue,1))) %o A118955 A118955_list = list(islice(A118955_gen(),30)) # _Chai Wah Wu_, Nov 29 2023 %Y A118955 Subsequence of A081311; A118957 is a subsequence. %Y A118955 Cf. A156695, A010051, A000079. %K A118955 nonn %O A118955 1,1 %A A118955 _Reinhard Zumkeller_, May 07 2006