File:EulerPhi.svg

From testwiki
Jump to navigation Jump to search

Original file(SVG file, nominally 731 × 551 pixels, file size: 232 KB)

This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

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.
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.
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.
You may select the license of your choice.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

24 May 2009

image/svg+xml

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current17:07, 17 May 2012Thumbnail for version as of 17:07, 17 May 2012731 × 551 (232 KB)wikimediacommons>ItzuvitReverted to version as of 09:29, 16 March 2010

The following page uses this file: