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 A058249 #26 Jan 23 2020 04:01:24 %S A058249 0,2,4,4,6,6,4,6,12,10,14,6,18,30,22,16,30,8,22,10,26,18,24,46,74,20, %T A058249 68,60,14,38,12,20,26,66,84,36,34,52,30,102,48,26,86,24,114,36,120,80, %U A058249 150,82,150,68,116,192,58,86,22,96,186,126,16,192,54,72,180,14,22,56 %N A058249 (Smallest prime >= 2^n) - (largest prime <= 2^n). %C A058249 This sequence gives the gap between consecutive primes on either side of 2^n. The average gap between primes near 2^n should be about g=n*log(2). Cramer's conjecture would allow gaps to be as large as about g^2. - _T. D. Noe_, Jul 17 2007 %H A058249 Robert G. Wilson v, <a href="/A058249/b058249.txt">Table of n, a(n) for n = 1..10087</a> (first 5000 terms from T. D. Noe). %F A058249 a(n) = A014210(n) - A014234(n) = A013603(n) + A013597(n). %e A058249 n = 1: a(1) = 2 - 2 = 0, %e A058249 n = 9: a(9) = 521 - 509 = 12. %p A058249 a := n -> if n > 1 then nextprime(2^n)-prevprime(2^n) else 0 fi; [seq( a(i), i=1..256)]; # Maple's next/prevprime functions use strict inequalities and therefore would not yield the correct difference for n=1. Alternatively, a(n) = nextprime(2^n-1)-prevprime(2^n+1); %t A058249 Prepend[NextPrime[#]-NextPrime[#,-1]&/@(2^Range[2,70]),0] (* _Harvey P. Dale_, Jan 25 2011 *) %t A058249 Join[{0}, Table[NextPrime[2^n] - NextPrime[2^n, -1], {n, 2, 70}]] %o A058249 (PARI) a(n)=nextprime(2^n)-precprime(2^n) \\ _Charles R Greathouse IV_, Sep 20 2016 %Y A058249 Cf. A013603, A013597, A014210, A014234, A038804. %K A058249 nonn %O A058249 1,2 %A A058249 _Labos Elemer_, Dec 05 2000 %E A058249 Edited by _M. F. Hasler_, Feb 14 2017