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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A038664 a(n)-th and (a(n)+1)-st primes are the first pair that differ by 2n. 16
2, 4, 9, 24, 34, 46, 30, 282, 99, 154, 189, 263, 367, 429, 590, 738, 217, 1183, 3302, 2191, 1879, 1831, 7970, 3077, 3427, 2225, 3793, 8028, 4612, 4522, 3644, 8688, 14862, 12542, 15783, 3385, 34202, 19026, 17006, 44773, 23283, 38590, 14357 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Does anyone know of a proof that a(n) is defined for all natural numbers n, i.e., f:n -> prime(n+1)-prime(n) is a surjective map from N-{1} -> E, where N, E are the sets of natural numbers and even numbers, respectively? - Joseph L. Pe, Dec 14 2002

a(n) is defined for all n if (but not only if) de Polignac's conjecture is true. - Harry J. Smith, Jul 22 2003

A001223(a(n)) = 2*n and A001223(m) != 2*n for m < a(n). - Reinhard Zumkeller, Aug 23 2015

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..111

Eric Weisstein's World of Mathematics, de Polignac's Conjecture.

FORMULA

a(n) = A000720(A000230(n)). - M. F. Hasler, Jan 16 2011

MAPLE

P:=proc(q) local k, n; for k from 2 by 2 to q do for n from 1 to q do

if ithprime(n+1) mod ithprime(n)=k then print(n); break; fi;

od; od; end: P(10^9); # Paolo P. Lava, Mar 22 2017

MATHEMATICA

Table[k = 0; While[k++; p1 = Prime[k]; p2 = Prime[k + 1]; (p2 - p1) != n]; k, {n, 2, 200, 2}] (* Lei Zhou, Mar 01 2005 *)

With[{d=Differences[Prime[Range[50000]]]}, Flatten[Table[Position[d, 2n, 1, 1], {n, 50}]]] (* This program is many times faster than the first Mathematica program above. *) (* Harvey P. Dale, Nov 24 2012 *)

PROG

(PARI) first(m)=my(v=vector(m), n); for(n=1, m, v[n]=0; until(2*n==prime(v[n]+1)-prime(v[n]), v[n]++)); v; \\ Anders Hellström, Jul 19 2015

(Haskell)

import Data.List (elemIndex); import Data.Maybe (fromJust)

a038664 = (+ 1) . fromJust . (`elemIndex` a001223_list) . (* 2)

-- Reinhard Zumkeller, Aug 23 2015

CROSSREFS

Cf. A001223, A261525.

Sequence in context: A144309 A080376 A005669 * A261367 A148077 A148078

Adjacent sequences:  A038661 A038662 A038663 * A038665 A038666 A038667

KEYWORD

nonn

AUTHOR

Jeff Burch

EXTENSIONS

More terms from Michel ten Voorde, Apr 13 2001

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 04:19 EDT 2019. Contains 322237 sequences. (Running on oeis4.)