WhirlpUlam

Stanislaw Ulam (pronounced OO-lam) was an American mathematician who was doodling one day in 1963 and created what is now called the Ulam spiral. It’s a spiral of integers on a square grid with the prime squares filled in and the composite squares left empty. At the beginning it looks like this (the blue square is the integer 1, with 2 to the east, 3 to the north-east, 4 to the north, 5 to the north-west, 6 to the west, and so on):

Ulam spiral


And here’s an Ulam spiral with more integers:

Ulam spiral at higher resolution


The primes aren’t scattered at random over the spiral: they often fall into lines that are related to what are called polynomial functions, such as n2 + n + 1. To understand polynomial functions better, let’s look at how the Ulam spiral is made. Here is a text version with the primes underlined:


Here’s an animated version:


Here’s the true spiral again with 1 marked as a blue square:

Ulam spiral centred on 1


What happens when you try other numbers at the centre? Here’s 2 at the centre as a purple square, because it’s prime:

Ulam spiral centred on 2


And 3 at the centre, also purple because it’s also prime:

Ulam spiral centred on 3


And 4 at the centre, blue again because 4 = 2^2:

Ulam spiral centred on 4


And 5 at the centre, prime and purple:

Ulam spiral centred on 5


Each time the central number changes, the spiral shifts fractionally. Here’s an animation of the central number shifting from 1 to 41. If you watch, you’ll see patterns remaining stable, then breaking up as the numbers shift towards the center and disappear (the central number is purple if prime, blue if composite):

Ulam whirlpool, or WhirlpUlam


I think the animation looks like a whirlpool or whirlpUlam (prounced whirlpool-am), as numbers spiral towards the centre and disappear. You can see the whirlpUlam more clearly here:
An animated Ulam Spiral pausing at n=11, 17, 41


WhirlpUlam again


Note that something interesting happens when the central number is 41. The spiral is bisected by a long line of prime squares, like this:

Ulam spiral centred on 41


The line is actually a visual representation of something David Wells wrote about in The Penguin Dictionary of Curious and Interesting Numbers (1986):

Euler discovered the excellent and famous formula x2 + x + 41, which gives prime values for x = 0 to 39.

Here are the primes generated by the formula:

41, 43, 47, 53, 61, 71, 83, 97, 113, 131, 151, 173, 197, 223, 251, 281, 313, 347, 383, 421, 461, 503, 547, 593, 641, 691, 743, 797, 853, 911, 971, 1033, 1097, 1163, 1231, 1301, 1373, 1447, 1523, 1601

You’ll see other lines appear and disappear as the whirlpUlam whirls:

Ulam spiral centred on 17


Primes in line: 17, 19, 23, 29, 37, 47, 59, 73, 89, 107, 127, 149, 173, 199, 227, 257 (n=0..15)


Ulam spiral centred on 59


Primes in line: 59, 67, 83, 107, 139, 179, 227, 283, 347, 419, 499, 587, 683, 787 (n=0..13)


Ulam spiral centred on 163


Primes in line: 163, 167, 179, 199, 227, 263, 307, 359, 419, 487, 563, 647, 739, 839, 947, 1063, 1187, 1319, 1459, 1607 (n=0..19)


Ulam spiral centred on 233


