Hello!
Please tell me the algorithm for calculating the catalog, consisting of a sequence of numbers.
The directory has the form: /X/Y/Z/ , where X, Y, Z folders are names.
The maximum number of folders in a subfolder is 5. Those. The final directory will be: /5/5/5/
I have a unique folder id. I need to know which way the number will match, if the number of folders in the subfolder is no more than 5. For example, if the folder id is 15 , the path will be 0/3/0/ . For folder 29, the path will be 1/0/3 0/5/4/ , for 32 1/0/3 , etc.
I try the remainder of the division: Number = 17. The path is calculated by dividing the number by the specified maximum number of folders in the subfolder. It turns out 17/5 = integer 3, the remainder 2. So the path will be 0/3/2/ .
But how to calculate if the number will be for example 37?
Thank you in advance!