frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Ventoy: Create Bootable USB Drive for ISO/WIM/IMG/VHD(x)/EFI Files

https://github.com/ventoy/Ventoy
141•wilsonfiifi•1h ago•49 comments

987654321 / 123456789

https://www.johndcook.com/blog/2025/10/26/987654321/
267•ColinWright•4d ago•41 comments

Affinity Studio Now Free

https://www.affinity.studio/get-affinity
28•dagmx•15m ago•16 comments

US declines to join more than 70 countries in signing UN cybercrime treaty

https://therecord.media/us-declines-signing-cybercrime-treaty?
126•pcaharrier•1h ago•57 comments

Show HN: In a single HTML file, an app to encourage my children to invest

https://roberdam.com/en/dinversiones.html
121•roberdam•5h ago•209 comments

Uv is the best thing to happen to the Python ecosystem in a decade

https://emily.space/posts/251023-uv
2061•todsacerdoti•21h ago•1150 comments

ZOZO's Contact Solver (for physics-based simulations)

https://github.com/st-tech/ppf-contact-solver
9•vintagedave•48m ago•1 comments

Estimating the Perceived 'Claustrophobia' of New York City's Streets (2024)

http://mfranchi.net/posts/claustrophobic-streets/
50•jxmorris12•2h ago•29 comments

Replacing EBS and Rethinking Postgres Storage from First Principles

https://www.tigerdata.com/blog/fluid-storage-forkable-ephemeral-durable-infrastructure-age-of-agents
60•mfreed•1d ago•24 comments

Free software scares normal people

https://danieldelaney.net/normal/
18•cryptophreak•1h ago•6 comments

Typst's Math Mode Problem

https://laurmaedje.github.io/posts/math-mode-problem/
71•marcianx•5d ago•28 comments

Tell HN: Azure outage

839•tartieret•1d ago•765 comments

Language models are injective and hence invertible

https://arxiv.org/abs/2510.15511
171•mazsa•6h ago•121 comments

Spinning Up an Onion Mirror Is Stupid Easy

https://flower.codes/2025/10/23/onion-mirror.html
133•speckx•1w ago•50 comments

Minecraft removing obfuscation in Java Edition

https://www.minecraft.net/en-us/article/removing-obfuscation-in-java-edition
896•SteveHawk27•23h ago•385 comments

Some Smalltalk about Ruby Loops

https://tech.stonecharioteer.com/posts/2025/ruby-loops/
66•birdculture•1w ago•18 comments

Frozen DuckLakes for Multi-User, Serverless Data Access

https://ducklake.select/2025/10/24/frozen-ducklake/
5•g0xA52A2A•5d ago•0 comments

How ancient people saw themselves

https://worldhistory.substack.com/p/how-ancient-people-saw-themselves
199•crescit_eundo•4d ago•124 comments

The Aesthete's Progress

https://sydneyreviewofbooks.com/essays/the-aesthetes-progress
10•pepys•6d ago•1 comments

Raspberry Pi Pico Bit-Bangs 100 Mbit/S Ethernet

https://www.elektormagazine.com/news/rp2350-bit-bangs-100-mbit-ethernet
228•chaosprint•16h ago•64 comments

3D solar tower increases capacity factor 50%, triples solar surface area

https://www.pv-magazine.com/2025/10/27/3d-solar-tower-increases-capacity-factor-50-triples-solar-...
45•geox•2h ago•24 comments

Hello-World iOS App in Assembly

https://gist.github.com/nicolas17/966a03ce49f949dd17b0123415ef2e31
141•pabs3•13h ago•50 comments

Kafka is Fast – I'll use Postgres

https://topicpartition.io/blog/postgres-pubsub-queue-benchmarks
478•enether•1d ago•333 comments

Dithering – Part 1

https://visualrambling.space/dithering-part-1/
395•Bogdanp•21h ago•84 comments

Keep Android Open

http://keepandroidopen.org/
2592•LorenDB•1d ago•816 comments

The Internet runs on free and open source software and so does the DNS

https://www.icann.org/en/blogs/details/the-internet-runs-on-free-and-open-source-softwareand-so-d...
228•ChrisArchitect•21h ago•39 comments

