Saturday, June 13, 2026

[jxtzkavi] magic hexagon base 6

it seems appropriate to present the unique nontrivial magic hexagon with its numbers expressed in base 6.  final number = 31 (base 6) = 19 (base 10).  magic sum = 102 (base 6) = 38 (base 10).

     3  25  30
  31  11   1  15
24   2   5  10  13
  20   4  12  22
    14  21  23

Monday, May 25, 2026

[typdfiqs] Amtrak Southwest Chief schedule change starting late May 2026

according to "Schedules" on https://www.amtrak.com/ , 2026-05-07:

Thursday, May 28, 2026: Train 3 departs CHI 2:25p arrives LAX 7:57a (43h 32m).  this is the last train on the old schedule.

Friday, May 29, 2026: Train 1003 (a special number) departs CHI 1:30p arrives LAX 8:12a (44h 42m)

Saturday, May 30, 2026: Train 3 departs CHI 1:30p arrives LAX 8:12a (44h 42m)

there is no information about this on "Service Alerts and Notices" https://www.amtrak.com/alert

Tuesday, April 21, 2026

[ynwwppvz] estimating e by counting primes

let n = 2^22 = 4194304.  there are p = primepi(n) = 295947 primes less than n.

using the prime number theorem n/log(n) ~= primepi(n), then e ~= n^(p/n) ~= 2.93 .

using n/(log(n) - 1) ~= primepi(n), then e ~= n^(p/(n+p)) ~= 2.732 .

(the same n was used previously computing e with primorial.  using the values of primes as we did then yielded slightly more precision (2.717) than using just their count as we do now.)

the typical way of computing fractional powers is with log and exp, but if you have such functions, then e = exp(1).

we chose n to be a power of 2 to permit easily computing the fractional power ^(p/n) in the first approximation without needing log and exp: the 1/n power in the can be computed by repeated square roots.  n^(p/n) = (n^p)^(1/n).  compute n^p first by augmenting machine precision floating point with an exponent that can become much larger than provided by the machine type.  the only operations one needs are multiplication and square root.  example implementation in Haskell.  there are some bits (pun!) of symmetry between exponentiation by squaring for the numerator of p/n followed by repeated square root for the denominator.

for the second approximation n^(p/(n+p)), one could have attempted to choose a different n such that n+p is a power of two.  but 3916608 + primepi(3916608) = 2^22-1 and 3916609 + primepi(3916609) = 2^22+1 (because 3916609 is prime), so it would have required some fudging.

better is to approximate the fractional exponent p/(n+p) as round(2^64 * p/(n+p))/2^64 .  (64 bits should be enough for everyone.)  for n = 2^22, p = 295947, this works out to to 1215802539408625636 / 2^64.

or, use Newton's method to compute the (n+p)th root of x^p.

comparing with methods that don't involve primes, but inputs of a similar scale:

e ~= (1+1/n)^n : for n=2^22, e ~= 2.718281504 .

sum(n=0, 10, 1.0/n!) ~= 2.71828180 , choosing 10 because 10! is the largest factorial less than 2^22 .

Sunday, April 19, 2026

[esowrowp] speaking leading zeroes

zeroty ten twenty thirty forty fifty sixty seventy eighty ninety

0 zero
1 one
00 zeroty
01 zeroty one
000 zero hundred
001 zero hundred one
0000 zero thousand
0001 zero thousand one
00000 zeroty thousand
00001 zeroty thousand one
01000 zeroty one thousand
000000 zero hundred thousand

or "ohty" instead of zeroty to avoid similarity between zero and zeroty?  but ohty sounds similar to eighty.

or "aughty"?  also sounds similar to eighty.

or "noughty"?  context probably distinguishes it from naughty.

"nohty" ("notey")?

typically digit strings that are not numbers should be read as digit strings, but place value indicators inserted into the string serve as useful signposts.  in this case, also consider speaking internal zeroes: 

000000 zero hundred zeroty zero thousand, zero hundred zeroty zero
20 twenty zero

zip codes

10 "ten" remains irregular.  though could we do something like 10 one-ty zero, 20 two-ty zero (future post knlwtvtb).

