# syntax: GAWK -f SELF_NUMBERS.AWK # converted from Go (low memory example) BEGIN { print("HH:MM:SS INDEX SELF") print("-------- ---------- ----------") count = 0 digits = 1 i = 1 last_self = 0 offset = 9 pow = 10 while (count < 1E8) { is_self = 1 start = max(i-offset,0) sum = sum_digits(start) for (j=start; j y) ? x : y) }