For the record, the pattern looks like this: $1, 1, 3, 1, 3, 5, 7, 1, 3, 5, 7, 9, 11, 13, 16, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 1\ldots$, and the corresponding function is $f(n) = 2(n - 2^{\lfloor\log _2 \left(n\right)\rfloor}) + 1$