Primes in line: 233, 241, 257, 281, 313, 353, 401, 457, 521, 593, 673, 761, 857 ((n=0..12)


Ulam spiral centred on 653


Primes in line: 653, 661, 677, 701, 733, 773, 821, 877, 941, 1013, 1093, 1181, 1277, 1381, 1493, 1613, 1741, 1877 (n=0..17)


Ulam spiral centred on 409,333


Primes in line: 409,333, 409337, 409349, 409369, 409397, 409433, 409477, 409529, 409589, 409657, 409733, 409817, 409909, 410009, 410117, 410233 (n=0..15)


Some bisect the centre, some don’t, because you could say that the Ulam spiral has six diagonals, two that bisect the centre (top-left-to-bottom-right and bottom-left-to-top-right) and four that don’t. You could also call them spokes:


If you look at the integers in the spokes, you can see that they’re generated by polynomial functions in which c stands for the central number:

North-west spoke: 1, 5, 17, 37, 65, 101, 145, 197, 257, 325, 401, 485, 577, 677, 785, 901, 1025, 1157, 1297, 1445, 1601, 1765, 1937, 2117, 2305, 2501, 2705, 2917... = c + (2n)^2


South-east spoke: 1, 9, 25, 49, 81, 121, 169, 225, 289, 361, 441, 529, 625, 729, 841, 961, 1089, 1225, 1369, 1521, 1681, 1849, 2025, 2209, 2401, 2601, 2809, 3025, 3249, 3481, 3721, 3969, 4225, 4489, 4761, 5041, 5329, 5625... = c+(2n+1)^2-1


NW-SE diagonal: 1, 5, 9, 17, 25, 37, 49, 65, 81, 101, 121, 145, 169, 197, 225, 257, 289, 325, 361, 401, 441, 485, 529, 577, 625, 677, 729, 785, 841, 901, 961, 1025, 1089, 1157, 1225, 1297, 1369, 1445, 1521, 1601, 1681 = c + n^2 + 1 - (n mod 2)


North-east spoke: 1, 3, 13, 31, 57, 91, 133, 183, 241, 307, 381, 463, 553, 651, 757, 871, 993, 1123, 1261, 1407, 1561, 1723, 1893, 2071... = c + (n+1)^2 - n - 1


South-west spoke: 1, 7, 21, 43, 73, 111, 157, 211, 273, 343, 421, 507, 601, 703, 813, 931, 1057, 1191, 1333, 1483, 1641, 1807, 1981, 2163... = c + (2n)^2 + 2n


SW-NE diagonal: 1, 3, 7, 13, 21, 31, 43, 57, 73, 91, 111, 133, 157, 183, 211, 241, 273, 307, 343, 381, 421, 463, 507, 553, 601, 651, 703, 757, 813, 871, 931, 993, 1057, 1123, 1191, 1261, 1333, 1407, 1483, 1561, 1641... = c + n^2 + n



Elsewhere other-engageable:

All posts interrogating issues around the Ulam spiral

Square on a Three String

222 A.D. was the year in which the Emperor Heliogabalus was assassinated by his own soldiers. Exactly 1666 years later, the Anglo-Dutch classicist Sir Lawrence Alma-Tadema exhibited his painting The Roses of Heliogabalus (1888). I suggested in “Roses Are Golden” that Alma-Tadema must have chosen the year as deliberately as he chose the dimensions of his canvas, which, at 52″ x 84 1/8“, is an excellent approximation to the golden ratio.

But did Alma-Tadema know that lines at 0º and 222º divide a circle in the golden ratio? He could easily have done, just as he could easily have known that 222 precedes the 48th prime, 223. But it is highly unlikely that he knew that 223 yields a magic square whose columns, rows and diagonals all sum to 222. To create the square, simply list the 222 multiples of the reciprocal 1/223 in base 3, or ternary. The digits of the reciprocal repeat after exactly 222 digits and its multiples begin and end like this:

001/223 = 0.00001002102101021212111012022211122022... in base 3
002/223 = 0.00002011211202120201222101122200021121...
003/223 = 0.00010021021010212121110120222111220221...
004/223 = 0.00011100200112011110221210022100120020...
005/223 = 0.00012110002220110100102222122012012120...

[...]

218/223 = 0.22210112220002112122120000100210210102... in base 3
219/223 = 0.22211122022110211112001012200122102202...
220/223 = 0.22212201201212010101112102000111002001...
221/223 = 0.22220211011020102021000121100022201101...
222/223 = 0.22221220120121201010111210200011100200...

Each column, row and diagonal of ternary digits sums to 222. Here is the full n/223 square represented with 0s in grey, 1s in white and 2s in red:

(Click for larger)


It isn’t difficult to see that the white squares are mirror-symmetrical on a horizontal axis. Here is the symmetrical pattern rotated by 90º:

(Click for larger)


But why should the 1s be symmetrical? This isn’t something special to 1/223, because it happens with prime reciprocals like 1/7 too:

1/7 = 0.010212... in base 3
2/7 = 0.021201...
3/7 = 0.102120...
4/7 = 0.120102...
5/7 = 0.201021...
6/7 = 0.212010...

And you can notice something else: 0s mirror 2s and 2s mirror 0s. A related pattern appears in base 10:

1/7 = 0.142857...
2/7 = 0.285714...
3/7 = 0.428571...
4/7 = 0.571428...
5/7 = 0.714285...
6/7 = 0.857142...

The digit 1 in the decimal digits of n/7 corresponds to the digit 8 in the decimal digits of (7-n)/7; 4 corresponds to 5; 2 corresponds to 7; 8 corresponds to 1; 5 corresponds to 4; and 7 corresponds to 2. In short, if you’re given the digits d1 of n/7, you know the digits d2 of (n-7)/7 by the rule d2 = 9-d1.

Why does that happen? Examine these sums:

 1/7 = 0.142857142857142857142857142857142857142857...
+6/7 = 0.857142857142857142857142857142857142857142...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

 2/7 = 0.285714285714285714285714285714285714285714...
+5/7 = 0.714285714285714285714285714285714285714285...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

 3/7 = 0.428571428571428571428571428571428571428571...
+4/7 = 0.571428571428571428571428571428571428571428...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

And here are the same sums in ternary (where the first seven integers are 1, 2, 10, 11, 12, 20, 21):

  1/21 = 0.010212010212010212010212010212010212010212...
+20/21 = 0.212010212010212010212010212010212010212010...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

  2/21 = 0.021201021201021201021201021201021201021201...
+12/21 = 0.201021201021201021201021201021201021201021...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

 10/21 = 0.102120102120102120102120102120102120102120...
+11/21 = 0.120102120102120102120102120102120102120102...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

Accordingly, in base b with the prime p, the digits d1 of n/p correspond to the digits (p-n)/p by the rule d2 = (b-1)-d1. This explains why the 1s mirror themselves in ternary: 1 = 2-1 = (3-1)-1. In base 5, the 2s mirror themselves by the rule 2 = 4-2 = (5-1) – 2. In all odd bases, some digit will mirror itself; in all even bases, no digit will. The mirror-digit will be equal to (b-1)/2, which is always an integer when b is odd, but never an integer when b is even.

Here are some more examples of the symmetrical patterns found in odd bases:

Patterns of 1s in 1/19 in base 3


Patterns of 6s in 1/19 in base 13


Patterns of 7s in 1/19 in base 15


Elsewhere other-posted:

Roses Are Golden — more on The Roses of Heliogabalus (1888)
Three Is The Key — more on the 1/223 square

Get Your Ox Off

Boustrophedon (pronounced “bough-stra-FEE-dun” or “boo-stra-FEE-dun”) is an ancient Greek word literally meaning “as the ox turns (in ploughing)”, that is, moving left-right, right-left, and so on. The word is used of writing that runs down the page in the same way. To see what that means, examine two versions of the first paragraph of Clark Ashton Smith’s story “The Demon of the Flower” (1933). The first is written in the usual way, the second is written boustrophedon:

Not as the plants and flowers of Earth, growing peacefully beneath a simple sun, were the blossoms of the planet Lophai. Coiling and uncoiling in double dawns; tossing tumultuously under vast suns of jade green and balas-ruby orange; swaying and weltering in rich twilights, in aurora-curtained nights, they resembled fields of rooted servants that dance eternally to an other-worldly music.


Not as the plants and flowers of Earth, growing peacefully
.iahpoL tenalp eht fo smossolb eht erew ,nus elpmis a htaeneb
Coiling and uncoiling in double dawns; tossing tumultuously
;egnaro ybur-salab dna neerg edaj fo snus tsav rednu
swaying and weltering in rich twilights, in aurora-curtained
ecnad taht stnavres detoor fo sdleif delbmeser yeht ,sthgin
eternally to an other-worldly music.


Boustrophedon writing was once common and sometimes the left-right lines would also be mirror-reversed, like this:
CAS_text1


You could also use the term “boustrophedon” to describe the way this table of numbers is filled:

primes_table


The table begins with “1” in the top left-hand corner, then moves right for “2”, then down for “3”, then right-and-up for “4”, “5” and “6”, then right for “7”, then left-and-down for “8”, “9” and “10”, and so on. You could also say that the numbers snake through the table. I’ve marked the primes among them, because I was interested in the patterns made by the primes when the numbers were represented as blocks on a grid, like this:

primes_large


Primes are in solid white (compare the Ulam spiral). Here’s the boustrophedon prime-grid on a finer scale:

primes

(click for full image)


And what about other number-tests? Here are the even numbers marked on the grid (i.e. n mod 2 = 0):

mod2

n mod 2 = 0


And here are some more examples of a modulus test:

mod3

n mod 3 = 0


mod5

n mod 5 = 0


mod9

n mod 9 = 0


mod15

n mod 15 = 0


mod_various

n mod various = 0 (animated gif)


Next I looked at reciprocals (numbers divided into 1) marked on the grid, with the digits of a reciprocal marking the number of blank squares before a square is filled in (if the digit is “0”, the square is filled immediately). For example, in base ten 1/7 = 0.142857142857142857…, where the block “142857” repeats for ever. When represented on the grid, 1/7 has 1 blank square, then a filled square, then 4 blank squares, then a filled square, then 2 blank squares, then a filled square, and so on:

recip7_base10

1/7 in base 10


And here are some more reciprocals (click for full images):

recip9_base2

1/9 in base 2


recip13_base10

1/13 in base 10


recip27_base10

1/27 in base 10


recip41_base10

1/41 in base 10


recip63_base10

1/63 in base 10


recip82_base10

1/82 in base 10


recip101_base10

1/101 in base 10


recip104_base10

1/104 in base 10


recip124_base10

1/124 in base 10


recip143_base10

1/143 in base 10


recip175_base10

1/175 in base 10


recip604_base8

1/604 in base 8


recip_various

1/n in various bases (animated gif)


Talcum Power

If primes are like diamonds, powers of 2 are like talc. Primes don’t crumble under division, because they can’t be divided by any number but themselves and one. Powers of 2 crumble more than any other numbers. The contrast is particularly strong when the primes are Mersenne primes, or equal to a power of 2 minus 1:

3 = 4-1 = 2^2 – 1.
4, 2, 1.

7 = 8-1 = 2^3 – 1.
8, 4, 2, 1.

31 = 32-1 = 2^5 – 1.
32, 16, 8, 4, 2, 1.

127 = 2^7 – 1.
128, 64, 32, 16, 8, 4, 2, 1.

8191 = 2^13 – 1.
8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1.

131071 = 2^17 – 1.
131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1.

524287 = 2^19 – 1.
524288, 262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1.

2147483647 = 2^31 – 1.
2147483648, 1073741824, 536870912, 268435456, 134217728, 67108864, 33554432, 16777216, 8388608, 4194304, 2097152, 1048576, 524288, 262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1.

Are Mersenne primes infinite? If they are, then there will be just as many Mersenne primes as powers of 2, even though very few powers of 2 create a Mersenne prime. That’s one of the paradoxes of infinity: an infinite part is equal to an infinite whole.

But are they infinite? No-one knows, though some of the greatest mathematicians in history have tried to find a proof or disproof of the conjecture. A simpler question about powers of 2 is this: Does every integer appear as part of a power of 2? I can’t find one that doesn’t:

0 is in 1024 = 2^10.
1 is in 16 = 2^4.
2 is in 32 = 2^5.
3 is in 32 = 2^5.
4 = 2^2.
5 is in 256 = 2^8.
6 is in 16 = 2^4.
7 is in 32768 = 2^15.
8 = 2^3.
9 is in 4096 = 2^12.
10 is in 1024 = 2^10.
11 is in 1099511627776 = 2^40.
12 is in 128 = 2^7.
13 is in 131072 = 2^17.
14 is in 262144 = 2^18.
15 is in 2097152 = 2^21.
16 = 2^4.
17 is in 134217728 = 2^27.
18 is in 1073741824 = 2^30.
19 is in 8192 = 2^13.
20 is in 2048 = 2^11.

666 is in 182687704666362864775460604089535377456991567872 = 2^157.
1066 is in 43556142965880123323311949751266331066368 = 2^135.
1492 is in 356811923176489970264571492362373784095686656 = 2^148.
2014 is in 3705346855594118253554271520278013051304639509300498049262642688253220148477952 = 2^261.

I’ve tested much higher than that, but testing is no good: where’s a proof? I don’t have one, though I conjecture that all integers do appear as part or whole of a power of 2. Nor do I have a proof for another conjecture: that all integers appear infinitely often as part or whole of powers of 2. Or indeed, of powers of 3, 4, 5 or any other number except powers of 10.

I conjecture that this would apply in all bases too: In any base b all n appear infinitely often as part or whole of powers of any number except those equal to a power of b.

1 is in 11 = 2^2 in base 3.
2 is in 22 = 2^3 in base 3.
10 is in 1012 = 2^5 in base 3.
11 = 2^2 in base 3.
12 is in 121 = 2^4 in base 3.
20 is in 11202 = 2^7 in base 3.
21 is in 121 = 2^4 in base 3.
22 = 2^3 in base 3.
100 is in 100111 = 2^8 in base 3.
101 is in 1012 = 2^5 in base 3.
102 is in 2210212 = 2^11 in base 3.
110 is in 1101221 = 2^10 in base 3.
111 is in 100111 = 2^8 in base 3.
112 is in 11202 = 2^7 in base 3.
120 is in 11202 = 2^7 in base 3.
121 = 2^4 in base 3.
122 is in 1101221 = 2^10 in base 3.
200 is in 200222 = 2^9 in base 3.
201 is in 12121201 = 2^12 in base 3.
202 is in 11202 = 2^7 in base 3.

1 is in 13 = 2^3 in base 5.
2 is in 112 = 2^5 in base 5.
3 is in 13 = 2^3 in base 5.
4 = 2^2 in base 5.
10 is in 1003 = 2^7 in base 5.
11 is in 112 = 2^5 in base 5.
12 is in 112 = 2^5 in base 5.
13 = 2^3 in base 5.
14 is in 31143 = 2^11 in base 5.
20 is in 2011 = 2^8 in base 5.
21 is in 4044121 = 2^16 in base 5.
22 is in 224 = 2^6 in base 5.
23 is in 112341 = 2^12 in base 5.
24 is in 224 = 2^6 in base 5.
30 is in 13044 = 2^10 in base 5.
31 = 2^4 in base 5.
32 is in 230232 = 2^13 in base 5.
33 is in 2022033 = 2^15 in base 5.
34 is in 112341 = 2^12 in base 5.
40 is in 4022 = 2^9 in base 5.

1 is in 12 = 2^3 in base 6.
2 is in 12 = 2^3 in base 6.
3 is in 332 = 2^7 in base 6.
4 = 2^2 in base 6.
5 is in 52 = 2^5 in base 6.
10 is in 1104 = 2^8 in base 6.
11 is in 1104 = 2^8 in base 6.
12 = 2^3 in base 6.
13 is in 13252 = 2^11 in base 6.
14 is in 144 = 2^6 in base 6.
15 is in 101532 = 2^13 in base 6.
20 is in 203504 = 2^14 in base 6.
21 is in 2212 = 2^9 in base 6.
22 is in 2212 = 2^9 in base 6.
23 is in 1223224 = 2^16 in base 6.
24 = 2^4 in base 6.
25 is in 13252 = 2^11 in base 6.
30 is in 30544 = 2^12 in base 6.
31 is in 15123132 = 2^19 in base 6.
32 is in 332 = 2^7 in base 6.

1 is in 11 = 2^3 in base 7.
2 is in 22 = 2^4 in base 7.
3 is in 1331 = 2^9 in base 7.
4 = 2^2 in base 7.
5 is in 514 = 2^8 in base 7.
6 is in 2662 = 2^10 in base 7.
10 is in 1054064 = 2^17 in base 7.
11 = 2^3 in base 7.
12 is in 121 = 2^6 in base 7.
13 is in 1331 = 2^9 in base 7.
14 is in 514 = 2^8 in base 7.
15 is in 35415440431 = 2^30 in base 7.
16 is in 164351 = 2^15 in base 7.
20 is in 362032 = 2^16 in base 7.
21 is in 121 = 2^6 in base 7.
22 = 2^4 in base 7.
23 is in 4312352 = 2^19 in base 7.
24 is in 242 = 2^7 in base 7.
25 is in 11625034 = 2^20 in base 7.
26 is in 2662 = 2^10 in base 7.

1 is in 17 = 2^4 in base 9.
2 is in 152 = 2^7 in base 9.
3 is in 35 = 2^5 in base 9.
4 = 2^2 in base 9.
5 is in 35 = 2^5 in base 9.
6 is in 628 = 2^9 in base 9.
7 is in 17 = 2^4 in base 9.
8 = 2^3 in base 9.
10 is in 108807 = 2^16 in base 9.
11 is in 34511011 = 2^24 in base 9.
12 is in 12212 = 2^13 in base 9.
13 is in 1357 = 2^10 in base 9.
14 is in 314 = 2^8 in base 9.
15 is in 152 = 2^7 in base 9.
16 is in 878162 = 2^19 in base 9.
17 = 2^4 in base 9.
18 is in 218715 = 2^17 in base 9.
20 is in 70122022 = 2^25 in base 9.
21 is in 12212 = 2^13 in base 9.
22 is in 12212 = 2^13 in base 9.

Prime Climb Time

The third prime is equal to the sum of the first and second primes: 2 + 3 = 5. After that, for obvious reasons, the prime-sum climbs much more rapidly than the primes themselves:

2, 3, 05, 07, 11, 13, 17, 19, 023, 029...
2, 5, 10, 17, 28, 41, 58, 77, 100, 129...

But what if you use digit-sum(p1..pn), i.e., the sum of the digits of the primes from the first to the nth? For example, the digit-sum(p1..p5) = 2 + 3 + 5 + 7 + 1+1 = 19, whereas the sum(p1..p5) = 2 + 3 + 5 + 7 + 11 = 28. Using the digit-sums of the primes, the comparison now looks like this:

2, 3, 05, 07, 11, 13, 17, 19, 23, 29...
2, 5, 10, 17, 19, 23, 31, 41, 46, 57...

The sum climbs more slowly, but still too fast. So what about a different base? In base-2, the digit-sum(p1..p3) = (1+0) + (1+1) + (1+0+1) = 1 + 2 + 2 = 5. The comparison looks like this:

2, 3, 05, 07, 11, 13, 17, 19, 23, 29...
1, 3, 05, 08, 11, 14, 16, 19, 23, 27...

For primes 3, 5, 11, 19, and 23, p = digit-sum(primes <= p) in base-2. But the cumulative digit-sum soon begins to climb too slowly:

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271...

1, 3, 5, 8, 11, 14, 16, 19, 23, 27, 32, 35, 38, 42, 47, 51, 56, 61, 64, 68, 71, 76, 80, 84, 87, 091, 096, 101, 106, 110, 117, 120, 123, 127, 131, 136, 141, 145, 150, 155, 160, 165, 172, 175, 179, 184, 189, 196, 201, 206, 211, 218, 223, 230, 232, 236, 240, 245...

So what about base-3?

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59...
2, 3, 6, 9, 12, 15, 20, 23, 28, 31, 34, 37, 42, 47, 52, 59, 64...

In base-3, for p = 2, 3 and 37, p = digit-sum(primes <= p), while for p = 23, 31, 47 and 59, p = digit-sum(primes < p), like this:

2 = 2.
3 = 2 + (1+0).
37 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) + (2+1+2) + (1+0+0+2) + (1+0+1+1) + (1+1+0+1) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3 + 5 + 3 + 3 + 3.

