We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #168: Number Rotations

Project Euler #168: Number Rotations

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 168 from projecteuler.net

Consider the number . We can right-rotate this number by moving the last digit to the front of it, giving us .

It can be verified that .
This demonstrates an unusual property of 142857: it is a divisor of its right-rotation.

Find the last 5 digits of the sum of all integers , , that have this property.

Input Format

One integer is given on first line representing .

Constraints

Output Format

Print one integer which is the answer to the problem.

Sample Input 0

2

Sample Output 0

495

Author

Arterm

Difficulty

Easy

Max Score

100

Submitted By

1757

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy