login

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 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A084035
a(1) = 1 and then distinct numbers such that the sum as well the absolute difference of successive terms is a prime.
2
1, 4, 7, 10, 3, 8, 5, 2, 9, 14, 17, 6, 11, 18, 13, 16, 21, 26, 15, 22, 19, 12, 25, 28, 31, 36, 23, 20, 27, 32, 29, 24, 35, 38, 33, 40, 43, 30, 37, 34, 39, 44, 57, 46, 51, 56, 45, 52, 49, 54, 47, 42, 55, 48, 41, 60, 53, 50, 63, 68, 71, 66, 61, 78, 59, 72, 65, 62, 69, 58, 81, 70
OFFSET
1,2
COMMENTS
Another rearrangement of natural numbers in which a(2k) is even and a(2k+1) is odd.
EXAMPLE
17 follows 14 as 14+17 =31 and 17-14 = 3 both are prime and 17 is smallest such number not occurring earlier.
MATHEMATICA
s = {m = 1}; Do[n = 2; While[MemberQ[s, n] || ! PrimeQ[n - m] || ! PrimeQ[n + m], n++]; m = n; AppendTo[s, m = n], {100}]; s (* Zak Seidov, Oct 18 2022 *)
CROSSREFS
Sequence in context: A022541 A330695 A063798 * A103702 A118517 A282848
KEYWORD
nonn
AUTHOR
Amarnath Murthy, May 26 2003
EXTENSIONS
More terms from Ray Chandler, Jun 09 2003
STATUS
approved