Project Euler / programming problems

This drag to place is so much fun when going from corner to corner :smiley:

Is this right?

^just playing about because it’s really fun :slight_smile:

2 Likes

Take any three black stones along such a path, and consider the black stone that is inbetween the others along the path:


The other two black stones must then be in the blue and green regions respectively. But if you imagine placing a stone anywhere in the blue region, then to form an acute triangle the third stone would have to lie somewhere between the red lines:

Since this (open) region between the lines never intersects the (closed) green region, there can be no acute triangles along the path!

2 Likes

This ones 41 even

42?

^^ these ones are weird looking

3 Likes

Wow! The plot thickens.

1 Like

Yeah it looks like maybe having the stones connected is too strict, and removing some key connection stone might free up two placements somewhere

just going by how the tool is working anyway :slight_smile:

Here’s a similar looking 9x9 one, but only 19 so far

3 Likes

20 on 9x9 ?

5 Likes

(it should be possible to right click and copy image, so that you don’t have to select a screen region manually)
image

These asymmetrical solutions are so confusing… it reminds me a bit of solutions to the “Peaceable queens” problem, which also look a bit “ugly” to me at first glance:


OEIS entry
Numberphile video

3 Likes

It feels like shinuito wrote some code to make his computer do the work, then I wrote some code to make shinuito do the work :sweat_smile:

Does it still count as a programming-based solution when it runs on human hardware? :wink:

5 Likes

lol :slight_smile:

I do remember being at talks before about gamifying maths problems. The idea being that people can be quite creative and like to solve puzzles if it’s presented in a fun way.

It was something like this ^^ about simulating optimal time evolution of quantum states that they turned into a game, to let people play and solve.

4 Likes

This one might make you feel better :slight_smile:

It’s just a bit easier to tweak one stone at a time and not preserve symmetry to get the number higher :slight_smile:

5 Likes

More or less what I’m doing is taking some kind of path, and toggling one stone at a time to see if removing one stone frees up two locations.

Then sometimes removing two stones frees up three locations and so on. It’s probably like a primitive human version of gradient descent or something, just tweak things, move around in a local minimum until you can go further again.

43 on 19x19 :slight_smile:

Yeah the right click doesnt work for me, but I think that might be a safari thing.

and a symmetric 42 one

4 Likes
2 Likes

I’ve been thinking some more about this problem, mainly trying to prove that the maximum number of stones grows linearly, but no success so far.

A friend of mine wrote a program using simulated annealing that can find good solutions quite efficiently.

Here is a solution with 41 stones on an 18x18 board which doesn’t use any of the corners:
image
(most optimal solutions so far use at least one corner so I found this one a little surprising)

And here is a solution with 240 stones on a 100x100 board:

:man_shrugging:

241:

Another update, 246:

5 Likes

Related but unrelated

4 Likes

I also got recommended that video! I especially liked the construction for a prime-sized square.

2 Likes

Who wants to join me for Advent of Code 2023? It starts 2023-12-01T05:00:00Z.

https://adventofcode.com/2023

Last year I tried to solve the problems quickly, but the main leaderboard always seemed impossibly out of reach and I got kind of burned out after the first 10 problems. I’m thinking of trying it again this year at a more relaxed pace.

If there are a few people interested, we can have a private OGS leaderboard again.

4 Likes

I might give it a shot for the first few days and see how it goes! Will definitely be slow, but would be fun to see how many days I can solve at all.

2 Likes

What timezones are you guys in? For me the problems unlock at 6 AM in the morning, which is quite a bit earlier than I normally get up :sweat_smile:

It’s 9pm for me in US/Pacific, a perfect time to do a little coding challenge before bed.

But I’m not going to race anyone this year, just try to do them. Last year it was so crazy how even when I thought I was really fast, I was nowhere near the top 100. I only placed in the top 1000 a couple of times. Here are my stats from 2022:

image

Anyone else joining us? @benjito are you in?

3 Likes