[pfbjvubj] environment variables modifying Makefile variables

consider the following GNU Makefile and invocations in the bash shell:

C = c
Q ?= q
.PHONY:default
default:
        @echo C=$(C)
        @echo Q=$(Q)

$ make
C=c
Q=q

$ make C=notc
C=notc
Q=q

$ make Q=notq
C=c
Q=notq

$ C=notc make
C=c
Q=q

$ Q=notq make
C=c
Q=notq

either type of assignment can be overridden by specifying a new value after "make" on the command line, but only variables assigned with ?= can also be overridden by the environment.  I've deliberately done both: makefiles in which make communicates with its caller via environment variables, and makefiles in which make should ignore any identically named environment variables.

Next, experimenting with += :

P += p
.PHONY:default
default:
        @echo P=$(P)

$ make
P=p

$ make P=prefix
P=prefix

$ P=prefix make
P=prefix p

like with ?= , only user-specified values in the environment can be appended to with += .  this is especially useful is the following idiom: if a Makefile specifies "CFLAGS += necessary flags", then the user can add additional flags to CFLAGS just for one build without editing the Makefile.  for += to work keeping the necessary CFLAGS specified in the Makefile, the user must specify CFLAGS in the environment as demonstrated in the last example above, not in a command-line argument to make.

an attacker could surreptitiously set CFLAGS="something evil" in your environment, thereby affecting all builds that use exclusively CFLAGS += , but if you are worried about an attacker who can set and export arbitrary variables in your environment, you probably have bigger problems.

future work: the "override" makefile directive.

[obaxedbg] which half point

rate chess players by how often they turn a drawn position into a lost one, and by how often they turn a winning position into a drawn one.  (turning a winning position into a lost one counts as one of each.)  the best at avoiding bad moves of the first type might not be the best at avoiding the other type.

devilish detail of determining ground truth of a position.  maybe play out by an engine.

devilish detail of normalization: some positions are easier to make mistakes in, and some players probably (as a result of play style) encounter such positions more frequently.

skill difference might matter: a subtle (but still half-point) mistake against a beginner might not matter, because the beginner might not be able to exploit it, or might be expected to blunder it back later in the game.

having a high rate at either or both of these categories might not equate to bad results -- perhaps you have a playing style that, even though you make a lot of mistakes, you induce your opponents to make even more.

having a low rate of making mistakes might not equate to good results: only one mistake per game is enough to lose every game.

opposite measure: how often a player induces an opponent to make each of the half-point mistakes.  similar devilish details, including normalization.

[rgvdheir] random convex polytope

first, create a random smooth shape by picking random weights for the first few spherical harmonics and summing them.  reject if the object is not convex: determining this seems difficult.  can the coefficients be chosen to favor convexity?  previously 2D.

then, uniformly randomly sample some points on the surface and construct tangent planes, forming a random convex polyhedron (might not be closed).  uniform sampling of surface points on an arbitrary surface seems difficult.  maybe a random walk of small steps each of approximately constant geodesic length.  how many steps?

or, permit starting with a smooth shape not necessarily convex.  reject a tangent plane if its inward half space does not contain the origin.

extend this construction to higher dimensions.  what are the hyper-spherical harmonics?  curse of dimensionality probably somehow happens.

a 4D polytope (polychoron) is interesting because its cells are random polyhedra whose faces fit together pairwise but not further in 3D.  how can a collection of specified irregular polyhedra be manufactured?  3D printing is of course one way.  or, mill some faces, but include nubs on one or more faces.  then, reorient the piece upside down, holding it in place from below by the nubs.  mill the remaining faces.  then, somehow remove the nubs.

mill two negative halves then cast then join somehow?

create a net and fold (origami)?

the edges of a random convex 3D polyhedron define a random planar graph.  do analogous graphs for convex polytopes in higher dimensions have a property analogous to planarity?

Delaunay triangulation is another way to get a random planar graph, but faces are generally always triangles.  but are most of the faces produced by the tangent method described above also triangles?

