Boring Math (11.0)

This isn't math, it's algorithms, but I think I figured out how to make my out-of-place hierarchysort cache-agnostic (e.g. L1 cache). Hierarchysort is a type of mergesort.

The basic idea is to have three interlaced lines (top, middle, bottom). When going forward the top and middle are used; when going backwards the bottom and middle are used.
...

Boring Math (11.0)

...

You backtrack when you run out of elements to merge and act as if there are you are starting from scratch on the middle and bottom tracks going in the opposite direction. When you get to the end you should have double the space to the left by virtue of how things are set up.

If you did it naively you would still run out of space, which is why you need to start from the middle of the out-of-place auxilliary memory.

You basically zig-zag around the center, bigger & bigger.

Boring Math (11.0)

I am basically positive this algorithm provides 1 fewer cache miss (at least ln(n) fewer) but I don't know if it works recursively properly because ideally it should provide 0 cache misses after the first cache line is read.

I'm wondering if you can do it with 3-4 Interlaced sequences or I'm making a logical mis-step.

You fundamentally need to have a bunch of detached tetris pieces and jam them together, and the question is: "Does the zig-zagging work / accumulate properly?"

Boring Math (11.0)

I would think there's a mathematical way to map it with 4 Interlaced sequences and the concept of /ones' complement/ in binary. The forward direction is the normal unsigned binary string and the backwards direction is the ones' complement negative binary.

Boring Math (11.0)

I am thinking of

{2, 3, 5, 7, 13, 17, 19... } -- oeis.org/A000043

And

{3, 5, 7, 11, 13, 17, 19, 23... } -- oeis.org/A000978

Particularly up to 24, which notably omit {11, 23} & {2}. The counts are 7 & 8 (total elements <= 23).

Boring Math (11.0)

Looking at

factor {2, 4, 6, 12, 16, 18, 30, 60, 126}

There's:

1 power of 7
2 powers of 5
6 powers of 3
9 powers of 2

Which I was mostly curious about because 1 = 1!, 2 = 2!, 6 = 3!

Which would imply something like 3.31209... based on the solution to gamma(n+1) = 9

Boring Math (11.0)

π root of 63 x^3 + 824 x^2 - 4398 x + 3647 near x = 1.05427≈3.3120972978664913634

Seems relevant to me

Or at least interesting.

Boring Math (11.0)

Also, based on the 41st Mersenne and Wagstaff exponents, I wonder if the ratio of these series is asymptotically 6:

24036583/4031399 ~= 6

Boring Math (11.0)

Actually, wait, the 30th values are nowhere near 6:

132,049÷42,737 ~= 3

Boring Math (11.0)

The ratios themselves are interesting:

{2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203}/{3, 5, 7, 11, 13, 17, 19, 23, 31, 43, 61, 79, 101, 127, 167, 191}

The first 4 are less than 1
The next 3 are equal to 1
The next 5 are between 1 and 89/43
The rest seem larger so far.

Boring Math (11.0)

This leads to the observation that 89/43 = (8*11+1)/(4*11-1)

197 - 16*11 = 21 ~= 22
16*11 - 137 = 37
197 - 137 = 58

a la the "class 2 Heegner numbers"

Boring Math (11.0)

I think the first four Wagstaff primes are the most interesting:

3, 11, 43, 683...

3 = Heegner
11 = Heegner
43 = Heegner
683 = (Ibrishimova-1)/2

Boring Math (11.0)

I don't know if I mentioned I read this a week or so ago:

en.m.wikipedia.org/wiki/Mersen

It's certainly interesting.

Boring Math (11.0)

I didn't even realize I subconsciously re-found something I read:

en.m.wikipedia.org/wiki/Mersen

And

oeis.org/A107360

Boring Math (11.0)

{3, 5, 7, 13, 17, 19, 31, 61, 127}^2 - 6

The first 5 are prime, which I imagine would relate to the Fermat primes:

3 <-> 3
19 <-> 5
43 <-> 17
163 <-> 257
283 <-> 65537

Boring Math (11.0)

This leaves

{3, 19, 43, 163, 283, 355, 955, 3715, 16123}

Multiples of 5: {71,191,743}
Multiple of 23: {701}

Boring Math (11.0)

pi function({3,19,43,163,283,71,191,743,701})

-->

{2, 8, 14, 38, 61, 20, 43, 132, 126}

2657 = (15/4)*prime(2^7 - 1) - 7/4