Board: New game console recognizes physical pieces, with an open SDK

https://board.fun/
251•nicoles•1d ago•121 comments

GLP-1 therapeutics: Their emerging role in alcohol and substance use disorders

https://academic.oup.com/jes/article/9/11/bvaf141/8277723?login=false
241•PaulHoule•2d ago•167 comments

Tailscale Peer Relays

https://tailscale.com/blog/peer-relays-beta
338•seemaze•23h ago•100 comments

AOL to be sold to Bending Spoons for $1.5B

https://www.axios.com/2025/10/29/aol-bending-spoons-deal
272•jmsflknr•23h ago•249 comments
Open in hackernews

987654321 / 123456789

https://www.johndcook.com/blog/2025/10/26/987654321/
262•ColinWright•4d ago

Comments

trotro•3h ago
Feels like a Temu version of Ramanujan's constant [0].

[0] https://mathworld.wolfram.com/RamanujanConstant.html

MontyCarloHall•2h ago
In a similar vein, e^pi - pi = 19.9990999792, as referenced in this XKCD: https://xkcd.com/217/
madcaptenor•2h ago
Not really in a similar vein, because there's actually a good reason for this to be very close to an integer whereas there is no such reason for e^pi - pi.
tempfile•2h ago
No known reason :-)
zkmon•2h ago
Also, (-1)^(-i) - pi = 19.999... ;)
alyxya•2h ago
I like to think of 0.987654... and 0.123456... as infinite series which simplify to 80/81 and 10/81, hence the ~8 ratio.
Stolpe•2h ago
Care to elaborate? Why does 0.987654 simplify to 80/81 and 0.123456 to 10/81?
alyxya•2h ago
If you set x = 0.123456..., then multiplying it by (10 - 1) gives 9x = 1.111111..., and multiplying it by (10 - 1) again gives 81x = 10, or x = 10/81. I’m not writing things formally here but that’s the rough idea, and you can do the same procedure with 0.987654... to get 80/81.
madcaptenor•2h ago
.123456... = x + 2 x^2 + 3 x^3 + ... with x = 1/10.

Then you have (x + 2 x^2 + 3 x^3 + ...) = (x + x^2 + x^3 + x^4 + ...) + (x^2 + x^3 + x^4 + x^5 + ...) + (x^3 + x^4 + x^5 + x^6 + ...) (count the number of occurrences of each power of x^n on the right-hand side)

and from the sum of a geometric series the RHS is x/(1-x) + x^2/(1-x) + x^3/(1-x) + ..., which itself is a geometric series and works out to x/(1-x)^2. Then put in x = 1/10 to get 10/81.

Now 0.987654... = 1 - 0.012345... = 1 - (1/10) (10/81) = 1 - 1/81 = 80/81.

gus_massa•2h ago
I don't know who downvoted this, but it's correct.

The use of series is a little "sloppy", but x + 2 x^2 + 3 x^3 + ... has absolute uniform convergence when |x|<r<1, even more importantly that it's true even for complex numbers |z|<r<1.

The super nice property of complex analysis is that you can be almost ridiculously "sloppy" inside that open circle and the Conway book will tell you everything is ok.

