Combinatorics — Factor's

Revision en6, by Gokuu007, 2023-03-03 18:15:30

************************************ Factors ***************************************

So recently when I was studying some basics of combinatorics i got an idea of a problem, So in this blog I will be sharing the problem and the solution of the problem. And the solution of the problem.

So the problem statement is :

You are given a no N and m queries. there 3 type of queries :

Type 1 : You have to print the total no of factors of N. (1<=N<=10^18)

Type 2 : You have to print the total sum of factors of N.

Type 3 : You have to print the total sum of the reciprocals of the factors of N.

Solution :

Time Complexity O(log(N)). Space Complexity O(N).

Tags maths, combinatorics, implementations

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en10 English Gokuu007 2023-03-03 23:03:59 52
en9 English Gokuu007 2023-03-03 22:56:52 64
en8 English Gokuu007 2023-03-03 18:21:01 36
en7 English Gokuu007 2023-03-03 18:17:11 8 Tiny change: 'Solution : ](http://https://gi' -> 'Solution :](https://gi'
en6 English Gokuu007 2023-03-03 18:15:30 6 Tiny change: 'of **N**. **(1<=N<=10^18)**\n\n**Type' -> 'of **N**. _(1<=N<=10^18)_\n\n**Type'
en5 English Gokuu007 2023-03-03 18:15:12 18 Tiny change: ' of **N**.\n\n**Type' -> ' of **N**. **(1<=N<=10^18)**\n\n**Type'
en4 English Gokuu007 2023-03-03 18:14:43 11
en3 English Gokuu007 2023-03-03 18:14:14 159
en2 English Gokuu007 2023-03-03 18:10:57 38
en1 English Gokuu007 2023-03-03 18:10:09 822 Initial revision (published)