HN user

SethTro

982 karma
Posts4
Comments127
View on HN
Dark Castle 3 months ago

User input doesn't seem to work. Other classics on the site do work but not Dark Castle (at least for me)

Project Euler 8 months ago

I'm glad you enjoyed! It was a real game I played when driving around.

Is that for [0, 10^12] or for 10^18 + 10^12? Is the 3.75 hrs total core hours or system time?

I wrote https://github.com/sethtroisi/goldbach in the last four hours and I think it's 10-100x faster than your code

  time ./goldbach -t8 -K 1024 -e 100''000''000''000
  real 0m44.133s
  user 3m32.193s
  sys 0m0.092s

  time ./goldbach -t12 -K 1500 -e 1''000''000''000''000
    267468893942 = 267468891139 + 2803 (407)
    926868341768 = 926868338701 + 3067 (437)
    599533546358 = 599533542901 + 3457 (481)
  real 2m3.909s
  user 16m0.729s
  sys 0m37.960s

I know of at least another 4x I could improve it but I've been nerd sniped enough for the night.

I wouldn't trust it 100% but it finds all terms in https://oeis.org/A025018 and https://oeis.org/A025019 and I can verify in https://sweet.ua.pt/tos/goldbach.html

Goldbach states: every even number ≥ 4 is a sum of two primes. The naive check for an even n tries many primes p and hopes that n − p is prime. Our idea is simpler: fix a small set of primes Q = {q1, . . . , qK} (the “gear”), and for each even n only test p = n − q with q ∈ Q

I don't see how your idea is different from the naive check. As far as I can tell you are basically saying do the naive check but only up to p > 250-300?

Totally agree with the title. I discovered Fenwick trees as part of solving a Project Euler, then from the problem forum I found out someone had invented this in the 90s and other people had imagined it much earlier.

From my reading the disagreement is about how often or much chocolate people consume. The thresholds (MADL, EU) are in µg/day and the Consumer Reports numbers are in µg/serving.

Arstechnica somewhat bridges this gap at the end with quotes including "at these intake levels", "A single serving", "from time to time", "indulging during holidays".

Took less than a minute to find a seven digit example in python

The SHA-256 of this sentence begins with 0, three, 9, four, 8, four, and 1 amazing!

The SHA256 for this sentence begins with 0, 4, five, 5, eight, 6, and 7 amazing!

Suffix extensions (hence the "amazing!") are several times faster to try than throwing away the entire sha256 state for each attempt.

For Dvorak with a little assist from unix

First row

$ awk '/^[,.pyfgcrl]$/ { print length(), $0 }' /usr/share/dict/words | sort -nr | head

3 pry / ply / fry / cry

Second row

$ awk '/^[aoeuidhtns]$/ { print length(), $0 }' /usr/share/dict/words | sort -nr | head

15 tendentiousness

14 assassinations

13 instantaneous

13 insidiousness

Third row

$ awk '/^[;qjkxbmwvz]*$/ { print length(), $0 }' /usr/share/dict/words | sort -nr | head

4 xxxv

3 xxx

3 xxv

2 xx

Article is paywalled and archive.ph is in an infinite CAPTCHA loop so feel free to reply with their numbers.

Global Electrical Consumption = 25,000 TWh Data centers @ 2% of global usage = 25,000 * 0.02 = 500 TWh Cryptocurrency estimated usage in 2022[1][2] = 100-140 TWh

Crypto uses 100 / (500 + 100) = 16% of the power usage of data centers + crypto. Surprising and disappointing.

[1] https://digiconomist.net/bitcoin-energy-consumption [2] https://www.nytimes.com/interactive/2021/09/03/climate/bitco...

It was 10 years ago but I'm very sure it was "quote the raven", "whip the llama" is too funmy for me to not remember if that has been it. I searched the source and didn't see it but can't find a source control system copy to search over all the history.

I love my ESP32-S series. I use them in tons of LED projects[1]. Sadly it seems WS2812b are fundamentally incompatible, under FreeRTOS, with wifi due to timing glitches from interrupts.

In my next two project I'm going to have to run two 30ft cables because I can figure out how to get low latency wifi to work on a Raspberry Pi 2040 (where PIO is fabulous, but 500ms request latency is killing me) or without glitches on a ESP32.

[1] https://anima.haus/events/seacompression