OFFSET
1,2
COMMENTS
This sequence is a permutation of the positive integers.
LINKS
Carole Dubois, Table of n, a(n) for n = 1..5000
EXAMPLE
a(1) = 1
a(2) = a(1) + 1 = 2;
as a(2) = 2 has no odd digit, we restart the sequence with a(3) = 3;
a(4) = a(3) + 3 = 6;
as a(4) = 6 has no odd digit, we restart the sequence with a(5) = 4;
as a(5) = 4 has no odd digit, we restart the sequence with a(6) = 5;
a(6) = a(5) + 5 = 10;
a(7) = a(6) + 1 = 11;
a(8) = a(7) + 1 = 12;
a(9) = a(8) + 1 = 13;
a(10) = a(9) + 3 = 16; etc.
MATHEMATICA
Nest[Append[#1, If[FreeQ[#1, #2], #2, Block[{k = 2}, While[! FreeQ[#1, k], k++]; k]] ] & @@ {#1, If[Length@ #2 > 0, #1[[-1]] + #2[[-1]], 1]} & @@ {#, Select[Union@ IntegerDigits[#[[-1]] ], OddQ]} &, {1}, 80] (* Michael De Vlieger, Jan 11 2020 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Jan 10 2020
STATUS
approved