File:EulerPhi.svg

Summary

Description
English: Plot of the first 1000 values of the en:Euler's totient function. Svg version of Image:EulerPhi.PNG
Italiano: I primi 1000 valori della it:Funzione φ di Eulero. Versione svg di Image:EulerPhi.PNG.
Date
Source Own work
 
This W3C-unspecified plot was created with Matplotlib.
Category:Unspec SVG created with Matplotlib#00050718EulerPhi.svg
Author Pietro Battiston (it:User:Toobaz)
Other versions Image:EulerPhi.PNG

Created with the following script, ran in "ipython -pylab":

xlabel('n')
ylabel('$\phi(n)$')
plot([None]+[fi(i) for i in range(1,1000)], 'b.')

"fi" is the Euler φ, defined for instance as:

def fattorizza(n):
    c = 0
    f = {}
    for i in xrange( 2, int(sqrt(n))+1 ):
        if not n%i:
            f[i] = 1
            n /= i
        while not n%i:
            f[i] += 1
            vn = n
            n /= i
        if n == 1:
            return f
    f[n] = 1
    return f

def fi(n):
    if n == 1:
        return 1
    fi = 1
    f = fattorizza(n)
    for p in f:
        k = f[p]
        fi *= (p-1)*p**(k-1)
    return fi

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
Category:License migration redundant#EulerPhi.svgCategory:GFDL#EulerPhi.svg
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International, 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0,3.0,2.5,2.0,1.0#EulerPhi.svg
You may select the license of your choice.
Category:Self-published work Category:Totient function Category:Images with Python source code Category:Order 1000
Category:CC-BY-SA-4.0,3.0,2.5,2.0,1.0 Category:GFDL Category:Images with Python source code Category:License migration redundant Category:Order 1000 Category:Self-published work Category:Totient function Category:Unspec SVG created with Matplotlib