atcoder#ABC275D. [ABC275D] Yet Another Recursive Function
[ABC275D] Yet Another Recursive Function
Score : points
Problem Statement
A function defined for non-negative integers satisfies the following conditions.
- .
- $f(k) = f(\lfloor \frac{k}{2}\rfloor) + f(\lfloor \frac{k}{3}\rfloor)$ for any positive integer .
Here, denotes the value of rounded down to an integer.
Find .
Constraints
- is an integer satisfying .
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
2
3
We have $f(2) = f(\lfloor \frac{2}{2}\rfloor) + f(\lfloor \frac{2}{3}\rfloor) = f(1) + f(0) =(f(\lfloor \frac{1}{2}\rfloor) + f(\lfloor \frac{1}{3}\rfloor)) + f(0) =(f(0)+f(0)) + f(0)= 3$.
0
1
100
55