📜 ⬆️ ⬇️

Guess the sequence

I wanted to post in the entertaining puzzles , but not enough karma. Therefore, I will write in my blog.

Guess what the next function f counts on a set of natural numbers. Here are its first 40 values:
f (1) = 0
f (2) = + infinity (or undefined)
f (3) = f (4) = 2
f (5) = f (6) = ... = f (13) = 3
f (14) = f (15) = ... = f (40) = 4

If difficulties arise, then I will give some clues.
')
Update. Tips are not needed. In the comments already have an answer!

Source: https://habr.com/ru/post/59704/


All Articles