23 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3.
31 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) + (2+1+2) + (1+0+0+2) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3 + 5 + 3.
47 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) + (2+1+2) + (1+0+0+2) + (1+0+1+1) + (1+1+0+1) + (1+1+1+2) + (1+1+2+1) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3 + 5 + 3 + 3 + 3 + 5 + 5.
59 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) + (2+1+2) + (1+0+0+2) + (1+0+1+1) + (1+1+0+1) + (1+1+1+2) + (1+1+2+1) + (1+2+0+2) + (1+2+2+2) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3 + 5 + 3 + 3 + 3 + 5 + 5 + 5 + 7.

This carries on for a long time. For these primes, p = digit-sum(primes < p):

23, 31, 47, 59, 695689, 698471, 883517, 992609, 992737, 993037, 1314239, 1324361, 1324571, 1326511, 1327289, 1766291, 3174029

And for these primes, p = digit-sum(primes <= p):

3, 37, 695663, 695881, 1308731, 1308757, 1313153, 1314301, 1326097, 1766227, 3204779, 14328191

Now try the cumulative digit-sum in base-4:

2, 3, 5, 07, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59...
2, 5, 7, 11, 16, 20, 22, 26, 31, 36, 43, 47, 52, 59, 67, 72, 80... 

The sum of digits climbs too fast. Base-3 is the Goldilocks base, climbing neither too slowly, like base-2, nor too fast, like all bases greater than 3.

Prime Time #2

“2n2 + 29 is prime for all values of n for 1 to 28.” — The Penguin Dictionary of Curious and Interesting Numbers, David Wells (1986).

• 31, 37, 47, 61, 79, 101, 127, 157, 191, 229, 271, 317, 367, 421, 479, 541, 607, 677, 751, 829, 911, 997, 1087, 1181, 1279, 1381, 1487, 1597.


Elsewhere other-posted:

Prime Time #1
Poulet’s Propellor — Musings on Math and Mathculinity
La Spirale è Mobile

Lat’s That

In a magic square of numbers, all rows, columns and diagonals have the same sum, or magic total. Here is an example:

1*5*9
8*3*4
6*7*2

(mt=15)

Here’s another:

06*07*11*10
15*02*14*03
04*13*01*16
09*12*08*05

(mt=34)

And another:

04*25*20*10*06
01*13*11*21*19
23*09*07*08*18
15*16*03*14*17
22*02*24*12*05

(mt=65)

And another:

35*15*10*18*11*22
05*25*33*12*07*29
34*30*04*14*21*08
02*16*27*17*23*26
03*24*09*19*36*20
32*01*28*31*13*06

(mt=111)

In all those magic squares, the magic total is fixed: the sum of all numbers from 1 to 36 is 666, so any individual line in a 6×6 magic square has to equal 666 / 6 or 111. In other kinds of magic figure, this rule doesn’t apply:

