Variation (2) on Recamán's sequence (A005132): to get a(n), we first try to subtract n from a(n-1): a(n) = a(n-1)-n if positive and not already in the sequence; if not then a(n) = a(n-1)+n+i, where i >= 0 is the smallest number such that a(n-1)+n+i has not already appeared.
A064387
Variation (2) on Recamán's sequence (A005132): to get a(n), we first try to subtract n from a(n-1): a(n) = a(n-1)-n if positive and not already in the sequence; if not then a(n) = a(n-1)+n+i, where i >= 0 is the smallest number such that a(n-1)+n+i has not already appeared.
Terms
- a(0) =1a(1) =3a(2) =6a(3) =2a(4) =7a(5) =13a(6) =20a(7) =12a(8) =21a(9) =11a(10) =22a(11) =10a(12) =23a(13) =9a(14) =24a(15) =8a(16) =25a(17) =43a(18) =62a(19) =42a(20) =63a(21) =41a(22) =18a(23) =44a(24) =19a(25) =45a(26) =72a(27) =100a(28) =71a(29) =101
External references
- oeis: A064387