File:Totientplot,to3500.png

From specialfunctionswiki
Jump to: navigation, search
Original file(899 × 885 pixels, file size: 80 KB, MIME type: image/png)
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import fractions
from mpmath import *
from pylab import rcParams
rcParams['figure.figsize'] = 10, 10

def totient(n):
        amount = 0

        for k in range(1, n + 1):
                if fractions.gcd(n, k) == 1:
                        amount += 1

        return amount

x=np.arange(0,3500,1);
f=np.vectorize(totient)
y=f(x)

fig, ax = plt.subplots()

plt.xlabel(r'$n$')
plt.ylabel(r'$\phi(n)$')

plt.scatter(x,y,linewidth=0.01,color='Black')
plt.xlim(0,3500)
plt.ylim(0,3500)
plt.savefig('totientplot,to3500.png',bbox_inches='tight',pad_inches=0.15)

File history

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

Date/TimeThumbnailDimensionsUserComment
current04:15, 22 June 2016Thumbnail for version as of 04:15, 22 June 2016899 × 885 (80 KB)Tom (talk | contribs)Category:Plot <pre>#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt import fractions from mpmath import * from pylab import rcParams rcParams['figure.figsize'] = 10, 10 def totient(n): amount = 0 for k in range...
  • You cannot overwrite this file.

The following 3 pages link to this file:

Metadata