CSC281 Project: Calculating Last Digits of Large Integers
VerifiedAdded on 2022/08/20
|7
|809
|13
Project
AI Summary
This project, undertaken for CSC281 Discrete Mathematics at King Saud University, focuses on calculating the last few digits of large integers, such as 2017^2018^2019. The solution employs Euler's theorem and modular exponentiation to efficiently determine these digits. The assignment involves creating a Java program that implements an algorithm to compute the last digits, using methods for modular exponentiation and printing the results. The algorithm starts by creating a Java class and methods, including a power method for modular exponentiation, and a method to print the last k digits. The program takes user input, calls the relevant methods, and provides the final result. The project utilizes the concept that (a^b) mod k helps to find the last digits. The report concludes that the provided algorithm and Java implementation successfully determine the last digits, with the method adaptable to find varying numbers of last digits by adjusting the modulus used. The project includes a bibliography referencing related mathematical concepts and theorems.
1 out of 7










