OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers if and only if there are an infinite number of twin primes pairs.
EXAMPLE
a(1)=1 by definition. a(2)=2 since (p(4)-p(3))/2=(7-5)/2=1 and the first integer not appearing in the sequence so far is 2.
a(3)=4 since (p(5)-p(4))/2=(11-7)/2=2 and the second integer not appearing in the sequence is 4.
MATHEMATICA
f[n_] := Block[{c = (Prime[n + 2] - Prime[n + 1])/2, d = 0, k = 1}, While[d < c, k++; If[ ! MemberQ[lst, k], d++ ]]; AppendTo[lst, k]]; lst = {1}; Do[ f[n], {n, 2, 72}]; lst (* Robert G. Wilson v *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jun 02 2006
EXTENSIONS
More terms from Robert G. Wilson v, Jun 07 2006
STATUS
approved