[Math] Producing a recursive definition of the set of all positive integers not divisible by 5

discrete mathematicsrecursion

Question

Pretty basic problem here. Looking for some guidance on my train of thought.

Give a recursive definition for the following set:

the set of positive integers not divisible by 5

My Attempt

First thing I did was create a bit of the set $$S (1,2,3,4,\;\;6,7,8,9,\;\;11,12,13,14,\dots).$$
As for a base case, I can say that 1 is in set $S$.

As for the inductive step, I ask myself "am I noticing a pattern to this set"? Yes. if $X/5 \not= 1$, then $X$ is in set $S$. That doesn't seem helpful to me though.

I figure I might as well take a look at the set lists. I know I need to use the previous term to get the next term, but there's a problem when I get to $S(4)$ that doesn't follow in suit.

$$S0 = (1)$$

$$S1 = S0 + 1 = 2$$

$$S2 = S1 + 1 = 3$$

$$S3 = S2 + 1 = 4$$

$$S4 = S3 + 2 = 6$$

Well shoot, doing this hasn't really gotten me anywhere either.

I thought I might try something similar to part c, and I really feel like whats provided here is close to what I need, but I just can't make the connection.

Do you think I should have multiple base cases? Perhaps a base that states 1 2 3 and 4 are all in set $S$ to start?

Best Answer

Let $s_1 = 1, s_2 =2, s_3 = 3, s_4 = 4$. Define $s_i = s_{i-4} +5, i > 4$.