Assuming that the number that's being searched is 5
(as inferred from the code and not the problem description) - there's a procedure that already does what's being asked, it's called member
:
(member 5 '(1 3 5 7))
=> '(5 7)
Which, according to the documentation:
Locates the first element of lst that is equal? to v. If such an element exists, the tail of lst starting with that element is returned. Otherwise, the result is #f.
But if we were to implement a similar procedure from scratch, this is how the solution would look, fill-in the blanks:
(define five?
(lambda (lon)
(if <???> ; is the list empty?
<???> ; then the number is not in the list
(or <???> ; otherwise the current element is 5 or
(five? <???>))))) ; the number is in the rest of list
Don't forget to test your code:
(five? '())
=> #f
(five? '(1 2 3 6 7 9))
=> #f
(five? '(1 2 3 5 7 9))
=> #t