Even more efficient last 'Fibonacci' digit in base d
Description:
Even more efficient last 'Fibonacci' digit in base d
This kata is a spinoff of Efficient last Fibonacci digit in base d, which is a spinoff of Find last Fibonacci digit [hardcore version], which is a spinoff of Find last Fibonacci digit.
Preface
The th Fibonacci number can be computed based on the recurrence (the first few numbers are ). Usually, we would have and , or and , but for this kata, you will be provided custom starting terms and for and . Since this isn't really the Fibonacci sequence, let's call this sequence . Based on this, this is what we have so far:
Task
Given , , and , find the last digit of in base based on the above. In other words, find . Your function should return an integer.
Examples
If , , and , we have the following:
This means that the last digit of in base is .
If , , and , we have the following:
This means that the last digit of in base is .
If , , and , we have the following:
This means that the last digit of in base is , or in base .
Constraints
Hints (only use these if you need them)
Hint 1
Do you notice a pattern in the examples?Hint 2
Look at the coefficients. Do you notice anything?Hint 3
There must be a reason why I included the first few Fibonacci numbers in the preface.
Similar Kata:
Stats:
Created | Jan 11, 2025 |
Warriors Trained | 10 |
Total Skips | 0 |
Total Code Submissions | 17 |
Total Times Completed | 4 |
Python Completions | 4 |
Total Stars | 1 |
% of votes with a positive feedback rating | 50% of 1 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 1 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 5 kyu |