OFFSET
1,2
COMMENTS
Unlike the Yellowstone permutation (A098550) and the alternating parity Yellowstone permutation (A344176), the primes do not appear in their natural order. Indeed, after the initial conditions 2, 3 and 5, the next primes to appear are 11, 7, 13, 19, 17, 23, 31, 29.
Not a permutation of the positive integers since no larger powers of 2 appear as terms of the sequence.
LINKS
Sean A. Irvine, Java program (github)
MATHEMATICA
Array[(a@#=#)&, 3]; a[4]=5; a[n_]:=a[n]=(If[And@@OddQ[{a[n-1], a[n-2]}], k=2, k=1]; While[MemberQ[Array[a, n-1], k]||GCD[a[n-2], k]<2||GCD[a[n-1], k]>1, k=k+2]; k); Array[a, 100] (* Giorgos Kalogeropoulos, Jul 23 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Enrique Navarrete, Jun 24 2021
STATUS
approved