1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
|
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
# Série communs. En Général Python
# Version : Tierse facture
import time
import copy
"""MusicAToumic En"""
# Programme Nphonic_9cosica : 3 juin 2017
# Programme nphysic_0a : 3 juin 2017
# Programme nphysic_2a : 28 juin 2017
"""Découvrir les multiples d'un NOMBRE
1- Tableau(imem) des :ip;dv: de type (1, 5)
2- Copie (imem) sur tableau(itab)
3- Boucle (imem) sur (itab)
4- :ion1::ion2: Motif de progression
5- Modélisation :ip:
6- :print: Points d'analyses
Typogramme nucloïde
P = Points d'itérations 'u15171w-14925...'
NP = Nombre Pemier: Signe '°'
NpP = Nombre préalable Premier: Types '1&5'
NpPip = Tableau :imem[ip(NpP)]: Résultat "ip"
NpPdv = Tableau :imem[dv(NpP)]: Résultat "ip"
NC = Nombre Commun :itab[NC]: Résultat "ip"
Les premiers tempéraments préalables NpP
Les démultiplications NpP produisent NC
Mes premiers pas sur sur cette échelle
"""
# Fonction :imemap: Nombres Premiers (NP)
"""
uo5(v): 60432 u25(w,x): 245 iut(y,z): 30093
P0: u1w245 x245z30093 y30093v60432
0 imem0 [1, 2, 19]
Partime 1 En 0.06004047393798828
ion1 14
1° * 3652123456 typ 1*4
2° * 1826061728 typ 2*2
4 * 913030864 typ 4*4
8 * 456515432 typ 2*2
16 * 228257716 typ 4*4
19° * 192217024 typ 1*4
32 * 114128858 typ 2*2
38 * 96108512 typ 2*2
64 * 57064429 typ 4*1
76 * 48054256 typ 4*4
152 * 24027128 typ 2*2
"""
# Carré² w = x = 245
"""
304 * 12013564 typ 4*4
608 * 6006782 typ 2*2
1216 * 3003391° typ 4*1
"""
# Centre y = z = 30093
# Carré v = 60432
"""
Partime 2 En 0.045113325119018555
Cosmic 3652123456 typ 4 long 14
nphysic_1.py En 0.1216895580291748
"""
dod0 = d_d1 = time.time()
def onuno(uno):
u1 = 0
if uno == 0: #:uno=0: Zéro issue
uno = 1
u1 = 1
uo5 = int(uno**.5)
uo6 = uno % 6
u25 = int(uno**.25)
iut = ((uo5 - u25)//2)
print('uo5(v):', uo5,'u25(w,x):', u25, 'iut(y,z):', iut)
imem = []
uzem = [0]
v = uo5 #:uo5: Racine(uno)
w = x = u25 #:u25: Racine(uo5)
if iut > u25:
u = 1
else:
u = 2
y = z = iut
v_ = w_ = z_ = 0
# print('P0: u%sw%s x%sz%s y%sv%s'%(u,w,x,z,y,v))
if u1 == 0: #Zéro issue
# print('P1: u%sw%s x%sz%s y%sv%s'%(u,w,x,z,y,v))
def imemap(uz):
""" Les nombres premiers
Des préalables premiers"""
if not uno%uz and uz%6 in (1, 3, 5) \
and uz < 8:
imem.append(uz)
i5 = sq5 = int(uz**.5)
i2 = sq2 = int(uz**.25)
i0 = (i5 - i2) // 2
for i in range(i5, i0, -1):
if not uz%i \
and i%6 in (1, 5):
break
else:
for i in range(i2, i0):
if not uz%i \
and i%6 in (1, 5):
break
else:
for i in range(i2, 0, -1):
if not uz%i \
and i%6 in (1, 5):
if i > 1:
break
elif uz%6 in (1, 5):
imem.append(uz)
while 1:
if not uno%u and u%6 in (1, 2, 3) \
and u < 6 and u not in imem:
imem.append(u)
if v > y - 1 and v_ == 0:
if not uno%v and v not in imem:
if v%6 in (1, 5):
imemap(v)
elif v == uo5:
imemap(v)
if y%6 in (1, 5) \
and not uno%y \
and y not in imem: #y = iut(+1)
imemap(y)
if uo6 in (1, 5) and iut != 0:
if (uno//v) % 6 in (1, 5) \
and v not in imem \
and not uno%(uno//v):
imemap(v)
if (uno//y) % 6 in (1, 5) \
and y not in imem \
and not uno%(uno//y):
imemap(y)
else:
v_ = 1
if w > u - 1 and w_ == 0:
if not uno%w \
and w%6 in (1, 5) \
and w not in imem: #w = u25(-1)
imemap(w)
if not uno%u and u%6 in (1, 5) \
and u not in imem \
and u > 1: #u = u(+1)
imemap(u)
if uo6 in (1, 5) and iut != 0:
if (uno//w) % 6 in (1, 5) \
and w not in imem \
and not uno%(uno//w):
imemap(w)
if (uno//u) % 6 in (1, 5) \
and u not in imem \
and not uno%(uno//u):
imemap(u)
else:
w_ = 1
if z > x - 1 and z_ == 0:
if not uno%z \
and z%6 in (1, 5) \
and z not in imem: #z = iut(-1)
imemap(z)
if not uno%x and x%6 in (1, 5) \
and x not in imem: #x = u25(+1)
imemap(x)
if uo6 in (1, 5) and iut != 0:
if (uno//z) % 6 in (1, 5) \
and z not in imem \
and not uno%(uno//z):
imemap(z)
if (uno//x) % 6 in (1, 5) \
and x not in imem \
and not uno%(uno//x):
imemap(x)
else:
z_ = 1
# Blanc
if v_ == 0:
v -= 1
y += 1
if w_ == 0:
w -= 1
u += 1
if z_ == 0:
z -= 1
x += 1
vwz = v_+ w_ + z_
if vwz > 2:
break
# print('P2: u%sw%s x%sz%s y%sv%s'%(u,w,x,z,y,v))
imem.sort()
itab = copy.copy(imem)
print('Nombres Premiers :ip:', imem)
# d_d2 = time.time()
ion1 = ion2 = 0
if u1 == 0: #Zéro issue
while 1:
ion1 = len(itab)
for i in imem:
for y in itab:
i1 = y*i
if i1 not in itab \
and not uno % i1:
itab.append(i1)
itab.sort()
ion2 = len(itab)
if ion1 == ion2:
break
# print('Partime 2 En {}'.format(time.time() - d_d2))
# d_d3 = time.time()
d = u = n = m = 0
for i in itab:
d = uno // i
ip, dv = i, d
if ip < dv or ip == dv: # Déblocage :uno = 2 ou 4:
print('%s * %s typ %s*%s' \
% (ip, dv, ip % 6, dv % 6))
#print('Partime 3 En {}'.format(time.time() - d_d3))
else:
# Zéro issue :uno;onu:
print('%s * %s typ %s*%s' % \
(uno, onu, uno % 6, onu % 6))
uno = 0
# print('Partime 2 En {}'.format(time.time() - d_d2))
print('Cosmic', uno, 'typ', uo6, 'long', len(itab))
print('nphysic_2a.py En {}'.format(time.time() - dod0))
# Nombre original :onu:
onu = 21
onuno(onu)
#nombre(onu): Charge zéro
#nombre(uno): Charge unité |
Partager