OFFSET
1,1
COMMENTS
The idea of this sequence comes from A282649 where "larger" replaces "smaller".
The sequence is not a permutation of the positive integers.
Consecutive primes p < q separated by composites c = q + 1. - Michael De Vlieger, Jun 09 2019
FORMULA
n odd: a(n) = prime((n+1)/2) = A000040((n+1)/2).
n even: a(n) = a(n+1) + 1 = prime(n/2 + 1) + 1 = A008864(n/2 + 1).
Alternatively, if a(n-1) is prime, a(n) = 1 + min prime > a(n-1) else a(n) = a(n-1) - 1. - Bill McEachen, May 16 2024
EXAMPLE
In the 1st pair of integers (2,4) the smaller term is (2), which is prime;
In the 2nd pair of integers (4,3) the smaller term is (3), which is prime;
In the 3rd pair of integers (3,6) the smaller term is (3), which is prime;
In the 4th pair of integers (6,5) the smaller term is (5), which is prime;
In the 5th pair of integers (5,8) the smaller term is (5), which is prime; etc.
MATHEMATICA
Fold[Join[#1, {#2, NextPrime@ #2 + 1}] &, {#, NextPrime@ # + 1} &@ 2, Prime@ Range[2, 35]] (* Michael De Vlieger, Jun 09 2019 *)
CROSSREFS
Cf. A282649 (similar, with larger term).
KEYWORD
nonn
AUTHOR
Bernard Schott, Jun 09 2019
STATUS
approved