login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A340707 a(n) = (prevprime(2^n) + nextprime(2^n))/2 - 2^n where prevprime(n) = A151799(n) and nextprime(n) = A151800(n). 2
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, 4, -16, 5, 5, 4, -8, 11, 13, -8, -19, 8, -36, 3, 2, -14, -5, 2, -3, -55, -19, -6, 14, -54, -13, -53, 63, -26, 38, -2, 21, 38, -30, 7, 39, 2, -23, 41, 2, -8, 5, 5, -5, -110 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,4

COMMENTS

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).

LINKS

Hugo Pfoertner, Table of n, a(n) for n = 2..5000 (from T. D. Noe's b-files in A013597 and A013603).

FORMULA

a(n) = (A013597(n) - A013603(n))/2.

a(A226178(n)) = 0.

EXAMPLE

a(4) = -1: 2^4 = 16, (13 + 17 - 32)/2 = -1;

a(5) = 2: 2^5 = 32, (31 + 37 - 64)/2 = 2;

a(6) = 0: 2^6 = 64, (61 + 67 - 128)/2 = 0.

MAPLE

a:= (p-> (nextprime(p)+prevprime(p))/2-p)(2^n):

seq(a(n), n=2..75);  # Alois P. Heinz, Jan 29 2021

MATHEMATICA

Array[(NextPrime[2^#] + NextPrime[2^#, -1] - 2^(# + 1))/2 &, 60, 2] (* Michael De Vlieger, Aug 07 2022 *)

PROG

(PARI) for(k=2, 71, my(p2=2^k, pp=precprime(p2), pn=nextprime(p2)); if(print1((pp+pn-2*p2)/2", ")))

CROSSREFS

Cf. A151799, A151800, A013597, A013603, A058249, A226178.

Sequence in context: A049262 A145201 A323671 * A284265 A119464 A214568

Adjacent sequences:  A340704 A340705 A340706 * A340708 A340709 A340710

KEYWORD

sign,changed

AUTHOR

Hugo Pfoertner, Jan 29 2021

EXTENSIONS

Name made more precise by Peter Luschny, Aug 08 2022

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 11 00:55 EDT 2022. Contains 356046 sequences. (Running on oeis4.)