3D convex hull of random points results in a convex polyhedron, and this generalizes to arbitrary dimensions.  I think most faces will again be triangles (simplices).  can the points be sampled in a manner to get interesting shapes?  for example, after the first few points, avoid new points that are way outside the convex hull so far, drastically changing the polyhedron.

aside: the minimal surface in 3D that contains all given points is not necessarily the convex hull as it is in 2D.  the minimal surface might have hyperbolic paraboloid faces.

a random convex polytope generates a random linear or quadratic programming problem.

applying a linear transformation to a convex polytope maintains its convexity.  proof: assume false, meaning that after the linear transformation there is a line segment that starts inside, goes outside, then comes back inside (definition of non-convex).  apply the inverse linear transformation, which is linear.  the line segment remains a line segment.  it still goes in out in.  the existence of such a line segment in the initial polytope means it was not convex.

consider relaxing the requirement of convexity and only require non-self-intersecting.  one can have holes and other weird features, though perhaps some so weird that it might be good to forbid them.  what weird features, especially in higher dimensions?  polygonal faces can be non-convex with holes.  that is probably OK, but faces with intersecting edges (e.g., pentagram) are not OK.

previous thoughts on random polyhedra..

Wednesday, March 04, 2026

[ibrwpoia] full coverage by uniform sampling

B different balls in an urn.  uniformly draw with replacement N times.  what is the probability that all B balls are seen during the N draws?

given B, for what value of N is the probability (about) 50%?

simulation in Pari/GP:

u(trials, B, N)= my(success=0); for(c=1, trials, my(a=vector(B)); for(i=1, N, r=1+random(B); a[r]=1); good=1; for(i=1, B, if(0==a[i], good=0; break)); success+=good); 1.0*success/trials;

B N
2 2
4 7
8 19-20
10 26-27
16 50
20 67
30 113
32 122
40 162
50 213-214
60 267-268
64 289-290

B=64 balls, N=290 draws:
u(10^5, 64, 290)
0.50303

cpu time = 21,920 ms, real time = 21,924 ms.

exact answer: 1 - probability of failure by the inclusion-exclusion principle, simplifies to:

v(B, N)= sum(i=0, B, (-1)^i * (B-i)^N * binomial(B, i)) /B^N

1.*v(64,290)
0.504257282

exact bounds:

10 [26, 27]
20 [66, 67]
30 [112, 113]
40 [161, 162]
50 [213, 214]
60 [267, 268]
70 [322, 323]
80 [379, 380]
90 [437, 438]
100 [496, 497]
110 [556, 557]
120 [618, 619]
130 [679, 680]
140 [742, 743]
150 [806, 807]
160 [870, 871]
170 [934, 935]
180 [1000, 1001]
190 [1066, 1067]
200 [1132, 1133]
210 [1199, 1200]
220 [1266, 1267]
230 [1334, 1335]
240 [1402, 1403]
250 [1471, 1472]
260 [1540, 1541]

2 [2, 2]
4 [6, 7]
8 [19, 20]
16 [50, 51]
32 [122, 123]
64 [289, 290]
128 [667, 668]
256 [1512, 1513]
512 [3381, 3382]
1024 [7472, 7473]
2048 [16364, 16365]
4096 [35569, 35570]

the growth rate of N seems to be O(B*log B).  let's use N = B*log B exactly and calculate the probability of full coverage:

v(B, round(B*log(B)))

B N v
4 6 0.380859375
8 17 0.365562211
16 44 0.347014424
32 111 0.363466498
64 266 0.364065310
128 621 0.366295109
256 1420 0.367804277
512 3194 0.367507854
1024 7098 0.367763404
2048 15615 0.367750482
4096 34070 0.367873303

the probability seems to be converging to exp(-1) = 0.367879441 .

how many draws N are necessary to achieve at least a given probability of full coverage?

previously similar: Euler's Game of Coincidence

[fieutgtv] sum of the reciprocals of known primes

at the time of writing, the largest known prime number is the Mersenne prime 2^136279841 - 1, a 41-million-digit number.

the sum of the reciprocals of all primes up to the largest known prime can be estimated to be approximately

