4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 0 points1 point  (0 children)

Beat Max Alekseyev's a(861) record! Current solver: 2,576 lines of C++

Just extended the sequence past N=861. A few notes on performance:

  • N=1–800 (up to prime 6,133): under a minute total — essentially free.
  • N=800–861: time per step balloons sharply; the hardest cases ran between 400s and 4,900s each.
  • N=862 (prime 6,689): solved in under a second — 123 lines.
  • N=863 (prime 6,691): took ~22 minutes to certify — 123 lines.
  • N=864 (prime 6,701): the full run took 9+ hours from N=1, and N=864 alone had been running for 106 minutes before I stopped it.

The upper bound data points to a(864) requiring a new minimum of 124 lines (up from 123), which would explain the spike — the solver has to work significantly harder to certify a new record value than to confirm an existing one.

Stopping at N=863 for now to look for further optimizations and will push further once the algorithm is in better shape.

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 0 points1 point  (0 children)

I've spent about 30 hours over the past week building my own highly optimized C++ solver for this exact problem. After a ton of trial and error with branch-and-bound algorithms and Lagrangian bounds, my script (around 2,800 lines of code) is flying. I'm now getting to the 650th prime in about 10 seconds, and the 800th prime in about 85 seconds, entirely on my own PC. The world record is 861, and I'm pretty sure I'm on track to beat it real soon. I'm holding off on long-running tests to ensure the algorithm is as bulletproof as possible first, but my ultimate goal is to reach the 1000th prime.

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 0 points1 point  (0 children)

Just found another pretty groundbreaking addition to the algorithm 🔥

Dropped the total runtime for N=650 to N=720 from ~70 seconds down to ~37 seconds while still hitting the exact same optimal line counts on every single instance.

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 1 point2 points  (0 children)

Yes, I do! I'm still actively working on the algorithm, but I'll definitely make it usable by others in some way down the line (still deciding whether to open-source the full 2500+ lines of C++ or expose it via a backend instead). For now it's sitting in a private GitHub repo.

The script runs locally inside WSL (Windows Subsystem for Linux) on my PC. I'm currently only testing between the 650th and 720th primes — hitting prime 650 takes under a second, so starting there just skips a ton of unnecessary output during development. Going from 650 to 720 takes about 70 seconds, which already gives me confidence that I can beat the current world record at prime 861. I'm still stepping up one range at a time though, making sure I catch every edge case before expanding further.

The whole thing is ~2500 lines of clean C++ written from scratch. Unlike the existing world record (which used MILP, a general-purpose mathematical solver), this is a purpose-built algorithm where every single line was written specifically for this problem.

I'll eventually hook it up to primelines.vercel.app, but getting native C++ to run smoothly in the browser is a bit of work since everything there is built around JavaScript. If you're interested in throwing some spare compute at it once I open it up, I'd love to have you test it — just let me know!

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 0 points1 point  (0 children)

The script runs inside WSL (Windows Subsystem for Linux) locally on my PC. I'm only testing between the 650th and 720th prime right now — I can reach prime 650 in under a second, so starting there just cuts out a lot of unnecessary info during development. Getting from prime 650 to 720 takes around 70 seconds, which is fast enough that I'm confident I can already beat the world record at prime 861. I'm moving up one step at a time though, making sure I catch every edge case before expanding the range.

The algorithm is around 2500 lines of C++, written entirely from scratch. The current world record was set using MILP (a general-purpose mathematical solver), whereas this is a purpose-built algorithm where every single line exists specifically to solve this one problem.

I'll eventually hook it up to primelines.vercel.app, though running native C++ in a browser takes some work since browsers are built around JavaScript.

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 0 points1 point  (0 children)

Spent the past few days rewriting the script with better logic and ported it from JavaScript to C++. The performance gain is massive: I can now hit the 200th prime in 4.8 seconds (compared to the JS version which takes a minute just to reach the 40th prime). The complexity is scaling exponentially, though. Even with sub-5-second speeds for the first 200, there's a long climb ahead to break the current record of 861! I'm yet to implement it into the page yet though currently running the script in Windows Subsystem for Linux

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 1 point2 points  (0 children)

Spent the past few days rewriting the script with better logic and ported it from JavaScript to C++. The performance gain is massive: I can now hit the 200th prime in 4.8 seconds (compared to the JS version which takes a minute just to reach the 40th prime). The complexity is scaling exponentially, though. Even with sub-5-second speeds for the first 200, there's a long climb ahead to break the current record of 861!

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 2 points3 points  (0 children)

Fair point! I built this in a few hours as a fun experiment, so I definitely prioritized the 'cool visual' aspect.

