

A094744


Rearrangement of primes so that sum of the absolute value of the successive differences is also a prime.


3



2, 5, 3, 11, 7, 13, 19, 17, 23, 29, 47, 37, 67, 31, 43, 41, 53, 71, 59, 89, 61, 73, 79, 103, 83, 101, 107, 97, 109, 139, 127, 157, 131, 137, 113, 149, 167, 151, 163, 181, 193, 173, 197, 179, 191, 227, 251, 211, 277, 229, 271, 223, 307, 239, 263, 199, 241, 283, 257
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

The smallest previously unused prime consistent with the definition is used at each step.  Franklin T. AdamsWatters, Oct 09 2006


LINKS

Robert Israel, Table of n, a(n) for n = 1..10000


EXAMPLE

52 = 3 is prime, (52)+ (53) = 5 is a prime,(52)+(53)+(113) = 13 is a prime.


MAPLE

N:= 10000: # to use primes up to N
A[1]:= 2:
P:= select(isprime, [seq(i, i=3..N, 2)]):
s:= 0:
for n from 2 do
for i from 1 to nops(P) do
if isprime(s + abs(P[i]A[n1])) then
s:= s+abs(P[i]A[n1]);
A[n]:= P[i];
P:= subsop(i=NULL, P);
break
fi
od;
if not assigned(A[n]) then break fi;
od:
seq(A[i], i=1..n1); # Robert Israel, Sep 16 2016


CROSSREFS

Cf. A094743, A094745.
Sequence in context: A275677 A221183 A178174 * A229608 A185061 A129198
Adjacent sequences: A094741 A094742 A094743 * A094745 A094746 A094747


KEYWORD

nonn


AUTHOR

Amarnath Murthy, May 24 2004


EXTENSIONS

Corrected and extended by Franklin T. AdamsWatters, Oct 09 2006


STATUS

approved



