| advertise add site services publishers database health videos | ![]() | about toolbar stats live show health store more stuff JOIN/LOGIN |
Function of the Skin - Some of the Important Functions of your Skin skin-care-tips.org | the functions of the doshas,dosha,the composition of the doshas,DOSHAS... healthandyoga.com | 39th Annual Scientific Meeting of the Australian and New Zealand Society... anzsnm2009.com | Sinuses and their Function allergy-sinusrelief.com |
For other functions named after Euler, see List of topics named after Leonhard Euler. In number theory, the totient The totient function is important mainly because it gives the size of the multiplicative group of integers modulo n. More precisely,
[edit] Computing Euler's functionIf p is prime, then for integer where the pj are distinct primes, then This last formula is an Euler product and is often written as with the product ranging only over the distinct primes p dividing n. [edit] Computing exampleIn words, this says that the distinct prime factors of 36 are 2 and 3; half of the thirty-six integers from 1 to 36 are divisible by 2, leaving eighteen; a third of those are divisible by 3, leaving twelve coprime to 36. And indeed there are twelve: 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, and 35. Moreover W. Schramm has shown that: [edit] Some values of the functionThe first few values (sequence A000010 in OEIS) are shown in the table and graph below: Run chart of the first 100 values
[edit] Implementation[edit] Implementation in CThis is an implementation of the totient function for a non-negative 64-bit integer argument n written in C using the sieve of Eratosthenes to determine the prime factors and the method described above. It depends upon a binary GCD C implementation (uint64 bgcdll(uint64,uint64)) and an integer square root function (uint64 sqrtll(uint64)). Sieve factorization methods are efficient for small numbers (12 digits or so), but inefficient for larger numbers. For example, totient(9223372036854775837LL) requires many tens of seconds on a modern computer, whereas more efficient algorithms require a tiny fraction of this time. Thus, this implementation is practical for small integers, but impractical over the full 64-bit full range. typedef unsigned long long uint64; typedef unsigned char uint8; #define TOTIENT_TABLE_SIZE 20 static unsigned short int totient_table[TOTIENT_TABLE_SIZE] = { /* phi(1), phi(2), ... */ 1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 4, 12, 6, 8, 8, 16, 6, 18, 8 }; uint64 totient(uint64 n) /* Return Euler's totient function. */ { uint64 sqrtll(uint64),bgcdll(uint64,uint64); uint64 res=1,p,phip,pf=1,sqrtn=sqrtll(n); uint8 pflag; if (n <= 0) return 0; /* Really DATA ERROR by Fundamental Theorem of Arithmetic */ if (n <= TOTIENT_TABLE_SIZE) return totient_table[n-1]; for (p=2;;) { phip=p-1; pflag=0; while (n%p == 0) { /* phi(p^k) = p^(k-1)*(p-1) */ if (!pflag && !(bgcdll(pf,p) == 1)) break; res *= phip; phip = p; n = n/p; if (!pflag) pf *= p; pflag = 1; } if (pflag) sqrtn = sqrtll(n); p = (p > 2)? p+2 : 3; if (p > sqrtn) break; } /* n is necessarily 1 or a distinct prime */ if (n > 1) res *= (n-1); return res; } /* Integer square root based upon http://www.codecodex.com/wiki/Calculate_an_integer_square_root */ uint64 sqrtll(uint64 x) /* Return the integer square root. */ { uint64 op=x,res=0,one; /* "one" starts at the highest power of four <= than the argument. */ one = (uint64)1 << (8*sizeof(uint64)-2); /* second-to-top bit set */ while (one > op) one >>= 2; while (one != 0) { if (op >= res + one) { op = op - (res + one); res = res + (one+one); } res >>= 1; one >>= 2; } return res; } [edit] PropertiesThe number where the sum extends over all positive divisors d of n. We can now use the Möbius inversion formula to "invert" this sum and get another formula for where μ is the usual Möbius function defined on the positive integers. According to Euler's theorem, if a is coprime to n, that is, gcd(a, n) = 1, then This follows from Lagrange's theorem and the fact that a belongs to the multiplicative group of [edit] Generating functionsThe two generating functions presented here are both consequences of the fact that A Dirichlet series involving where ζ(s) is the Riemann zeta function. This is derived as follows: A Lambert series generating function is which converges for |q|<1. This follows from which is [edit] Growth of the functionThe growth of for any given ε > 0 and n > N(ε). In fact if we consider we can write that, from the formula above, as the product of factors taken over the prime numbers p dividing n. Therefore the values of n corresponding to particularly small values of the ratio are those n that are the product of an initial segment of the sequence of all primes. From the prime number theorem it can be shown that a constant ε in the formula above can therefore be replaced by
where the big O is the Landau symbol. This also says that the probability of two positive integers chosen at random from Because A proof of these formulas may be found here. [edit] Other formulas involving Euler's functionwhere m > 1 is a positive integer and ω(m) designates the number of distinct prime factors of m. (This formula counts the number of naturals less than or equal to n and relatively prime to m, additional material is listed among the external links.) Proofs of some of these identities may be found here. [edit] InequalitiesSome inequalities involving the
and For prime n, clearly For a composite number n we have
For randomly large n, these bounds still cannot be improved, or to be more precise: A pair of inequalities combining the The last two are proved on the page on proofs of totient identities. [edit] Ford's theoremFord (1999) proved that for every integer k ≥ 2 there is a number m for which the equation φ(x) = m has exactly k solutions; this result had previously been conjectured by Wacław Sierpiński. However, no such m is known for k = 1, and according to Carmichael's totient function conjecture it is believed that in this case no such m exists. [edit] See also
[edit] References
[edit] External links
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ↑ top of page ↑ | about thumbshots |