⚡ PHP 8.3.30

Fancy Math bcmath · sieve · monte carlo

Everything on this page is recomputed per request. Change n and watch it move.

Fibonacci(40)

102334155

9 digits — well past what a 64-bit integer holds (max 19 digits).

40! (factorial)

815915283247897734345611269596115894272000000000

48 digits, computed exactly with arbitrary-precision bcmath.

Primes & statistics sieve to 900

154

primes found ≤ 900

407.8

mean

393.0

median

267.7

std deviation

First 40: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173 …

Monte Carlo π

Threw 200,000 random darts at a unit square; 156,786 landed inside the quarter circle.

π ≈ 3.135720

Actual π = 3.141593 — off by 0.005873.

Collatz orbit of 40

9 steps to reach 1, peaking at 40.

40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1

3×3 Matrix multiply A · B = C

   1     2     3      9     8     7     30    24    18
   4     5     6 x    6     5     4 =   84    69    54
   7     8    10      3     2     1    141   116    91