Here’s a sequence of decreasing numbers. Which number comes next?
612 → 600 → 594 → 414 → 398 → 182 → ?
It’s 166, because the numbers decrease by the product of their digits higher than 0:
612 – 6*2 = 612 – 12 = 600 → 600 – 6 = 594 → 594 – 5*9*4 = 594 – 180 = 414 → 414 – 4*4 = 414 – 16 = 398 → 398 – 3*9*8 = 398 – 216 = 166
Eventually the sequence will reached 0 and stop. If you want to see how this function looks on a graph, here it is:
x = n <= 3722, f(i) -= digmul(f(i)) → 0 (click for larger)
The graph represents n on the x-axis, with the red circles marking n = 100 and n = 1000. The sequence of falling digit-products is on the y-axis, but the graph has a special feature there. The y-axis is compressed according to the size of n, so that n = 1000 falls to 0 with n -= digmul(n) in the same height as n = 100. Here’s a graph for the same function in base 7:
x = n <= 3722 in base 7, f(i) -= digmul(f(i)) → 0
Now the red circles represent 7^2 = 49, 7^3 = 343, 7^4 = 2401, i.e. 100b7, 1000b7, 10000b7. And you can try other functions for n = n – func(n) = n -= func(n). Here’s a graph for n -= hailstep(n), where hailstep(n) returns the number of steps in the Collatz sequence for n:
x = n <= 3722 in base 7, f(i) -= hailstep(f(i)) → f(i) < 2
You form a Collatz sequence by starting with a whole number and finding the next number according to two rules:
1. If n(i) is divisible by 2, n(i+1) = n(i) / 2
2. If n(i) is not divisible by 2, n(i+1) = n(i) * 3 + 1
So the Collatz sequence for n = 10 looks like this:
10 → 10 / 2 = 5 → 5 * 3 + 1 = 16 → 16 / 2 = 8 → 8 / 2 = 4 → 4 / 2 = 2 → 2 / 2 = 1.
When you reach 1, you stop. So that’s six steps for n = 10. But does every n reach 1 in the end? It’s a very simple question about a very simple function. But nobody knows and nobody can prove that either all numbers do or at least one number doesn’t. The German mathematician Lothar Collatz (1910-90) conjectured that all numbers do reach 1. But it can take a surprisingly long time, even with small n. This is the Collatz sequence for n = 27:
27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1
Now some more functions for the y-compressed fall-bands, as I call them. If you use the sum of the factors * powers, you get this:
x = n <= 7422, f(i) -= factpowsum(f(i)) → f(i) < 2
The factpowsum(n) is the sum of the factors multiplied by their powers. For example, 37692 = 2^2 * 3^3 * 349, so factpowsum(4188) = 2*2 + 3*3 + 349*1 = 362. Here’s factpowsum for more n:
x = n <= 14822, f(i) -= factpowsum(f(i)) → f(i) < 2
You can also use the very simple function f(i) -= 1, that is, compress the numbers from n to 1 into the y-gap. But if you do that, you’ll get a completely filled screen:
x = n <= 3722, f(i) -= 1 → f(i) = 0
So you can adjust the color of a pixel according to how many times it’s written to:
x = n <= 1862, f(i) -= 1 → f(i) = 0 (color-adjust)
The patterns in the colors are artifacts of the limited resolution of the screen, so I call these patterns strartifacts = strata + artifacts. Here’s another example:
x = n <= 3722, f(i) -= 1 → f(i) = 0 (color-adjust)
Or adjust the greytone of the pixel:
x = n <= 3722, f(i) -= 1 → f(i) = 0 (greytone-adjust)
And so on (in all cases, you can click for a larger image):

x = n <= 1862, f(i) -= blockmul(f(i)) (multiply run-lengths of same digits) → f(i) < 2
x is triangular(n) = 3 to 1734453, y is 1 < triangular numbers <= n
x = n <= , f(i) -= 1 → f(i) < 2
x = n <= 7442, f(i) -= 1 → f(i) < 2
x = n <= 1862, f(i) -= leaddig(f(i)) → f(i) < 2 # 1
x = n <= , f(i) -= leaddig(f(i)) → f(i) < 2 # 2
x = n <= , f(i) -= trailingdigit(f(i)) + 1 → f(i) < 2
x = n <= , f(i) -= trailingdigit(f(i) in base 5) + 3 → f(i) < 2
for triangular(n) = 3 to 6928503, f(i) -= primes → f(i) < 2
x = n <= 1862, f(i) -= blockmul(f(i) in base 5) (multiply run-lengths of same digits) → f(i) < 2
x = n <= 1862, f(i) -= blockmul(f(i) in base 2) → f(i) < 2
x = n <= 1862, f(i) -= digsum(f(i)) → f(i) < 2
x = n <= 3722, f(i) -= func(x = 1/4 → x < 0, x(1) = 4) → f(i) < 2
x = n <= 932, f(i) -= func(x -= 3/x → x < 0, x(1) = 6) → f(i) < 2









































