(num == 0 || num == 1) {
38 return0;
// The aliquot sum for 0 and 1 is 0 43 for(uint64_t i = 1; i <= num / 2; i++) {
58 // Aliquot sum of 10 is 1 + 2 + 5 = 8 60 // Aliquot sum of 15 is 1 + 3 + 5 = 9 62 // Aliquot sum of 1 is 0 64 // Aliquot sum of 97 is 1 (the aliquot sum of a prime number is 1) 67std::cout <<
"All the tests have successfully passed!\n";
75 test();
// run the self-test implementationsstatic void test()
Self-test implementations.
int main()
Main function.
uint64_t aliquot_sum(const uint64_t num)
to return the aliquot sum of a number
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4