File:Graphe des nombres polydivisibles.svg
Summary
{{Information
|description=
Français : En mathématiques, un nombre polydivisible est un entier naturel s'écrivant avec les chiffres a b c d e ..., qui possède les propriétés suivantes :
- Son premier chiffre a n'est pas 0.
- Le nombre formé par ses deux premiers chiffres a b est un multiple de 2.
- Le nombre formé par ses trois premiers chiffres a b c est un multiple de 3.
- Le nombre formé par ses quatre premiers chiffres a b c d est un multiple de 4.
|date=2013-05-01 21:31:55 |source=Own work |author=Guillaume Jacquenot |other fields={{Igen|Matplotlib|1|+|code=
- -*- coding: utf-8 -*-
- Script to generate in English and French, graphs for the
- birthday problem.
- **************************************************************
- http://en.wikipedia.org/wiki/Polydivisible_number
- From Wikipedia, the free encyclopedia:
- In mathematics a polydivisible number is a number with digits
- abcde... that has the following properties :
- Its first digit a is not 0.
- The number formed by its first two digits ab is a multiple of 2.
- The number formed by its first three digits abc is a multiple of 3.
- The number formed by its first four digits abcd is a multiple of 4.
- etc.
- Text under the
- Creative Commons Attribution-ShareAlike License
- **************************************************************
- Guillaume Jacquenot
- 2013/05/01
from pylab import * import numpy as np
def getData():
r=np.array(
[[ 1, 9, 9],
[ 2, 45, 45],
[ 3, 150, 150],
[ 4, 375, 375],
[ 5, 750, 750],
[ 6, 1200, 1250],
[ 7, 1713, 1786],
[ 8, 2227, 2232],
[ 9, 2492, 2480],
[10, 2492, 2480],
[11, 2225, 2255],
[12, 2041, 1879],
[13, 1575, 1445],
[14, 1132, 1032],
[15, 770, 688],
[16, 571, 430],
[17, 335, 253],
[18, 180, 141],
[19, 90, 74],
[20, 44, 37],
[21, 18, 17],
[22, 12, 8],
[23, 6, 3],
[24, 3, 1],
[25, 1, 1]])
return r
def makePlot(\
generateEnglishPlot = True,\
outputFilename = 'Graph_of_polydivisible_number.svg'):
if generateEnglishPlot:
xlabel_ = 'n Number of digits'
ylabel_ = 'Number of polydivisible numbers'
leg1 = 'F(n)'
leg2 = 'Estimate of F(n)'
else:
xlabel_ = 'n Nombre de digits'
ylabel_ = 'Nombre de nombres polydivisibles'
leg1 = 'F(n)'
leg2 = 'Estimée de F(n)'
r=getData()
plot(r[:,0], r[:,1], marker = 'o', label = unicode(leg1, 'utf8'))
plot(r[:,0], r[:,2], marker = '^', label = unicode(leg2, 'utf8'))
grid(True, ls='-', c='#a0a0a0')
legend(loc='right')
xlabel(xlabel_)
ylabel(ylabel_)
savefig(outputFilename)
show()
makePlot(generateEnglishPlot = True, outputFilename = 'Graph_of_polydivisible_number.svg') makePlot(generateEnglishPlot = False, outputFilename = 'Graphe_des_nombres_polydivisibles.svg') }} }}
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported 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.