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.

A340707 a(n) = (prevprime(2^n) + nextprime(2^n))/2 - 2^n where prevprime(n) = A151799(n) and nextprime(n) = A151800(n).

This page as a plain text file.
%I A340707 #22 Aug 08 2022 09:40:23
%S A340707 0,1,-1,2,0,1,-2,3,2,-2,0,8,12,-8,-7,14,-1,10,2,4,6,-3,20,-2,5,-5,-27,
%T A340707 4,-16,5,5,4,-8,11,13,-8,-19,8,-36,3,2,-14,-5,2,-3,-55,-19,-6,14,-54,
%U A340707 -13,-53,63,-26,38,-2,21,38,-30,7,39,2,-23,41,2,-8,5,5,-5,-110
%N A340707 a(n) = (prevprime(2^n) + nextprime(2^n))/2 - 2^n where prevprime(n) = A151799(n) and nextprime(n) = A151800(n).
%C A340707 a(n) > 0 if the difference nextprime(2^n) - 2^n = A013597(n) is greater than the difference 2^n - previousprime(2^n) = A013603(n).
%H A340707 Hugo Pfoertner, <a href="/A340707/b340707.txt">Table of n, a(n) for n = 2..5000</a> (from T. D. Noe's b-files in A013597 and A013603).
%F A340707 a(n) = (A013597(n) - A013603(n))/2.
%F A340707 a(A226178(n)) = 0.
%e A340707 a(4) = -1: 2^4 = 16, (13 + 17 - 32)/2 = -1;
%e A340707 a(5) = 2: 2^5 = 32, (31 + 37 - 64)/2 = 2;
%e A340707 a(6) = 0: 2^6 = 64, (61 + 67 - 128)/2 = 0.
%p A340707 a:= (p-> (nextprime(p)+prevprime(p))/2-p)(2^n):
%p A340707 seq(a(n), n=2..75);  # _Alois P. Heinz_, Jan 29 2021
%t A340707 Array[(NextPrime[2^#] + NextPrime[2^#, -1] - 2^(# + 1))/2 &, 60, 2] (* _Michael De Vlieger_, Aug 07 2022 *)
%o A340707 (PARI) for(k=2,71,my(p2=2^k,pp=precprime(p2),pn=nextprime(p2));if(print1((pp+pn-2*p2)/2", ")))
%Y A340707 Cf. A151799, A151800, A013597, A013603, A058249, A226178.
%K A340707 sign
%O A340707 2,4
%A A340707 _Hugo Pfoertner_, Jan 29 2021
%E A340707 Name made more precise by _Peter Luschny_, Aug 08 2022