Problem 57323. Easy Sequences 84: Digits of Powers of 5
OEIS sequence #A008566, deals with the following series:
This sequence is the digits of powers of 5 listed side by side, that is:
Given a digit d and index n, write a function  , that outputs how many times d appears in the sequence segment
, that outputs how many times d appears in the sequence segment  .
.
For example, it is clear from the list above that,  ,
,  and
 and  .
.
---------------
HINT: OEIS did not provide a close formula for finding the elements of sequence #A008566. However, this sequence is not without a pattern. For example: except for  , the last digit of
, the last digit of  is always 5, except for
 is always 5, except for  , the second last digit of
, the second last digit of  is always 2, except for
 is always 2, except for  , the third last digit of
, the third last digit of  is always either 1 or 6, etc... You may need this pattern as the use of big integer class is not required in this problem.
 is always either 1 or 6, etc... You may need this pattern as the use of big integer class is not required in this problem.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers3
Suggested Problems
- 
         Generate a random matrix A of (1,-1) 371 Solvers 
- 
         Given a matrix, swap the 2nd & 3rd columns 1196 Solvers 
- 
         Matlab Basics II - Unit Conversion 171 Solvers 
- 
         
         95 Solvers 
- 
         
         544 Solvers 
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!