#factorials

2024-06-06

:rubberduck: made colored #factorials in 2 lines :awesome:
#python

code:
n,x = int(input("list Factorials of: ")),1; print("Factorial of: ")# cool factorials :D
for i in range(n): x = x * (i + 1); print(f"\033[3{i%7}m{i+1: ^2} = ", x) # in colors :)colored output 7! as readable listah! better :D
Bobulous :rust: :codeberg:bobulous@fosstodon.org
2024-04-08

@atamakahere Surely that would need to limit itself to u8 as the input and u128 as the output? And even then you'd need a hard limit enforced on the input value because 255! is equal to more than 3.35E104, whereas u128::MAX is less than 3.5E38.

In fact, the biggest number which fits is 34! equal to roughly 2.95E38.

Factorials grow up so fast.

#RustLang #factorials

Justin at Ecoscore Australiaecoscore@mastodon.au
2023-02-01

#factorials #math
From @waitbutwhy
February has 28 days (7 x 4). Each day has 24 hours (8 x 3). Each hour has 60 minutes (6 x 5 x 2).

So February has 8! minutes:
8 x 7 x 6 x 5 x 4 x 3 x 2 x 1.

2018-10-12

I sent that 1000! picture to a friend on #Hangouts (which #Google hasn't shut down... yet), and my friend commented on the large number of 0s at the end of the value.

I assured him that that's what happens with #factorials - by 5! you've got 2*5 as a subexpression, and by 10! you've got another factor of 10, well, right there. 15 brings in another factor of 5, and by that point, you've got a backlog of 2s. 25! has six trailing zeroes, with two factors of 5 right there.

That's #math for you.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst