Whats the best math formula to resolve this ? (i came out with that one, pic related, but i'm not sure) "All natural numbers bellow 1000000 i can form using only the 0~9 digits, without repeating them and not accepting only zero nor zeros to the left.
Tyler Adams
bump!
Camden Nelson
Drop out of college lol
Nolan Jones
...
Juan Sanders
i tried
Isaiah Barnes
...
Andrew Myers
i'll buy you anons
Robert Perez
...
Jackson Long
Sauce?
Samuel Ramirez
...
Henry Harris
Rocco - Animal trainer, some number...i dont remember, just watch the damn serie, its all good.
Christian Sanchez
...
Juan Clark
You're forgetting an entire digit's place, the correct formula is as in pic.
There's no closed form for this sum in general, so its the best you're gonna get.
Mason Russell
Who's the girl though
Cameron Jenkins
...
Jace Miller
Your solution is correct. Confirmed by bruteforcing in python:
$$$ def is_valid(n): ... s = str(n) ... return len(s) == len(set(s)) and n != 0 ... $$$ sum(1 for i in range(1000000) if is_valid(i)) 168570