It's very difficult to balance all of my hobbies but I struggle, in order to progress on each of them.
I play classic guitar and I have just started to play piano.
Tai chi is wonderfull, you can apply tai chi every where.
This is what I've done in python.
def isprime(n):
for i in range(2,n//2+1):
if n%i==0:
return False break else:
return True break
def fibo(n):
a, b=0, 1 numbers=[]
while b<n:
numbers.append(b)
a, b=b, a+b
return numbers
def countprimes(n):
primenumbers=0
numbers=fibo(n)
statistics=[]
for i in range(0,len(numbers)):
if isprime(numbers[i]):
primenumbers+=1 print('numarul prim este:')
print(numbers[i])
print('procentajul de numere prime este:')
print(primenumbers/i)
countprimes(10**10000)
This is the source code, what I've done is to check how many numbers from the fibonacci series are primes. the idea is that we have
66.66% out of numbers from fiboancci 10 power 10000, 66,66 percent are primes numbers.
Wonderfull,
take a look at the result
this is the biggest number I've found:
8281110877975796084663206050048900868078618086311556970620161381215528762338279430657029158426361878223580595948711541852497652203922565310237777169311572815968497405066113161059274988189994527309602632039416610617901791400917697076207767652505390263554478499014807841931760446277850183680953404015223777101654776726239306085082316884445956572105032571153862727495413954606578712677136856503108628587873694037874272681278841098985207465501413465592281462024720041698024243118463222729264881481929838766402373613598662849353476119851877600620486439228962906831802765051728993850281834194446982835208069521429521668720594178485456146887368338089442560135736600603252683152514352407585363722425299118267562969059573615491757196140964799306004817975422749966494740623841158911315915794831583097255250886331375750649747560032562901534354574570523167848187085993169901232280076841424085275758011855408518125195428710774090215377089385208211082875593382998029225818323707884638290188225518223722195022330887197513326894467516660709366783290887839334651076168333957539076697327735194373420502940041577675976941493776837402161743573866235739445497744452551685774104782725788919856427569001643913600321315713136752286332876041137514182348601121106643804330026956835933264847380599195851007521402960997824205692650430396536020857838268380815771543416465309823849319650571776458370884776370749420432264030450866999162555060396923373773901862018455438154878329698146230335437072771570976190178706965549221506879528559603604714567125880475308805988453285112825818113264197614605164174621220380961407529659081922010421993396397451962880924444697179653767275064137257083503725969000542443249448346560993276777144957511331390999282928804713038080832596671448377614190374563391362906849717906188620438078793632127671372020871567099826464924367380327824025537916202086042126238834368947951056513622788847934886672317737955920509206065893765159126204140897831381210044267266428488491803730897563023226882474511930927979420838451666104433745429434604664162018213748700753943022771224452790478126128378683760124839642267930396585068397951295551584747584815157262182164771511448936033513114767183502377496281037273894381115891967239293599140029389727849800580241705285202123441473068689077478638423066917199668164152311978409461870211962345503444764533684331439773386653192022307707121754824472218919093562434390671543219492869266361201685463286472445532299042045503283932289100746666002455257830940540794156030547185998215560222620389357902333329628166829943977636735384744385802101815909595826433091773160844646264252384850722670571789303457645025501396813688791627918626767914222458838036628283114862439042834405273842654769571627172612637099981894484626750200920839244630495598615536188590258067160968871430027393366507845748727284089212502981158505114920034614738939426039704204514221975111822946387254140446015140699690096637895846433320117275415490105359880948132798457814612086439549121095535137110261422769170274058709561626196294248522756861887519967928643455748044076737902998373809367958045318973661308569449687300380453080052305584948845393110473396314320933047458926209010661843868539307487795906058372985785999109919127196723125146961461264454923768513714563715092599625693843438888291350707069976508474320706941865865915404748888887789446930847101251827863369812972211652160270058600567333350413806459083305702568723762690658245345079117977251910424311538344109069845366624213654544507209624427643157914128582575869143068802508924841612273376203819353841074212582727077071859384235420674361284845816154376504077874972971705475956959318411757365341377323446044315825629908670882215733649289858285039364048098022729939360271177055022828180308286622827018777082554422144081851253282495354885541768603969565059057074980964890543022155000240679153452975025994183000538056433761677986950789231130137408747868838475116286224230882936405244488060021801625343843871648667555983664711181165797161275923728030738332379241251176509774846966013373528866951583526669474599991167945739412018590830209000528247535274528586447220309508416857128793016647413171621163765872965393808285895831295253206179998550909428061159741066580170054918801837334254879953610556479661269236989213611128978096558006487058976033440992333863390507715798735332612898460967564899542174252043242087438080555261911850973456480694291430766565582865297576382555076352683230231207875194532111953476214718010196550896213678614822746567730356097752290363956053710183830955301904048810774370463118769345547092609178552155113520618342297518128976893744463622166862094532297518852625821884341084367879623566955163255945702280008506995606637323648005966891346534831337671176181952009253087681145242471336270281433650110463827899238434827323248370416755831409582829668752110131474528485240463147382903927859845929503747826488407543222831311624017022499722153798252982414679000922080454234728328879072030889118049242447111951138390910686370542657502126985366730481872482941551555082979497037394326176173313721319509870237924574553190997641455718012025831409216958937173107122244564027020760816389910521171721431003505324596870909055622975248919080234800651001203435836619488931019283140464339945314848970482062591594310635951266640965798711881558055758236725803954412520847452483375060237002297465360970465473420174117349141409414470587412972389956823121702630235667849901424640274479678891549965748413004218664918928735460552388041283135230906730653423836050967305919632783161563032763363055097273782478645373067886423137347909450806708615252207186355532220052530217706704841978617743483326135424100849488995107222338096155347893318458158126826581057574925459902930172096155399657257808206160849386610823368841139692648387792936049957574331349329776939765788262326437291238108357176022816845066205717626769221127678201918228764921605743095657356355595518506744306807301503737467967352121376759658293231229330609168942353656508952292019536209983726877737812091895531051368842911447944522951023524183079391668393725207432018697966852020777799268125769185874993960399336385730788050075587188365369420798923529418275111329127314494038156633491377828333839191358787893332465604234752009094042205929087794486627423968940934343310633905856832047887990848331335368601190768771043730609402484403533513908484613603102875982213166453802278243410056405125046788340171466013687121477765260657649500956853682245307942814110331021697964273696387585428477002504795851500186331252729891539581966060975940625049920462300780893639634361798399024183763967384404822865528518113789966173053199991555602154504558465068929427309105145296163694352128554275678790383028119087547397978475141779599276644408358576054556558039484159644555995605117121882705230399497865198304523062350797743974086689483778535466170669614370853288577717268583705048258318330111327311543077896362580321700494070646972974935137182773374468171275874818005329586764115350226787866215975420011114133867424706314261665127159437067467595424650391425530228567862723566046075556920992349080667290433655407929218837467421176945270848407311971151008687946861980581927965612976660460150408361767703071251968205336016324504745398026085378181231608372655815394383899716248579665057950541068618020991398765067152570841554645137343510879054632490427319672728137544971985605787499245716080236990683874389326059991774950127538761670037665332457870679014504574404377433970637017292729009764876145834375379169560109824604052249870978580850547822544196032020359594686140850724803153440541473029268838654203918799733031157472350374458608728048456575316152414759037280897417918247240198208031584341141229525835219171837904221108763803421712818466559074167514634838652101786919058467661917020993862977839832328702518608326136389780523589124571114833039903319746714371866704443784787498319064519140043452078434301461049505329702200398150442313549191413090052256137139555232465663975945574894469522591961975560058398753368135771119023363938023402729252946544975484511210292132921832812619920715783933584710139834646954982549451378027894560626299917087990535364397489131236802263033123201615540844307782564119052124224800088036744191021725189431562475690877853155448315231891643005926472664613942527892578941743266899026295078999454254158428630405215212741682391143311549305335558959092279364679830302624850507067048251257312306289141005943749273889736212162280416095921689700004914761100887686299305397266427496763977513918847133003278151559594959874378913220754342033521109203163823798531096586008628433386679553941038091777971456863027887401715156090718463110440211258978192338387074644490205345544075680264068268627200277073063514206527583289226983309845013630209550763712288877169801084020013284650687222439029234271460330337013208511177330688331196235608040462502057840454620491367020260527704031334293559420768780181473617868947579898806056065517452580447587016493643181813112429564843871624854925561512591911475730283363391292820020565309003333293568934874337569232436513759599163703758478284339280106519634266728151893912364802688372655247282019491705745887780802302477056998428217309734350450933306828135016912574321934773732621656645577959763929023798694195218395630412509207670919159151512297152429712977344700528229821728846313918513552580982604537550779738157697829903362753582268863153759887009728278180475506951808447877603558843403885379961672936687010284606753158556510710427818429355824325417949807045146226093301496702667213025601432456980589934153857398247766029255794811001072543313699766398560101364331357852201170713188955295389800847867393983999337755272005875424409219999231521216584012527376792712863881022046170520435106958858636034710195331384715263876527176267383464399589129652374374755739202743631594123905184512092640760769247302735206730405864283133685858790632294877028341863216923688211324030868428916944380756121513581765392936770653087572669692141232606756578701585878632153373609629422679258149
procentajul de numere prime este:
0.6666248693834901
Process finished with exit code 0
No comments:
Post a Comment