Pinned post

Finished my 6-second game trailer for my Asteroids (1979)-clone in virtual reality:

youtu.be/tGoc2T6ABUc

Boring Math (11.0) 

I'm curious about:

72-80 & 81 -- 3
81*(9/2) -- 33/2
81*9 -- 63

For

oeis.org/A317412

Show thread

Boring Math (11.0) 

Table[(2*n)*Boole[Max[Ratios[Divisors[(2*n)]]] > 2 and not isprime(n)]], n=1 to 200

Which leads me to

oeis.org/A317412

Show thread

Boring Math (11.0) 

This references arxiv.org/abs/1405.2585

Which seems to have a mention of the maximal ratio (and it may be unbounded?)

Show thread

Boring Math (11.0) 

Aww yee:

en.m.wikipedia.org/wiki/Comple

Which leads to an interesting sequence:

oeis.org/A203074

I still want to figure out a sequence containing 78 specifically.

Show thread

Boring Math (11.0) 

78 is practical:

1 | 2 | 3 | 6 | 13 | 26 | 39 | 78 (8 divisors)

Show thread

Boring Math (11.0) 

And just as I say that I get rekt by 78

Show thread

Boring Math (11.0) 

This helped me realize a useful property / algorithm optimization of practical numbers:

Divisors of practical numbers seem to increase by at most a factor of 2. I think this is necessary, but I'm not sure if it is sufficient.

Show thread

Boring Math (11.0) 

I was trying to consider practical numbers where the negative sign could be used e.g.:

1
3-1
3
3+1
9-3-1
9-3
9-3+1
9-1
9

Notably, there is a common math question related to base-3 and a balance scale.

Which likely results in the sequence:

oeis.org/A196149

Although it's still possible there are exceptions.

Show thread

Boring Math (11.0) 

I'm wayyy off lol:

oeis.org/A335030

e**(log(sigma(52307529120))/(log(52307529120)*log(log(52307529120)))) ~= 1.39127

Show thread

Boring Math (11.0) 

Using e**(log(sigma(v, 1))/(log(v)*log(log(v)))):

The values seem to approach ~7/4 and 1/2. think the 1/2 is exact based on en.wikipedia.org/wiki/Divisor_

But I'm not sure about the other one.

Show thread

Boring Math (11.0) 

Essentially this means I'm looking for a modified definition of practical numbers that excludes powers of 2 and the most composite practical numbers. I'm wondering what the density of this set of numbers is compared to the primes, and also wondering if I can e.g. construct a 1:1 relationship between primes and "modified practical numbers".

Show thread

Boring Math (11.0) 

I forgot to paste some modifications from yesterday (mostly after midnight):

Looking at records over time. I think I'm interested in the narrow band starting at the perfect numbers and going up to a factor of 2 of the upper limit: en.wikipedia.org/wiki/Divisor_

Show thread

Boring Math (11.0) 

Oh, right, the output is:

1 ( 1.0 ) - 2520 ( 3.7142857142857144 )
2999 ( 1.0003334444814937 ) - 1608 ( 2.537313432835821 )

Basically, the lower values (both near 1) are uninteresting.

The upper values seem to increase without bound, but maybe the ratio between them is predictable. highest_nonpractical_value may have a strict bound, but I need to get a more efficient algorithm set to figure that out.

Show thread

Boring Math (11.0) 

...
elif normalized_sigma_value > highest_nonpractical_value:
highest_nonpractical = x
highest_nonpractical_value = normalized_sigma_value

print(lowest_practical, " (", float(lowest_practical_value), ") - ", highest_practical, " (", float(highest_practical_value), ")")
print(lowest_nonpractical, " (", float(lowest_nonpractical_value), ") - ", highest_nonpractical, " (", float(highest_nonpractical_value), ")")

Show thread

Boring Math (11.0) 

...
elif normalized_sigma_value > highest_practical_value:
highest_practical = x
highest_practical_value = normalized_sigma_value
else:
normalized_sigma_value = sigma(x, 1)/x
if normalized_sigma_value < lowest_nonpractical_value:
lowest_nonpractical = x
lowest_nonpractical_value = normalized_sigma_value
...

Show thread

Boring Math (11.0) 

...

max = 3000
for x in range(1, max + 1):
normalized_sigma_value = sigma(x, 1)/x
if is_practical(x):
if normalized_sigma_value < lowest_practical_value:
lowest_practical = x
lowest_practical_value = normalized_sigma_value
...

Show thread

Boring Math (11.0) 

...


if __name__ == '__main__':
highest_practical = 1
lowest_practical = 1
highest_nonpractical = 1
lowest_nonpractical = 1

highest_practical_value = 0
lowest_practical_value = 1e10
highest_nonpractical_value = 0
lowest_nonpractical_value = 1e10
...

Show thread

Boring Math (11.0) 

...

f = sorted(factors5(x), reverse=True)
if sum(f) < x - 1:
return False # Never get x-1
ps = powerset(f)

found = set()
for nps in ps:
if len(found) < x - 1:
y = sum(nps)
if 1 <= y < x:
found.add(y)
else:
break # Short-circuiting the loop.

return len(found) == x - 1
...

Show thread

Boring Math (11.0) 

...

# %% Practical number

def is_practical(x: int) -> bool:
"""Practical number test with factor reverse sort and short-circuiting."""

if x == 1:
return True
if x % 2:
return False # No Odd number more than 1
mult_4_or_6 = (x % 4 == 0) or (x % 6 == 0)
if x > 2 and not mult_4_or_6:
return False # If > 2 then must be a divisor of 4 or 6
...

Show thread

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 = [1]
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))
...

Show thread
Show older
Gamedev Mastodon

Mastodon server focused on game development and related topics.