Continuous function that outputs even and odd numbers from natural inputs in a non-constant, non-alternating order?

246 Views Asked by At

For example, plugging 1, 2, 3, 4 into this function would produce results which are even, odd, odd, even, and that pattern would repeat. Is this possible for a continuous function? Can you make any arbitrary pattern of odds and evens as outputs of natural numbers with a continuous function?

2

There are 2 best solutions below

1
On BEST ANSWER

Yes, you can.

A visual way to think of continuous functions is that you can draw them without lifting your pen off the paper. Now let's say you've got some arbitrary pattern, and know what values a function $f$ assumes on the natural numbers. Just take your pen, swirl it up and down and make sure it passes through the points $(1,f(1))$, $(2,f(2))$, etcetera.

Whether or not they have a simple way of writing them is another question, likely not. But that depends on the patterns you've chosen.

0
On

Yes, it is.

Consider the set $\Bbb N$ or natural numbers and whatever "pattern" $(p_n)_{n \in \Bbb N}$ you want. Define $f(n)=p_n$ and then interpolate linearly in $[n, n + 1].$ Make $f$ constant until the first natural.