The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A094744 Rearrangement of primes so that sum of the absolute value of the successive differences is also a prime. 3

%I

%S 2,5,3,11,7,13,19,17,23,29,47,37,67,31,43,41,53,71,59,89,61,73,79,103,

%T 83,101,107,97,109,139,127,157,131,137,113,149,167,151,163,181,193,

%U 173,197,179,191,227,251,211,277,229,271,223,307,239,263,199,241,283,257

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

%C The smallest previously unused prime consistent with the definition is used at each step. - _Franklin T. Adams-Watters_, Oct 09 2006

%H Robert Israel, <a href="/A094744/b094744.txt">Table of n, a(n) for n = 1..10000</a>

%e 5-2 = 3 is prime, (5-2)+ (5-3) = 5 is a prime,(5-2)+(5-3)+(11-3) = 13 is a prime.

%p N:= 10000: # to use primes up to N

%p A[1]:= 2:

%p P:= select(isprime, [seq(i,i=3..N,2)]):

%p s:= 0:

%p for n from 2 do

%p for i from 1 to nops(P) do

%p if isprime(s + abs(P[i]-A[n-1])) then

%p s:= s+abs(P[i]-A[n-1]);

%p A[n]:= P[i];

%p P:= subsop(i=NULL,P);

%p break

%p fi

%p od;

%p if not assigned(A[n]) then break fi;

%p od:

%p seq(A[i],i=1..n-1); # _Robert Israel_, Sep 16 2016

%Y Cf. A094743, A094745.

%K nonn

%O 1,1

%A _Amarnath Murthy_, May 24 2004

%E Corrected and extended by _Franklin T. Adams-Watters_, Oct 09 2006

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.

Last modified December 6 03:33 EST 2021. Contains 349562 sequences. (Running on oeis4.)