log(log(2^136279841 - 1)) + 0.261497 ~= 18.6252

, where the offset 0.261497 is the Meissel-Mertens constant (known to many more digits).  (how many more?)

(previously, on log(2^n +1).)

however, the sum of the reciprocals of all primes up to infinity is infinity, i.e., the infinite sum diverges (proven by Euler).  despite our finite sum being up to a huge prime, 18.6 is still a long way from infinity.

the reciprocal of the next prime after the largest known prime ("the first unknown prime") will add approximately 10^-41000000 to our partial sum 18.6252 , a tiny step.  and each additional step will be yet smaller, because reciprocals keep getting smaller.  yet infinity will still eventually be "reached": the sum will exceed any finite number you can think of: Graham's number, Rayo's number, Loader's number, etc., (and all finite numbers you can't think of).

previously, computing the sum one button press at a time.

[wlxarken] hope nand comfort

hypothesis: a society may grant its lower classes hope for upward social mobility, or a comfortable existence, but not both.

this is a depressing hypothesis similar in spirit to those that originally got economics labeled the dismal science.

the general ideas justifying the hypothesis are the following.  if you grant the lower classes the possibility of upward social mobility, only some of them will be permitted to achieve it, so they will need to compete against each other in a zero-sum game for who achieves it.  zero-sum games are cutthroat, not comfortable.  if you grant (enough) comfort, there won't be incentive to seek upward social mobility (this might require more thought).  if you grant comfortable upward social mobility, then the lower classes will become depopulated, so society won't be able to function because it needs lower classes to do lower-class stuff.

also seemingly in support of this hypothesis are highly unequal, highly stratified societies which have remained stable for long periods of time.  they presumably deny upward mobility but grant enough relative comfort to squelch social upheaval.

unfortunately, or fortunately, this hypothesis is only a vague idea which could be incorrect in many ways.

Solow famously disproved Malthus's original "dismal science" with the economic concept of technology.  however, our dismal hypothesis survives overall positive sum: technology may lift the entire pyramid, but it still remains a pyramid.

society can grant its lower classes neither hope nor comfort, which is why the conjunction is nand not xor.  but a situation with neither hope nor comfort might be unstable, threatening civil war.

Sunday, March 01, 2026

[utglyvmo] dark matter cloud

what would we observe if the earth, or the solar system, passed though a dense cloud of dark matter?

assume WIMP.  we would see not the dark matter directly but only indirect effects.  hypothesize that orbits will change.  will the sun gravitationally capture dark matter and increase in mass, increasing its fusion rate?

do dense clouds of dark matter exist?  how dense might they be?

update: a low-surface-brightness galaxy could be considered a galaxy-sized dense cloud of dark matter.  but I don't think their average dark matter density is that much higher than that of the Milky Way.

previously on dark matter in the solar system.

[sebqohhz] Star Wars by ancient Greek playwrights

pretend that the spirits of ancient Greek playwrights had possessed George Lucas and teamed up within his mind to write the actual screenplay to Star Wars.  who wrote which part?

Aeschylus:

[opening shot: stars.  small spaceship.  laser fire.  huge Imperial Star Destroyer.]

also:

Obi-Wan Kenobi: The Force is what gives a Jedi his power.  It's an energy field created by all living things.  It surrounds us and penetrates us.  It binds the galaxy together.

Sophocles:

Ben Kenobi: Yes, I was once a Jedi knight, the same as your father.
Luke Skywalker: I wish I'd known him.
Ben Kenobi: He was the best star pilot in the galaxy, and a cunning warrior.  I understand that you've become quite a good pilot yourself.
[sorrowfully]
Ben Kenobi: And he was a good friend.

Euripides:

Luke: But I was going into Tosche Station to pick up some power converters!

Aristophanes: Robot Chicken

[pmycapmx] horse meat

cow = beef
pig = pork
sheep = mutton
deer = venison
horse = ?

we have alternate names for the meat of animals that we maybe do not want to think of as animals when we eat them.  Americans and British generally do not like to eat horse.  would we be more willing if there were an alternate English name for horse meat?  in cultures which do eat horse, do they have an alternate name for its meat (for any meat)?  other animals (e.g., dog)?