2*7*3
4***8
6*5*1

(mt=12)

6*3*4
2***8
5*7*1

(mt=13)

8*5*1
2***6
4*3*7

(mt=14)

8*1*6
4***2
3*5*7

(mt=15)

Continue reading Lat’s That

Priamonds and Pearls

Interesting patterns emerge when primes are represented as white blocks in a series of n-width left-right lines laid vertically, one atop the other. When the line is five blocks wide, the patterns look like this (the first green block is 1, followed by primes 2, 3 and 5, then 7 in the next line):
5line

(Click for larger version)

Right at the bottom of the first column is an isolated prime diamond, or priamond (marked with a green block). It consists of the four primes 307-311-313-317, where the three latter primes equal 307 + 4 and 6 and 10, or 307 + 5-1, 5+1 and 5×2 (the last prime in the first column is 331 and the first prime in the second is 337). About a third of the way down the first column is a double priamond, consisting of 97, 101, 103, 107, 109 and 113. For a given n, then, a priamond is a set of primes, p1, p2, p3 and p4, such that p2 = p1 + n-1, p3 = p + n+1 and p4 = p1 + 2n.

There are also fragments of pearl-necklace in the columns. One is above the isolated priamond. It consists of four prime-blocks slanting from left to right: 251-257-263-269, or 251 + 6, 12 and 18. A prearl-necklace, then, is a set of primes, p1, p2, p3…, such that p2 = p1 + n+i, p3 = p + 2(n+i)…, where i = +/-1. Now here are the 7-line and 9-line:

