[NOIP training] [Law + number theory] Application of Euler's function, noip Euler
Problem 1
[Topic]
Given
Obtain multiple groups of data.
Question
Proof: Except for an even number, the numbers of mutual quality are paired.
By.
Therefore, for the sum of each pair, there are a total of pairs.
Then
Problem 2
[Topic]
Write on the first circle, w
11371-number Theory for Newbies
Time limit:1.000 seconds
Http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=24page=show_problem problem=2366
Given any positive integer, if we permute it digits, the difference between the number we get and the Given number would a Lways is divisible by 9. For
A few days ago, inadvertently visited the science network, which introduced many number theory problems, which is my hobby, so I used to write a free time for the calculation of numbers of the unsigned large integer class.
The basic structure of a classClass CUSuperInt { public: //构造及析构函数 CUSuperInt(); CUSuperInt(DWORD dwValue); CUSuperInt(char* pszVal); CUSuperInt(CUSuperInt x); virtual ~CUSuperInt(); pr
Looking for prime number pairsTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 8771 Accepted Submission (s): 4395Problem description Goldbach Guess we all know a little bit. We're not trying to prove that, but we want to take an even number out of a set of numbers that can be represented within a programming language to find two primes so that they are eq
This is an examination of the problem of palindrome number, asking you to output the K palindrome number. In the process of doing the problem, we can find the regularity of the distribution of palindrome number: one number: 9, two digits: 9, three digits: 90, four digits: 90, five digits: 900, six digits: 900 ...#inclu
The main idea:--I can't see it myself.A joke--so much to tell what is φ and μ---But not normal φ and μ, some variants--The newly defined φ (1) = 0, the newly defined μ only computes odd prime numbers, and the number with the 2 factor is zero for the μ value.We first find the first and second questions, that is, the μ value is not equal to 0 of the partBecause of the definition of μ, the μ value is not equal to 0 when and only if the
' bad P ', where P is the smallest factor in K. Otherwise, it should output "good". Cases should is separated by a line-break.Sample Input143 10143 20667 20667 302573 302573 400 0Sample OutputGoodbad 11GOODBAD 23GOODBAD 31SourceNordic 2005Title: Given two numbers k and l,k are multiplied by two primes, if the prime number is less than L, the output bad and that prime number, otherwise the output good.First
+ 34 + 55 = 143.
The second test case, 120 + 120 + 220 + 320 = 3487832979, and 3487832979 = 3*1000000009 + 487832952, so the output is 487832952.
Theme
It is clear that the sum of the First N values of each number in the Fibonacci series is obtained from the power of M.
Ideas
At that time, I didn't dare to write down the value range of M until CF 255 (446 C) had a line segment tree similar to the idea. The official editorial gave an explanation, is
Question A is hard to understand. The number of quality factors that output the product of 10 numbers not greater than 100000
A large number is not allowed. The time is 2 S. X. First, we will learn the knowledge of a number theory:
Positive number N can be decomposed into P1
Definition of prime number:
In a natural number greater than 1, the number that cannot be divisible by other natural numbers except for 1 and the integer itself.
1 and 0 are neither prime nor composite. Prime numbers are two concepts relative to composite number, which constitute one of the most basic definitions in
"Idea":http://blog.csdn.net/iamskying/article/details/4738838Solution Ideas:Now to analyze a problem, assuming that the 10-bit number is a, and the single-digit is an integer of B as AB, it is deducedAb*ab = (a*10+b) * (a*10+b) = 100*a*a+10*2*a*b+b*bAccording to the formula available: root (ab*ab) = A*a+2*a*b+b*b = (a+b) * (A+B); [Formula I]The same can be proven: root (Ab*ab*ab) = (a+b) * (a+b) * (A+B); [Formula Two]It can be seen that the root of th
LinkDescriptionYou task was to find minimal natural number N, so that n! contains exactly Q zeroes on the trail in decimal notation. As you know n! = 1*2*...*n. For example, 5! = contains one zero on the trail.InputInput starts with an integer T (≤10000), denoting the number of test cases.Each case contains an integer Q (1≤q≤108) in a line.OutputFor each case, print the case
Enter an n (1Lacus theorem http://blog.csdn.net/acm_cxlove/article/details/7844973A, B is a non-negative integer and P is a prime number. AB is written in P-system: a=a[n]a[n-1]...a[0],b=b[n]b[n-1]...b[0].The combined number C (A, B) and C (A[n],b[n]) *c (a[n-1],b[n-1]) *...*c (a[0],b[0]) MODP the sameSo in this topic C (n, x) will n and X into 2 C (0,0) =1,c (0,1) =0,c (1,0) =1,c (a) =1So if C (n,x) is 1,
The main problem: solve the number of the factorial end of N 0.Analysis:There are 0 reasons for this: (1): 2 * 5 (2): 0 at the end of the multiplier, 10, 200However (2) can be attributed to (1), 10 = 2 * 5, 200 = 2 * 2 * 2 * 5 * 5It is easy to think of n! After decomposition into the product of prime number, only 2 * 5 This combination can produce the end of the 0, and 2 of the
Rightmost DigitProblem Descriptiongiven A positive integer N, you should output the most right digit of n^n.Inputthe input contains several test cases. The first line of the input was a single integer T which is the number of test cases. T test Cases follow.Each test case is contains a single positive integer N (1Outputfor Each test case, you should output the rightmost digit of n^n. Sample Input234Sample OutputHintIn the first case, 3 * 3 * 3 = right
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.