Variation (3) on Recamán's sequence (A005132): set s (the step size) initially equal to 2; to get a(n), we first try to subtract s from a(n-1): a(n) = a(n-1)-s if positive and not already in the sequence, in which case we change s to s+1; if not, a(n) = a(n-1)+s+i, where i >= 0 is the smallest number such that a(n-1)+s+i has not already appeared and now we change s to s+i+1.
A064388
Variation (3) on Recamán's sequence (A005132): set s (the step size) initially equal to 2; to get a(n), we first try to subtract s from a(n-1): a(n) = a(n-1)-s if positive and not already in the sequence, in which case we change s to s+1; if not, a(n) = a(n-1)+s+i, where i >= 0 is the smallest number such that a(n-1)+s+i has not already appeared and now we change s to s+i+1.
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) =17a(25) =45a(26) =16a(27) =46a(28) =15a(29) =47
External references
- oeis: A064388