#P6065. [USACO05JAN] Sumsets S
[USACO05JAN] Sumsets S
Description
Given an integer , how many ways are there to decompose into a sum of several powers of ?
Input Format
Input an integer ().
Output Format
Output the number of valid decompositions modulo .
7
6
Hint
All valid decompositions are as follows.
- 1+1+1+1+1+1+1
- 1+1+1+1+1+2
- 1+1+1+2+2
- 1+1+1+4
- 1+2+2+2
- 1+2+4
Translated by ChatGPT 5
京公网安备 11011102002149号