login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A045718 Nearest neighbors of primes. 10
1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 30, 32, 36, 38, 40, 42, 44, 46, 48, 52, 54, 58, 60, 62, 66, 68, 70, 72, 74, 78, 80, 82, 84, 88, 90, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 126, 128, 130, 132, 136, 138, 140, 148, 150, 152, 156, 158, 162 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

LINKS

Seiichi Manyama, Table of n, a(n) for n = 0..10000

EXAMPLE

p=7 contributes 6 and 8 to the list.

MATHEMATICA

Union[ Table[ Prime[ i ]-1, {i, 1, 100} ]~Join~Table[ Prime[ i ]+1, {i, 1, 100} ] ]

Union[Flatten[Table[n+{1, -1}, {n, Prime[Range[50]]}]]] (* Harvey P. Dale, Oct 18 2015 *)

PROG

(PARI) isA045718(n) = isprime(n-1)||isprime(n+1) \\ Michael B. Porter, Feb 02 2010

CROSSREFS

Cf. A000040.

Sequence in context: A004278 A068670 A084925 * A068005 A055721 A064376

Adjacent sequences:  A045715 A045716 A045717 * A045719 A045720 A045721

KEYWORD

nonn,easy

AUTHOR

Felice Russo

EXTENSIONS

Corrected and extended by Erich Friedman

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified May 23 08:43 EDT 2017. Contains 286909 sequences.