16 mathematical problems in the D Chen Yueliang of Harbin Polytechnic freshmen (number theory) __ Chen Yueliang Maths problems

Source: Internet
Author: User
Topic Link: Click to open the topic link

The maths problem of Chen Yueliang
Time limit:2000 MS Memory limit:32768 K
Total submit:102 (accepted:46 users) rating:special Judge:no

Description
Chen Yueliang Love Mathematics since childhood, this day the teacher talked about any positive integer n, we can easily find all the factors of N, N1,n2,n3...,nk, called n a total of K factor (including 1 and n itself).
To find the value of K is too simple for Chen Yueliang. So she wanted to ask for the number of factors for all n factors (such as N1 may contain N1 factors (including 1 and N1 itself), N2 may contain N2 factors, ..., NK may contain NK factors, and then calculate the value of s:
Input
The first behavior is an integer t (T <= 10000), which represents the number of groups that test the data.
Then the T row is a positive integer n (n < 2 ^ 31) per line.
Output

For each set of test data, output the value of S.

Sample Input
2
6
9
Sample Output
81
36
Source
National Invitational Program for 2016-class freshmen

Solving:
We know that we can decompose a number of N into n=pa11∗pa22∗pa33∗ ... ∗pann n= p_1^{a_1}* p_2^{a_2}* p_3^{a_3}*...* P_n^{a_n}, where Pi p_i is prime. So the number of factors for n is (a1+1) (a2+1) (a3+1) ... (ak+1) =∏ki=1 (ai+1) (a_1+1) (a_2+1) (a_3+1) ... (a_k+1) =\prod_{i=1}^{k} (a_i+1).
so the number of factors for all n is ∏ki=1 (1+2+3+...+ai+1) =∏ki=1 (1+ai+1) (ai+1) 2 \prod_{i=1}^{k} (1+2+3+...+a_i+1) =\prod_{i=1}^{k}\frac{ (1+a_i+1) (a_i+1)} {2}, but this is only a S=n1+n2+n3+...+nk value

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.