Increasing gaps between consecutive Niven numbers: Difference between revisions
Increasing gaps between consecutive Niven numbers (view source)
Revision as of 11:08, 19 May 2020
, 4 years agoMinor edit to C code
m (→{{header|Wren}}: Minor correction to preamble.) |
m (Minor edit to C code) |
||
Line 42:
// 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 60:
setlocale(LC_ALL, "");
uint64_t previous = 1, gap = 0, sum = 0;
int niven_index = 0, gap_index = 1
printf("Gap index Gap Niven index Niven number\n");
|