7line

Above: 7-line for primes

9line

Above: 9-line for primes

In the 9-line, you can see a prime-ladder marked with a red block. It consists of the primes 43-53-61-71-79-89-97-107, in alternate increments of 10 and 8, or 9+1 and 9-1. A prime-ladder, then, is a set of primes, p1, p2, p3, p4…, such that p2 = p1 + n+1, p3 = p + 2n, p3 = p + 3n+1…

And here is an animated gif of lines 5 through 51:

lines5to51

(Click or open in new window for larger version or if file fails to animate)

Prime Time

1/29[b=2] = 0·0000100011010011110111001011… (l=28)
1/29[b=3] = 0·0002210102011122200121202111… (l=28)
1/29[b=5] = 0·00412334403211… (l=14)
1/29[b=7] = 0·0145536… (l=7)
1/29[b=11] = 0·04199534608387[10]69115764[10]2723… (l=28)
1/29[b=13] = 0·05[10]9[11]28[12]7231[10]4… (l=14)
1/29[b=17] = 0·09[16]7… (l=4)
1/29[b=19] = 0·0[12]89[15][13][14]7[16]73[17][13]1[18]6[10]9354[11]2[11][15]15[17]… (l=28)
1/29[b=23] = 0·0[18]5[12][15][19][19]… (l=7)
1/29[b=29] = 0·1 (l=1)
1/29[b=31] = 0·1248[17]36[12][25][20]9[19]7[14][29][28][26][22][13][27][24][18]5[10][21][11][23][16]… (l=28)
1/29[b=37] = 0·1[10]7[24]8[34][16][21][25][19]53[30][22][35][26][29][12][28]2[20][15][11][17][31][33]6[14]… (l=28)
1/29[b=41] = 0·1[16][39][24]… (l=4)
1/29[b=43] = 0·1[20][32][26][29][28]7[17][34]4[19][11][37]2[41][22][10][16][13][14][35][25]8[38][23][31]5[40]… (l=28)
1/29[b=47] = 0·1[29]84[40][24][14][27][25][43][35][30][37][12][45][17][38][42]6[22][32][19][21]3[11][16]9[34]… (l=28)
1/29[b=53] = 0·1[43][45][36][29][12][42]… (l=7)
1/29[b=59] = 0·2… (l=1)
1/29[b=61] = 0·26[18][56][48][23]8[25][14][44][10][31][33][39][58][54][42]4[12][37][52][35][46][16][50][29][27][21]… (l=28)
1/29[b=67] = 0·2[20][53]9[16][11][36][64][46][13][57][50][55][30]… (l=14)
1/29[b=71] = 0·2[31][58][53][61][14][48][68][39][12][17]9[56][22]… (l=14)
1/29[b=73] = 0·2[37][55][27][50][25][12][42][57][65][32][52][62][67][70][35][17][45][22][47][60][30][15]7[40][20][10]5… (l=28)
1/29[b=79] = 0·2[57][16][27][19]5[35][32][54][38][10][70][65][29][76][21][62][51][59][73][43][46][24][40][68]8[13][49]… (l=28)
1/29[b=83] = 0·2[71][45][65][68][57][20]… (l=7)
1/29[b=89] = 0·36[12][24][49]9[18][36][73][58][27][55][21][42][85][82][76][64][39][79][70][52][15][30][61][33][67][46]… (l=28)
1/29[b=97] = 0·3[33][43][46][80][26][73][56][83][60][20]6[66][86][93][63][53][50][16][70][23][40][13][36][76][90][30][10]… (l=28)

