Increasing gaps between consecutive Niven numbers: Difference between revisions
Content added Content deleted
m (Minor edit to C code) |
m (Minor edit to C++ code) |
||
Line 123:
// Returns the sum of the digits of n given the
// sum of the digits of n - 1
uint64_t digit_sum(uint64_t n,
++sum;
while (n > 0 && n % 10 == 0) {
Line 142:
std::cout.imbue(std::locale(""));
uint64_t previous = 1, gap = 0, sum = 0;
int niven_index = 0, gap_index = 1
std::cout << "Gap index Gap Niven index Niven number\n";
|