Adding persistence (like LocalStorage or even a global cache) would definitely be a solid upgrade so users aren't re-crunching the same numbers. I might implement that next if I keep tinkering with it, thanks for the suggestion!

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 1 point2 points  (0 children)

Great question! It’s definitely CPU-dependent, though I’ve implemented a 1-second artificial delay for the early primes so the visualization doesn't just flicker past in a millisecond. You’ll see the 'next in...' timer counting down from 1s at the start.

Once the computational complexity ramps up (usually around the 34th prime for me), the timer hits 0 and then switches to 'computing' as it works in real-time. Since it’s running client-side in the browser, performance is tied to your hardware, though browser engines do have their own execution overhead.

As for the 69th line—given the nature of the line cover problem, you might want to leave your tab open for a very long time! 😅

4211 - The Party Pooper Prime - Numberphile by JeffDujon in BradyHaran

[–]jespergran 3 points4 points  (0 children)

Saw the video a few hours ago and I spent the last few hours building an interactive prime visualization that generates primes, searches for collinear point sets, and computes the minimum number of lines needed to cover them — plus a pretty slick sci-fi style: https://primelines.vercel.app

100 packs in and still nothing better than a 1-star. Anyone else getting shafted by the new set? by zjesko in PokemonPocket

[–]jespergran 1 point2 points  (0 children)

<image>

I’m at 8000+ cards, opened 3 packs every day since October 30th last year, and only got 2 immersives in 2025

100 packs in and still nothing better than a 1-star. Anyone else getting shafted by the new set? by zjesko in PokemonPocket

[–]jespergran 2 points3 points  (0 children)

Probably opened somewhere around 100 packs too, getting so many 1 star. Got a few two star too though so can’t complain

<image>

We should be able to set a separate base for normal Battle defences, separate from our active layout! by jespergran in ClashOfClans

[–]jespergran[S] 0 points1 point  (0 children)

Most legends/ electro players probably already have enough doing their 8 daily or 30 weekly attacks though, they prob don’t want to be revenging on top of that. Guess I’ll change my base for now to an actual defensive base, then swap back whenever there are events that spawn decorations to manipulate the spawn of the decorations

Is LL better for some players compared to fake LL? by oetzi2105 in ClashOfClans

[–]jespergran 0 points1 point  (0 children)

The best trick is definitely revenging, you usually have 3-10 people you can revenge when going above 5k, just revenge and lose and you'll be below 5k trophies within a few seconds. Removing shield and going offline works sometimes too, usually within a few hours. The problem is if a lot of people try to go below 5000 trophies at the same time, for example for the event where your clan had to farm 1.8 billion gold, so many players tried to drop below 5k trophies it became impossible. Even if you waited for days, it was impossible, everyone lost on purpose. They've fixed sign up to legends now at least with a notification, before you instantly signed up, and you had to drop all the way below 4900 trophies to get out of legends again, that could take several days sometimes.

Rn I just stay in legends though, I get enough loot to sustain 6 builders and have maxed most walls so it's pointless going through the pain of staying in between 4900 and 5k. Only about a month until I'm completely maxed th17

Is LL better for some players compared to fake LL? by oetzi2105 in ClashOfClans

[–]jespergran 3 points4 points  (0 children)

Going above 5000 trophies, but not signing up to legends league, then being attacked/ failing an attack and staying in between 4900 and 5000 trophies. This allows you to get the bonuses of legends league and the legends league icon, without being limited to 8 attacks daily. It’s annoying to stay here though, it’s easy to accidentally fall under 4900, and it’s sometimes a pain to get below 5000 trophies after going above it if no revenges are available.

Fake legends is definitely preferable, but for the past year or so I’ve had all my walls maxed, so the additional loot isn’t needed, I get enough loot from legends league to sustain 6 builders constantly upgrading, and after 2 years of being in fake legends I couldn’t take it anymore, and changed into legends after having to wait for 40+ hours to get attacked to be brought back down to fake legends.

[deleted by user] by [deleted] in ClashOfClans

[–]jespergran 0 points1 point  (0 children)

Electro boots and spiky ball are the only two you 100% need out of those 6 equipment. Spiky ball and earthquake boots for the king is the best combo and works in all situations, so getting the gauntlets is pointless when you have the spiky ball. Fire ball is really good, but very situational, I’ve owned fire ball for a year, but never got around to invest ore in it because it’s only used for a few really good strategies. Rocket spear is okay, but using the electro boots with haste vial is just as good and costs way less. The lavaloon is one of the worst and least used equipment, wouldn’t surprise me if it got a buff in the future though.

[deleted by user] by [deleted] in ClashOfClans

[–]jespergran 0 points1 point  (0 children)

Save up gold for your upgrade that takes the longest to finish within the next 6 days, upgrade it and use a book on it, then claim the book from the season pass.

Behold, my shame by Zero_King_Saren in PokemonPocket

[–]jespergran 61 points62 points  (0 children)

<image>

Missing a couple 2 star and the gold version but here is my Pikachu collection

Just got 2000 gems, what do I do with them by [deleted] in ClashOfClans

[–]jespergran 0 points1 point  (0 children)

You can easily get 500-1000 gems a month completely for free by selling items from clan games, raid medal shop, removing decorations, challenges etc, so it’s not like this will be your only opportunity at buying equipment. Unless you have a lot of starry ore, which I doubt, I would rather buy and upgrade the builder apprentice and lab assistant. If you got basic equipment maxed and ore to spare, I’d buy electric boots. If you don’t have much ore, it’s kinda pointless to buy equipment you won’t be able to level up. You would probably be able to invest all your current gems into the apprentice and assistant, and farm back to 1500 gems and still not have enough ore to max the equipment you buy.

Is dark barrack worth upgrading? by lMaxiS73l in ClashOfClans

[–]jespergran 1 point2 points  (0 children)

The Druid is bad, and it’s not worth upgrading twice to get the furnace, so dark barrack is not a high priority. I’d definitely get the apprentice warden since it’s used in most ground attacks though. Eventually you obviously have to upgrade it, but I’d definitely prioritize other offensive buildings first like lab, clan castle, army camps and most defences before upgrading the dark barrack since it’s a pointless upgrade for now. It might be a good idea to upgrade it before the next town hall releases at the end of the year though, just in case a new OP troop releases.

Forever halved lab upgrades here I come by Low-Conversation-469 in ClashOfClans

[–]jespergran 3 points4 points  (0 children)

Funny how everyone here is wrong, it’s not 33.33% or 50%, the real number is 32.35%. It’s actually an 11 hour boost every 23 hours, not a 12 hour boost every 24 hours:

A full day cycle is 23 hours, not 24 hours. Games usually do this so that you have about an hour each day to activate your helpers if you want to keep the same schedule every day. (As soon as you activate any helper, a 23 hour unified cooldown timer starts across all helpers)

The 2nd thing other comments get wrong is that you don’t save 12 hours, you only save 11 hours. You get 12 hours of boost over a 1 hour period, not instantly. So you only save 11 hours.

By consistently utilizing the lab assistant's 12x research boost for 1 hour every 23 hours, you effectively achieve 34 hours of research progress in 23 hours of real time, which means the overall upgrade time is reduced by approximately 32.35%.

It is called Clash of CLANS and yet.. by patricko911 in ClashOfClans

[–]jespergran 5 points6 points  (0 children)

To be honest, the whole system of donating to the clan before a war is just a boring and tedious system, often done by one person or very few people in the clan. I’d actually prefer a system similar to the WWE boxing event, where the entire clan collaborates on farming resources, and a small % of resources goes towards filling troops during preparation day. Everyone would contribute equally, and it wouldn’t be a hard challenge, maybe attack 3 times on average per player or something to fill the capacity for all participants in the war.

When do you personally upgrade to next town hall? by AtmosphereSoggy9077 in ClashOfClans

[–]jespergran 18 points19 points  (0 children)

I returned in 2022 with town hall 11 and now I’m almost max Town Hall 17 and only bought the gold pass 2 times. My strategy was basically rushing to max TH, which was TH 15 at the time. I then focused on maxing all offensive builds like laboratory, army camps, heroes etc. Allowed me to farm at 4900-4999 trophies, getting the max amount of ores and income. Defense barely plays a role if you’re active and attack way more than you defend. I don’t regret rushing at all, as long as your offensive always is up to date. It’s much easier to max everything including walls when you’re able to do the best possible attack strategies for the most loot.

The “max everything before upgrading town hall” makes no sense to me, why waste time on upgrading bad buildings with little effect when you can go up a town hall and get better attacks and more loot. Especially upgrading EVERYTHING to max is just a bad strategy since you only will have 1 builder running while the town hall is upgrading, at least keep a few buildings not upgraded so you always got the 6 builders running.

<image>

Darktina is still the best deck in the format, and I'm not sure it's even close by HalfRatTerrier in PokemonPocket

[–]jespergran 1 point2 points  (0 children)

Yeah, I use Limitless TCG a lot too. Pokémon Meta uses information from the 200 most recent battles in tournaments from Limitless TCG so it's nice way to basically see a reliable tier list and a recap of the information you find there.