A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/de/d99/aliquot__sum_8cpp_source.html below:

TheAlgorithms/C++: math/aliquot_sum.cpp Source File

Go to the documentation of this file. 37 if

(num == 0 || num == 1) {

38 return

0;

// 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) 67

std::cout <<

"All the tests have successfully passed!\n"

;

75 test

();

// run the self-test implementations

static 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