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.
Original is here: https://github.com/mattrdowney/buoyancysort/blob/master/buoyancysort/out-of-place-hierarchysort.h
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 am thinking of
{2, 3, 5, 7, 13, 17, 19... } -- https://oeis.org/A000043
And
{3, 5, 7, 11, 13, 17, 19, 23... } -- https://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)
This makes me curious about:
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)
I don't know if I mentioned I read this a week or so ago:
https://en.m.wikipedia.org/wiki/Mersenne_conjectures#New_Mersenne_conjecture
It's certainly interesting.
Boring Math (11.0)
I didn't even realize I subconsciously re-found something I read:
https://en.m.wikipedia.org/wiki/Mersenne_conjectures#New_Mersenne_conjecture
And
Boring Math (11.0)
19*2^2.6854520010653064453097 ~= 122.2236...
19*2^3.2758229187218111597876 ~= 184.0240...
https://en.m.wikipedia.org/wiki/Khinchin%27s_constant
https://en.m.wikipedia.org/wiki/L%C3%A9vy%27s_constant
Boring Math (11.0)
-163 = 4^4-prime(3^4)
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
https://math.stackexchange.com/questions/1309541/relatives-of-heegner-numbers
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.
Boring Math (11.0)
So I'm thinking 72, 77, 80 is relevant here, for:
https://en.m.wikipedia.org/wiki/Music_and_mathematics
https://en.m.wikipedia.org/wiki/34_equal_temperament
9^2, 80 for 12 notes
5^2, 24/"72" for 17 notes
Boring Math (11.0)
I'm thinking about https://oeis.org/A107360
{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)
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)
There's two features in this picture that interest me:
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)
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)
factor 14^4-prime(3^4) --> 37997
factor 15^4-prime(6^4) --> 39998 = 2*7*2857