in English, chicken = chicken, fish = fish, but these we consider "lower" animals.  however, lamb = lamb despite sheep = mutton.

maybe horse will become demoted to lower animal soon because of the ascendancy of the automobile.  will horse-riding as a hobby of the upper class affect its transition to acceptability as food?  how is it currently affecting?  on one hand, horses are (expensive) friends not food to those who ride them.  on the other hand, horses are literally below them when ridden.

[ygnpgfnt] potential energy of a compressible ball

model a spherical solid as a lattice of atoms connected by springs.  let the solid's own gravity compress itself.  how much energy gets stored in the compressed springs?

the earth's nickel-iron core is denser than nickel-iron at room temperature, denser than nickel-iron meteorites.

aside: does this mean that destroying a planet requires less than its gravitational binding energy?  harness this internal potential energy.  but this requires more thought: gravitational potential energy balances spring energy.

to model the lattice of springs, we need spring potential energy to approach infinity as distance between atoms approaches zero.  Hooke's Law is not the right model for this.

aside: does it matter what lattice (e.g., cubic, rhombic dodecahedral) of springs?

we also need potential energy to head to infinity as distance increases to infinity so that atoms do not convert to gas and evaporate in our model.  Hooke's Law could work for this direction.

U = x^2/2 + 1/x.  first term is Hooke's Law; second is electrostatic repulsion.  the leading coefficient of 1/2 places the local minimum at x=1.

alternatively, a U-shaped function that has local minimum at x=1 and is infinite at x=0 and x=2: U = 1/x - 1/(x-2) = 2/(x*(2-x)).  the two expressions after U= are the two most straightforward ways of constructing a function with the two vertical asymptotes.  it is neat that they yield the same result.

consider general relativity: the potential energy of compressed strings exerts gravity, bends spacetime.

[efggjrfp] infinity breaking groups

consider adding one infinite element to the integers or reals under addition and seeing if it remains a group.

first, consider defining 1 + infinity = infinity in the style of Cantor's cardinal numbers.

(1 + infinity) + (-infinity)
= infinity + (-infinity)
= 0

1 + (infinity + (-infinity))
= 1 + 0
= 1

associativity violated, so not a group.  note that, by group axioms, -infinity must exist, and -infinity + infinity = 0.

ordinal numbers are not a group because omega + (-1) is not defined.

the Riemann sphere (complex numbers extended with infinity) is not a group because infinity + (-infinity) is not defined.  (-infinity) itself might not be defined.

some ways to extend reals with infinity to get a group: Levi-Civita field (not too difficult to understand), surreal numbers (rather difficult to understand).  yet more exist, typically also difficult to understand.

the above successful ways get you not just a group but a field (with multiplication and division).  is that necessary?

unstated: why do you even want a group of numbers with infinity?

[sguflopg] prime(x) = N*x

the 6455th prime number is 64553, a factor of about 10.

here are a few variations on estimating the crossover point using the prime number theorem.

if approximating the nth prime by n*log(n) :

nthprime(i) = 10*i
i*log(i) = 10*i
log(i) = 10
i = exp(10)
i ~= 22026.5

crossover predicted around the 22026th or 22027th prime, namely 249779 or 249797.

if approximating primepi(n)= n/log(n) :

primepi(n) = n/10
n/log(n) = n/10
log(n) = 10
n = exp(10)
n ~= 22026.5

crossover at 22026.5 (bracketed by primes 22013 and 22027 which have indices 2466 and 2467 respectively).

if approximating primepi(n)= n/(log(n)-1) :

primepi(n) = n/10
n/(log(n)-1) = n/10
solve(n=1000, 100000, n/(log(n)-1) - n/10)
n ~= 59874.1417

crossover predicted around 59874.1 which is bracketed by primes 59863 and 59879 which have indices 6048 and 6049 respectively.  this is the best approximation, albeit not closed form.

because exp grows exponentially (like it says on the tin), we will never know the exact crossover for larger factors, e.g., 100.

