What’s the next number in this sequence of integers?

5, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55... (A227793 at the OEIS)

It shouldn’t be hard to work out that it’s 64 — the sum-of-digits of *n* is divisible by 5, i.e., digsum(n) mod 5 = 0. Now try summing the numbers in that sequence:

5 + 14 = 19

19 + 19 = 38

38 + 23 = 61

61 + 28 = 89

89 + 32 = 121

121 + 37 = 158

158 + 41 = 199

199 + 46 = 245

[...]

Here are the cumulative sums as another sequence:

5, 19, 38, 61, 89, 121, 158, 199, 245, 295, 350, 414, 483, 556, 634, 716, 803, 894, 990, 1094, 1203, 1316, 1434, 1556, 1683, 1814, 1950, 2090, 2235, 2389, 2548, 2711, 2879, 3051, 3228, 3409, 3595, 3785, 3980, 4183, 4391, 4603, 4820, 5041, 5267, 5497, 5732, 5976, 6225...

And there’s that cumulative-sum sequence represented as a spiral:

Spiral for cumulative sum of *n* where digsum(*n*) mod 5 = 0

You can see how the spiral is created by following 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E… from the center:

ZYXWVU

GFEDCT

H432BS

I501AR

J6789Q

KLMNOP

What about other values for the cumulative sums of digsum(*n*) mod *m* = 0? Here’s *m* = 2,3,4,5,6,7:

Spiral for cumulative sum of *n* where digsum(*n*) mod 2 = 0

s1 = 2, 4, 6, 8, 11, 13, 15, 17, 19, 20, 22…

s2 = 2, 6, 12, 20, 31, 44, 59, 76, 95, 115… (cumulative sum of s1)

sum of digsum(*n*) mod 3 = 0

s1 = 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33…

s2 = 3, 9, 18, 30, 45, 63, 84, 108, 135, 165…

sum of digsum(*n*) mod 4 = 0

s1 = 4, 8, 13, 17, 22, 26, 31, 35, 39, 40, 44…

s2 = 4, 12, 25, 42, 64, 90, 121, 156, 195, 235…

sum of digsum(*n*) mod 5 = 0

s1 = 5, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55…

s2 = 5, 19, 38, 61, 89, 121, 158, 199, 245, 295…

sum of digsum(*n*) mod 6 = 0

s1 = 6, 15, 24, 33, 39, 42, 48, 51, 57, 60, 66…

s2 = 6, 21, 45, 78, 117, 159, 207, 258, 315, 375…

sum of digsum(*n*) mod 7 = 0

s1 = 7, 16, 25, 34, 43, 52, 59, 61, 68, 70, 77…

s2 = 7, 23, 48, 82, 125, 177, 236, 297, 365, 435…

The spiral for *m* = 2 is strange, but the spirals are similar after that. Until *m* = 8, when something strange happens again:

sum of digsum(*n*) mod 8 = 0

s1 = 8, 17, 26, 35, 44, 53, 62, 71, 79, 80, 88…

s2 = 8, 25, 51, 86, 130, 183, 245, 316, 395, 475…

Then the spirals return to normal for *m* = 9, 10:

sum of digsum(*n*) mod 9 = 0

s1 = 9, 18, 27, 36, 45, 54, 63, 72, 81, 90, 99…

s2 = 9, 27, 54, 90, 135, 189, 252, 324, 405, 495…

sum of digsum(*n*) mod 10 = 0

s1 = 19, 28, 37, 46, 55, 64, 73, 82, 91, 109, 118…

s2 = 19, 47, 84, 130, 185, 249, 322, 404, 495, 604…

Here’s an animated gif of *m* = 8 at higher and higher resolution:

sum of digsum(*n*) mod 8 = 0 (animated gif)

You might think this strange behavior is dependant on the base in which the dig-sum is calculated. It isn’t. Here’s an animated gif for other bases in which the mod-8 spiral behaves strangely:

sum of digsum(*n*) mod 8 = 0 in base *b* = 5, 6, 7, 9, 11, 12, 13 (animated gif)

But the mod-8 spiral stops behaving strangely when the spiral is like this, as a diamond:

W

XIV

YJ8HU

ZK927GT

LA3016FS

MB45ER

NCDQ

OP

Now the mod-8 spiral looks like this:

sum of digsum(*n*) mod 8 = 0 (diamond spiral)

But the mod-4 and mod-9 spirals look like this:

sum of digsum(*n*) mod 4 = 0 (diamond spiral)

sum of digsum(*n*) mod 9 = 0 (diamond spiral)

You can also construct the spirals as a triangle, like this:

U

VCT

WD2CS

XE301AR

YF456789Q

ZGHIJKLMNOP

Here’s the beginning of the mod-5 triangular spiral:

sum of digsum(*n*) mod 5 = 0 (triangular spiral) (open in new window for full size)

And the beginning of the mod-8 triangular spiral:

sum of digsum(*n*) mod 8 = 0 (triangular spiral) (open in new window for full size)

The mod-8 spiral is behaving strangely again. So the strangeness is partly an artefact of the way the spirals are constructed.

**Post-Performative Post-Scriptum**

“Spiral Artefact”, the title of this incendiary intervention, is of course a tip-of-the-hat to core Black-Sabbath track “Spiral Architect”, off core Black-Sabbath album *Sabbath Bloody Sabbath*, issued in core Black-Sabbath success-period of 1973.