# how to find prime factorisation of a number?

How can I find the prime factorisation of a large number in linear time?
large number implies that n>=10^9 and n<=10^18
and
Is there any method to find the prime factorisation in constant time?

Can anyone help me…?

If you are interested in number of divisors you can do that in O(n^(1/3)) which is approx 1e6 for n=1e18.
But finding prime factorization at best takes somewhat around sqrt(n) which is feasible for 1e9 but not 1e18.

1 Like
{"ft_lang_label":"__label__en","ft_lang_prob":0.9064273,"math_prob":0.9361226,"size":645,"snap":"2023-40-2023-50","text_gpt3_token_len":171,"char_repetition_ratio":0.1450858,"word_repetition_ratio":0.6181818,"special_character_ratio":0.2635659,"punctuation_ratio":0.05925926,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9862684,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-22T07:53:49Z\",\"WARC-Record-ID\":\"<urn:uuid:bf9a228c-41ff-4dee-bf39-ad9641481444>\",\"Content-Length\":\"14835\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1c76e695-f243-42df-bc61-f47fb3d67e6b>\",\"WARC-Concurrent-To\":\"<urn:uuid:8cc832a2-8c68-4986-af3b-c2e7ffce564c>\",\"WARC-IP-Address\":\"35.170.134.216\",\"WARC-Target-URI\":\"https://discuss.codechef.com/t/how-to-find-prime-factorisation-of-a-number/18970\",\"WARC-Payload-Digest\":\"sha1:EOHAXPOAZ2AHUBVZZJSTBBARLBXTITVI\",\"WARC-Block-Digest\":\"sha1:IBKJ7EYA2SZENEPTDE5SSPBBIBYPGFYV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233506339.10_warc_CC-MAIN-20230922070214-20230922100214-00295.warc.gz\"}"}