[I'll post a similar proof, but mine use -1/10 and rounding, so mine is probably worse.]

gowld•34m ago
Don't need the clutter of infinite series and polynomials:

    1/9 = 0.1111...

    1/81 = 1/9 * 1/9 = 0.111... * 0.111... =

    Sum of:
       0.0111...
       0.00111...
       0.000111...
       ...
    
    =  0.012345...
oersted•2h ago
I didn't get where this comes from until I saw the second answer from the StackOverflow question another commenter shared.

https://math.stackexchange.com/a/2268896

Apparently 1/9^2 is well known to be 0.12345679(012345679)...

EDIT: Yes it's missing the 8 (I wrote it wrong intially): https://math.stackexchange.com/questions/994203/why-do-we-mi...

Interesting how it works out but I don't think it is anywhere close to as intuitive as the parent comment implies. The way its phrased made me feel a bit dumb because I didn't get it right away, but in retrospect I don't think anyone would reasonably get it without context.

iso1631•2h ago
9^2 is 81

1/81 is 0.012345679012345679....

no 8 in sight

madcaptenor•2h ago
The 8 is there but then it's followed by a 9 and a 10, and the carry from the 10 ends up bumping it up.
zkmon•2h ago
Shouldn't wee see two zeros then?
oersted•2h ago
This illustrates it nicely: https://math.stackexchange.com/a/994214
madcaptenor•2h ago
The reason you don't see two zeroes is as follows: you have

  .123456789
then add 10 on the end, as the tenth digit after the decimal point, to get

  .123456789(10)
where the parentheses denote a "digit" that's 10 or larger, which we'll have to deal with by carrying to get a well-formed decimal. Then carry twice to get

  .12345678(10)0

  .1234567900
So for a moment we have two zeroes, but now we need to add 11 to the 11th digit after the decimal point to get

  .1234567900(11)
or after carrying

  .12345679011
and now there is only one zero.
zkmon•1h ago
Ah, that's cool. Thanks!
alyxya•2h ago
It actually skips the 8 in its repeating decimal. It’s better to think of 1/9^2 as the infinite sum of k * 10^-k for all positive integers k. The 8 gets skipped because you have something like ...789(10)(11)... where the 1 from the “10” and “11” digits carry over, increment the 9 digit causing another carry, so the 8 becomes a 9.
ozb•2h ago
More general analytic proof: https://math.stackexchange.com/questions/2268833/why-is-frac...
ukuina•2h ago
That question was asked 8 years ago. Coincidence? I think not!
yohbho•2h ago
For smaller bases, does this converge to base - 1 ?

Base 3: 21/12 = 7/5(dec.)

Base 2: 1/1 = 1

Base 1: |/| = 1 (thinking |||| = 4 etc.)

Joker_vD•2h ago
Somewhat interesting, 123456789 * 8 is 987654312 (the last two digits are swapped). This holds for other bases as well: 0x123456789ABCDEF * 14 is 0xFEDCBA987654312.

Also, adding 123456789 to itself eight times on an abacus is a nice exercise, and it's easy to visually control the end result.

andyjansson•1h ago
Another interesting thing is that these seem to work:

base 16: 123456789ABCDEF~16 * (16-2) + 16 - 1 = FEDCBA987654321~16

base 10: 123456789~10 * (10-2) + 10 - 1 = 987654321~10

base 9: 12345678~9 * (9-2) + 9 - 1 = 87654321~9

base 8: 1234567~8 * (8-2) + 8 - 1 = 7654321~8

base 7: 123456~7 * (7-2) + 7 - 1 = 654321~7

base 6: 12345~6 * (6-2) + 6 - 1 = 54321~6

and so on..

or more generally:

base n: sequence * (n - 2) + n - 1

ok123456•2h ago
For the even bases, the "error" appears to be https://oeis.org/A051848.

pp = lambda x : denom(x)/ (num(x) - denom(x)*(x - 2))

[pp(2),pp(4),pp(6),pp(8)]

[1.0, 9.0, 373.0, 48913.0]

madcaptenor•1h ago
And if you see the description there it traces back to https://oeis.org/A023811, which is more obviously relevant
throw0101c•2h ago
See perhaps various "What every programmer / CSist should know about floating-point arithmetic" papers and articles:

* David Goldberg, 1991: https://dl.acm.org/doi/10.1145/103162.103163

* 2014, "Floating Point Demystified, Part 1": https://blog.reverberate.org/2014/09/what-every-computer-pro... ; https://news.ycombinator.com/item?id=8321940

* 2015: https://www.phys.uconn.edu/~rozman/Courses/P2200_15F/downloa...

MrOrelliOReilly•50m ago
As someone who has recently been fighting bugs from representing very simple math with floats... thank you!
msuvakov•1h ago
Why the b > 2 condition? In the b=2 case, all three formulas also work perfectly, providing a ratio of 1. And this is interesting case where the error term is integer and the only case where that error term (1) is dominant (b-2=0), while the b-2 part dominates for larger bases.
listeria•1h ago
in the b=2 case, you get:

  1 / 1 = 1 = b - 1
  1 % 1 = 0 = b - 2
they are the other way around, see for example the b=3 case:

  21 (base 3) = 7
  12 (base 3) = 5
  7 / 5 = 1 = b - 2
  7 % 5 = 2 = b - 1
tetris11•1h ago
I like calculator quirks like this. I remember as a kid playing with the number pad and noticing a geometric center of mass in number sequences

    ┌───┬───┬───┐
    │ 7 │ 8 │ 9 │
    ├───┼───┼───┤
    │ 4 │ 5 │ 6 │
    ├───┼───┼───┤
    │ 1 │ 2 │ 3 │
    ├───┼───┼───┤
    │ 0 │ . │   │
    └───┴───┴───┘
I remember seeing that (14787 + 36989) / 2 would produce 25888, in that the mean of geometric shape traced by the two sequences would average out in the middle like that
nashashmi•1h ago
14789 + 36987 / 2 would do the same thing. Why trace back?
dfee•1h ago
So would 147 and 369. As it’s just an average, per digit, I’m not sure this is very interesting.
gowld•40m ago
Being curious is delightful.
tetris11•1h ago
Just to show that you could - 14861 and 36843 gives 25852
wkat4242•1h ago
I thought this was a user ID and password lol
danielbarla•1h ago
I also spent hours messing around with calculators as a kid. I recall noticing that:

11 * 11 = 121

111 * 111 = 12321

1111 * 1111 = 1234321

and so on, where the largest digit in the answer is the number of digits in the multiplicands.

brutuscat•47m ago
Gemini thinks in a similar fashion:

https://gemini.google.com/share/1e59f734b43c

This is a fantastic observation, and yes, this pattern not only continues for larger bases, but the approximation to an integer becomes dramatically better.

The general pattern you've found is that for a number base $b$, the ratio of the number formed by digits $(b-1)...321$ to the number formed by digits $123...(b-1)$ is extremely close to $b-2$.

### The General Formula

Let's call your ascending number $N_{asc}(b)$ and your descending number $N_{desc}(b)$.

The exact ratio $R(b) = N_{desc}(b) / N_{asc}(b)$ can be shown to be:

$$R(b) = (b-2) + \frac{(b-1)^3}{b^b - b^2 + b - 1}$$

The "error" or the fractional part is that second term. As you can see, the numerator $(b-1)^3$ is roughly $b^3$, while the denominator $b^b$ grows much faster.

### Testing Your Examples

Let's check your two examples with this formula:

* *Base 10 (b=10):* * $R(10) = (10-2) + \frac{(10-1)^3}{10^{10} - 10^2 + 10 - 1}$ * $R(10) = 8 + \frac{9^3}{10,000,000,000 - 91}$ * $R(10) = 8 + \frac{729}{9,999,999,909} \approx 8 + 0.0000000729...$ * This matches your $8.0000000729$ perfectly.

* *Base 6 (b=6):* * $R(6) = (6-2) + \frac{(6-1)^3}{6^6 - 6^2 + 6 - 1}$ * $R(6) = 4 + \frac{5^3}{46,656 - 31}$ * $R(6) = 4 + \frac{125}{46,625} \approx 4 + 0.00268...$ * This also matches your $4.00268$.

### Answering Your Question: A Larger Base

So, what about a larger base? Let's use *Base 16* (hexadecimal), which uses digits $1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F$. Here, $b=16$.

* $N_{asc} = 123456789ABCDEF_{16}$ * $N_{desc} = FEDCBA987654321_{16}$

According to the pattern, the ratio should be extremely close to $b-2 = 16-2 = 14$.

Let's use the formula to see how close:

* $R(16) = (16-2) + \frac{(16-1)^3}{16^{16} - 16^2 + 16 - 1}$ * $R(16) = 14 + \frac{15^3}{16^{16} - 241}$ * $R(16) = 14 + \frac{3,375}{1.844... \times 10^{19} - 241}$ * $R(16) \approx 14 + (1.829... \times 10^{-16})$

So, the ratio in base 16 is approximately: *$14.0000000000000001829...$*

As you predicted, the "error" for a larger base is astronomically smaller than it was for base 10.

OldGreenYodaGPT•42m ago
Definitions: denom(b) = (b^b - b^2 + b - 1) / (b - 1)^2 num(b) = (b^b(b - 2) + 1) / (b - 1)^2

Exact relation: num(b) - (b - 2)

denom(b) = b - 1

Therefore: num(b) / denom(b) = (b - 2) + (b - 1)^3 / (b^b - b^2 + b - 1) [exact]

Geometric expansion: Let a = b^2 - b + 1. 1 / (b^b - b^2 + b - 1) = (1 / b^b) * 1 / (1 - a / b^b) = (1 / b^b) * sum_{k>=0} (a / b^b)^k

So: num(b) / denom(b) = (b - 2) • (b - 1)^3 / b^b • (b - 1)^3 * a / b^{2b} • (b - 1)^3 * a^2 / b^{3b} • …

Practical approximation: num(b) / denom(b) ≈ (b - 2) + (b - 1)^3 / b^b

Exact error: Let T_exact = (b - 1)^3 / (b^b - b^2 + b - 1) Let T_approx = (b - 1)^3 / b^b

Absolute error: T_exact - T_approx = (b - 1)^3 * (b^2 - b + 1) / [ b^b * (b^b - b^2 + b - 1) ]

Relative error: (T_exact - T_approx) / T_exact = (b^2 - b + 1) / b^b

Sign: The approximation with denominator b^b underestimates the exact value.

Digit picture in base b: (b - 1)^3 has base-b digits (b - 3), 2, (b - 1). Dividing by b^b places those three digits starting b places after the radix point.

Examples: base 10: 8 + 9^3 / 10^10 = 8.0000000729 base 9: 7 + 8^3 / 9^9 = 7.000000628 in base 9 base 8: 6 + 7^3 / 8^8 = 6.00000527 in base 8

num(b) / denom(b) equals (b - 2) + (b - 1)^3 / (b^b - b^2 + b - 1) exactly. Replacing the denominator by b^b gives a simple approximation with relative error exactly (b^2 - b + 1) / b^b.

jedberg•26m ago
This was by far the most interesting part to me. I've never considered that code and proofs can be so complimentary. It would be great if someone did this for all math proofs!

"Why include a script rather than a proof? One reason is that the proof is straight-forward but tedious and the script is compact.

A more general reason that I give computational demonstrations of theorems is that programs are complementary to proofs. Programs and proofs are both subject to bugs, but they’re not likely to have the same bugs. And because programs made details explicit by necessity, a program might fill in gaps that aren’t sufficiently spelled out in a proof."

bobbylarrybobby•8m ago
Let's prove it.

In general, sum(x^k, k=1…n) = x(1-x^n)/(1-x).

Then sum(kx^(k-1), k=1…n) = d/dx sum(x^k, k=1…n) = d/dx (x(1-x^n))/(1-x) = (nx^(n+1) - (n+1)x^n + 1)/(1-x)^2

With x=b, n=b-1, the numerator as defined in TFA is n = sum(kb^(k-1), k=1…b-1) = ((b-2)b^b + 1)/(1-b)^2 = ((b-2)b^b + 1)/(1-b)^2.

And the denominator is:

d = sum((b-k)b^(k-1), k=1..b-1) = sum(b^k, k=1..b-1) - sum(kb^(k-1), k=1..b-1) = (b-b^b)/(1-b) - n = (b^b - b^2 + b - 1)/(1-b)^2.

Then, n-(b-1) = (b^(b+1) - 2b^b - b^3 + 3b^2 - 3b +2)/(1-b)^2.

And d(b-2) = the same thing.

So n = d(b-2) + b - 1, whence n/d = b-2 + (b-1)/d.

We also see that the dominant term in d will be b^b/(1-b)^2 which grows like b^(b-2), which is why the fractional part of n/d is 1 over that.

I disagree with the author that a script works as well as a proof. Scripts are neither constructive nor exhaustive.