enumerate the crossover points for small integer factors.  there is much sophistication available for counting primes without explicitly generating them.

as of 2022, the record evaluation of the prime counting function is primepi(10^29) ~= primepi(exp(66.8)) ~= 10^29/65.8 . it will take a little more work to find the crossover point nthprime(x) = 65*x.

[vzqpqtrb] some slowly diverging and slowly converging integrals

evaluate these improper integrals from (some suitable lower bound avoiding undefined values) to infinity.

In[]:= Integrate[1/(x^(1)), x]

Out[]= Log[x]

In[]:= Integrate[1/(x^(1+1/n)), x]

Out[]= -(n/x^n^(-1))

the first integral diverges as x tends to infinity; the second converges.

NB: exponentiation is right associative, so the above expression is equal to -(n/x^(n^(-1))) = -n/(x^(1/n)) .

digression: set n=1 to show Riemann zeta(2) converges; Basel problem asks for its exact value.

In[]:= Integrate[1/(x*(Log[x])^(1)), x]

Out[]= Log[Log[x]]

In[]:= Integrate[1/(x*(Log[x])^(1+1/n)), x]

Out[]= -(n/Log[x]^n^(-1))

In[]:= Integrate[1/(x*Log[x]*(Log[Log[x]])^(1)), x]

Out[]= Log[Log[Log[x]]]

In[]:= Integrate[1/(x*Log[x]*(Log[Log[x]])^(1+1/n)), x]

Out[]= -(n/Log[Log[x]]^n^(-1))

it is nice that these all have simple form.

future post: infinite product of iterated log.

previously vaguely similar: twin primes and LogIntegral

[cgratocc] product of shifted iterated logarithms

each term has value 1 at n = 0:

f1(n) = (n+1) * log(n + e) * log log(n + e^e) * log log log(n + e^e^e) * ...

or, each term has value 1 at n = 1:

f2(n) = n * log(n * e) * log log(n * e^e) * log log log(n * e^e^e) * ...

does the product converge for n>0 or n>1 respectively?  integrate 1/f from n=0 or n=1 respectively to infinity.  does it diverge?

previously on iterated log.

[egeimicu] editing Emacs Lisp

consider editing code with an editor, a very common activity.

transformations to code, editing it, or even just navigating it, can be arbitrarily complex (e.g., jump from function use to function definition), so we want a computer programming language to be able to express and implement the possibilities.  many IDEs are extendable with an embedded language, famously Emacs.  then, we want to do arbitrarily complex edit operations on that embedded editing code, again wanting a programming language to express and implement those operations.  the need for programming languages to edit programming languages continues recursively, infinitely.

Emacs is pretty good for editing Emacs Lisp.  for example M-x apropos sexp lists many functions (and other things) for manipulating s-expressions.

previously, listing some of the possible editing actions.

[mudkoisq] assassination of assassination of UnitedHealthcare CEO Brian Thompson

(this post was written before Luigi Mangione was arrested.)

predict that the suspected assassin of UnitedHealthcare CEO Brian Thompson, if apprehended, will be killed by the government before reaching trial.  if the case reaches trial, jury nullification seems so likely that the government (puppeteered by wealthy CEOs of evil industries) will need to use extra-legal means to punish the assassin, to deter further assassinations.

if you are helping (or not hurting) the assassin's chances of avoiding capture, you are likely saving his life.  and you would also be helping reform an insurance industry which has been using regulatory capture (a.k.a. corruption) to preserve profits and escape reform.

during voir dire, can a prosecutor strike every potential juror who feels he or she has been unjustly denied a health insurance claim, or knows someone who has?  excluding such a large group of people feels like it should be unconstitutional.

previously, the government killing James Hodgkinson when jury nullification was likely.

powerful wealthy people likely engineered the death of Jeffery Epstein while in government custody (also future post vaqruxzf).  back then, everyone was predicting -- it was a no-brainer -- that the puppeteered government would kill Epstein before trial: everyone was right.

(regarding the title: in the olden days, homicide meant the person who committed (what is now called) homicide; regicide meant the person who committed (what is now called) regicide.)