More Narcissisum

The number 23 is special, inter alia, because it’s prime, divisible by only itself and 1. It’s also special because its reciprocal has maximum period. That is, the digits of 1/23 come in repeated blocks of 22, like this:

1/23 = 0·0434782608695652173913  0434782608695652173913  0434782608695652173913…

But 1/23 fails to be special in another way: you can’t sum its digits and get 23:

0 + 4 + 3 + 4 + 7 = 18
0 + 4 + 3 + 4 + 7 + 8 = 26
0 + 4 + 3 + 4 + 7 + 8 + 2 + 6 + 0 + 8 + 6 + 9 + 5 + 6 + 5 + 2 + 1 + 7 + 3 + 9 + 1 + 3 = 99

1/7 is different:

1/7 = 0·142857… → 1 + 4 + 2 = 7

This means that 7 is narcissistic: it reflects itself by manipulation of the digits of 1/7. But that’s in base ten. If you try base eight, 23 becomes narcissistic too (note that 23 = 2 x 8 + 7, so 23 in base eight is 27):

1/27 = 0·02620544131… → 0 + 2 + 6 + 2 + 0 + 5 + 4 + 4 = 27 (base=8)

Here are more narcissistic reciprocals in base ten:

1/3 = 0·3… → 3 = 3
1/7 = 0·142857… → 1 + 4 + 2 = 7
1/8 = 0·125 → 1 + 2 + 5 = 8
1/13 = 0·076923… → 0 + 7 + 6 = 13
1/14 = 0·0714285… → 0 + 7 + 1 + 4 + 2 = 14
1/34 = 0·02941176470588235… → 0 + 2 + 9 + 4 + 1 + 1 + 7 + 6 + 4 = 34
1/43 = 0·023255813953488372093… → 0 + 2 + 3 + 2 + 5 + 5 + 8 + 1 + 3 + 9 + 5 = 43
1/49 = 0·020408163265306122448979591836734693877551… → 0 + 2 + 0 + 4 + 0 + 8 + 1 + 6 + 3 + 2 + 6 + 5 + 3 + 0 + 6 + 1 + 2 = 49
1/51 = 0·0196078431372549… → 0 + 1 + 9 + 6 + 0 + 7 + 8 + 4 + 3 + 1 + 3 + 7 + 2 = 51
1/76 = 0·01315789473684210526… → 0 + 1 + 3 + 1 + 5 + 7 + 8 + 9 + 4 + 7 + 3 + 6 + 8 + 4 + 2 + 1 + 0 + 5 + 2 = 76
1/83 = 0·01204819277108433734939759036144578313253… → 0 + 1 + 2 + 0 + 4 + 8 + 1 + 9 + 2 + 7 + 7 + 1 + 0 + 8 + 4 + 3 + 3 + 7 + 3 + 4 + 9 = 83
1/92 = 0·010869565217391304347826… → 0 + 1 + 0 + 8 + 6 + 9 + 5 + 6 + 5 + 2 + 1 + 7 + 3 + 9 + 1 + 3 + 0 + 4 + 3 + 4 + 7 + 8 = 92
1/94 = 0·01063829787234042553191489361702127659574468085… → 0 + 1 + 0 + 6 + 3 + 8 + 2 + 9 + 7 + 8 + 7 + 2 + 3 + 4 + 0 + 4 + 2 + 5 + 5 + 3 + 1 + 9 + 1 + 4 = 94
1/98 = 0·0102040816326530612244897959183673469387755… → 0 + 1 + 0 + 2 + 0 + 4 + 0 + 8 + 1 + 6 + 3 + 2 + 6 + 5 + 3 + 0 + 6 + 1 + 2 + 2 + 4 + 4 + 8 + 9 + 7 + 9 + 5 = 98


Previously pre-posted (please peruse):

Digital Disfunction
The Hill to Power
Narcissarithmetic #1
Narcissarithmetic #2