#abc275d. D - Yet Another Recursive Function
D - Yet Another Recursive Function
Score : points
问题描述
一个函数 定义在非负整数 上,满足以下条件:
- 。
- 对于任何正整数 ,有 $f(k) = f(\lfloor \frac{k}{2}\rfloor) + f(\lfloor \frac{k}{3}\rfloor)$。
这里, 表示将 向下取整得到的整数值。
求解 。
以上为通义千问 qwen-max 翻译,仅供参考。
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.
Sample Input 1
2
Sample Output 1
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$.
Sample Input 2
0
Sample Output 2
1
Sample Input 3
100
Sample Output 3
55
update @ 2024/3/10 11:34:54