Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
The Prime Factor Calculator can be improved by focusing on the fact the only primes which need to be tested are 2, 3, 5, and 7. If the last value for an N can't be factored by any of those four primes then that current value of N is the last prime factor. So, output it and then a zero. For example, Test 1 uses an N of 69 with the answer being "3, 23, 0". Testing with 2 fails cuz it's odd, of course, 3 gives the 23, and then 3, 5, and 7 all fail with 23, so then output the 23 and a 0 and it's done.
I wasn't able to make a compact looking version like yours, however, the screenshot shows a solution which is both fast and has some parallelization. Perhaps, armed with this knowledge, you could produce a better version than mine.
https://steamcommunity.com/sharedfiles/filedetails/?id=2925118360