Boring Math (11.0)

pi function({3,19,43,163,283,71,191,743,701})

-->

{2, 8, 14, 38, 61, 20, 43, 132, 126}

~=

{1, 9, 16, 36, 58, 22, 37, 127, 127}

Boring Math (11.0)

sqrt(pi function({1,2,3,7,11,19,43,67,163}))

-->

{0, 1, 1.41421, 2, 2.23607, 2.82843, 3.74166, 4.3589, 6.16441}

Which may imply 1, 2, and 7 are special.

Boring Math (11.0)

I have a theory that

2657/prime(7^2-7/4) ~= 12

When extrapolating / interpolating

Boring Math (11.0)

Oh, cool, I forgot this is essentially solvable and I'm correct- ish:

2657/prime(7^2-7/4) ~= 12

prime(7^2-7/4) ~= 2657/12

7^2-7/4 ~= pi function(2657/12)

And

7^2-2 = pi function(2657/12)

Boring Math (11.0)

prime(23)*x = 2657

--> x~=32

prime(24)*x = 2657

--> x~=30

Boring Math (11.0)

The prior was based on:

(3^2-1) = pi function(2657/120)
(7^2-2) = pi function(2657/12)

15 = 3*5
31 ~= 3^(3/2)*6
63 = 3^2*7

Boring Math (11.0)

sqrt(pi function({1,2,3,7,11,19,43,67,163}))

-->

{0, 1, sqrt(2), 2, sqrt(5), sqrt(8), sqrt(14), sqrt(19), sqrt(38)}

{0, 1, 2}

sqrt({5, 8}) --> 4 + 1, 9 - 1; (8 - 5) + 1 = 4, (8 + 5) + 3 = 16

sqrt({2, 19}) --> ?

sqrt({14, 38}) --> 16 - 2, 36 + 2; (38 - 14) + 1 = 25, (38 + 14) - 3 = 49

Boring Math (11.0)

2+19 = 22 - 1
2*19 = 37 + 1
2<*>19 ?= 58 // can't find an operator

Boring Math (11.0)

19*2^e ~= 5^3
19*2^pi ~= 13^2

Boring Math (11.0)

(19*2^pi - 13^2)/(19*2^e - 5^3) ~= -36

Boring Math (11.0)

(7)^(23/9) ~= 12^2

Which has interesting complex roots as well.

Boring Math (11.0)

I just realized

19*2^((e+pi)/2) ~= 144.79...
19*2^((e*pi)^.5) ~= 144.02...

So it checks out pretty well with the previous idea.

Boring Math (11.0)

(19^2 + 2)/3 = 11^2
(12^2 + 1/2)*2 = 17^2

Which I'm gonna try to relate back to 12 & 19 in music theory.

Boring Math (11.0)

((15.5^2)*(2/3))-14^2 ~= -36

Boring Math (11.0)

(36 - (19*2^pi - 13^2)/(19*2^e - 5^3))/6 ~= 12

Boring Math (11.0)

2657 = 2000*2^(-e + π) - 5^2

Boring Math (11.0)

19*2^2.6854520010653064453097 ~= 122.2236...
19*2^3.2758229187218111597876 ~= 184.0240...

Boring Math (11.0)

For the above, the values are essentially 11^2 + epsilon & (17/2)^2 + epsilon, which sort of relates back to:

(19^2 + 2)/3 = 11^2
(12^2 + 1/2)*2 = 17^2

Boring Math (11.0)

factor 14^4-prime(3^4) --> 37997
factor 15^4-prime(6^4) --> 39998 = 2*7*2857

Boring Math (11.0)

28,30,34,43,67,163,953...

Which is based on

floor(sqrt(k*28)), k=163

Exploration is like:

floor(sqrt(k*28)), k=32437
floor(sqrt(k*28)), k=32504

primes near 32470 (7 candidates)

Boring Math (11.0)

a(n+1) = floor(sqrt(a(n)*163)), a(0)=28

n | a(n)
0 | 28
1 | 67
2 | 104
3 | 130
4 | 145
5 | 153
6 | 157
7 | 159
8 | 160
9 | 161

Where 67, 130, 145, 157 are of interest to me, particularly in the context of

math.stackexchange.com/questio

Boring Math (11.0)

I'm thinking 145 & 34 are the relevant ones here:

(6^2 - 2)/2 = 17
(12^2 + 1/2)*2 = 17^2

Which may imply 17 is relevant to music theory.

en.m.wikipedia.org/wiki/34_equ

Boring Math (11.0)

So I'm thinking 72, 77, 80 is relevant here, for:

9^2, 80 for 12 notes
5^2, 24/"72" for 17 notes

Boring Math (11.0)

{3, 5, 7, 13, 17, 19, 31, 61, 127 }

2^n - 3 = p --> {3, 4, 6} | {5, 13, 61}
2^n - 1 = p --> {2, 3, 5, 7} | {3, 7, 31, 127}
2^n + 1 = p --> {1, 2, 4} | {3, 5, 17}
2^n + 3 = p --> {-inf, 1, 2, 4} | {3, 5, 7, 19}

3 occurs 3x
5 occurs 3x
7 occurs 2x
All other terms occur 1x

Boring Math (11.0)

Another aggregation:

2 happens 3x
4 happens 3x
1 happens 2x
3 happens 2x
All others -inf, 5-7 happen 1x

Boring Math (11.0)

I'm looking at

2^({1, 2, 4, 6, 8, 12, 16, 18, 20, 24, 28, 30, 32, 36, 40, 42, 48, 54, 56, 60, 64, 66, 72, 78, 80, 84, 88, 90, 96, 100, 104, 108, 112, 120, 126, 128, 132, 140, 144, 150}+2) - 3 (practical numbers)

Example:

factor {5, 13, 61, 253, 1021, 16381, 262141, 1048573, 4194301, 67108861, 1073741821, 4294967293, 17179869181, 274877906941, 4398046511101, 17592186044413, 1125899906842621, 72057594037927933}

Prime for

{5, 13, 61, 1021, 16381, 1048573, 4194301}

Boring Math (11.0)

It looks like practical numbers may not be relevant, based on

Table[(n-2)*Boole[isprime(2^n - 3)]], n= 2 to 1000

Boring Math (11.0)

I was looking at

"3, 4, 6 -seq:7 -seq:9 -seq:11 -seq:13 -seq:15" on oeis.org

And realized the 3, 4, 6... may just be prime(n) + 1

Boring Math (11.0)

There's two features in this picture that interest me:

grantjenks.com/wiki/_detail/pr

One is at coordinate (165, 363), the other is at (318, 477), which may essentially be related to the Heegner number 163 (& 2*163).

Boring Math (11.0)

You can draw a 45 degree angle and find another feature of interest at (250, 450) -- that's my estimate based on the features at (240, 422) & (254, 437):

This makes me interested in prime(54), and prime(38) / prime(70).

Boring Math (11.0)

I'm leaning towards 163, 251, 342 now.

Boring Math (11.0)

Now I'm leaning towards 163, 251, 339:

This image shows a line that essentially is supposed to represent 339 at location (338, 367):

Boring Math (11.0)

For the above image, you can't see the bottom right of the line segment, but it seems to have 5/20 pixels to the left, unlike the other one which is a 50:50 split.

Boring Math (11.0)

I'm a little interested in:

prime(20)*e ~= 193
prime(30)*pi ~= 355 = 5*prime(20)

Boring Math (11.0)

(339+71)/(5/2) = 163+1 = 41*4

Boring Math (11.0)

So if sigma(n) < 2*n - 1 (powers of 2), I think n cannot be a practical number. I'm curious if there is an upper limit where n must be a practical number.

Creating code isn't that hard, although sigma and practical numbers are obscure-ish.

Boring Math (11.0)

from itertools import chain, cycle, accumulate, combinations
from typing import List, Tuple

# %% Factors

def factors5(n: int) -> List[int]:
"""Factors of n, (but not n)."""
def prime_powers(n):
# c goes through 2, 3, 5, then the infinite (6n+1, 6n+5) series
for c in accumulate(chain([2, 1, 2], cycle([2,4]))):
if c*c > n: break
if n%c: continue
d,p = (), c
...

Boring Math (11.0)

...

while not n%c:
n,p,d = n//c, p*c, d + (p,)
yield(d)
if n > 1: yield((n,))

r = 
for e in prime_powers(n):
r += [a*b for a in r for b in e]
return r[:-1]

# %% Powerset

def powerset(s: List[int]) -> List[Tuple[int, ...]]:
"""powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3) ."""
return chain.from_iterable(combinations(s, r) for r in range(1, len(s)+1))
... Mastodon server focused on game development and related topics.