Group Abstract Group Abstract

Message Boards Message Boards

3
|
11K Views
|
7 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Prime Chunk Decomposition

Posted 11 years ago

Irrational and transcendental real numbers do not have a decomposition into prime factors. But one can give them a split into prime chunks.

Clear[primeStop]
primeStop[x_, n_: 1] := Block[{l = If[IntegerQ[x],
      IntegerDigits[x], First[RealDigits[N[x, n]]]], o, r = {}},
    While[Length[l] > 0,
     {o, l} = {{First[l]}, Rest[l]};
     While[Length[l] > 0 && ! PrimeQ[FromDigits[o]],
      {o, l} = {Join[o, {First[l]}], Rest[l]}
     ];
     r = Join[r, {o}]
    ];
    If[PrimeQ[Last[#]], #, Most[#]] &[FromDigits /@ r]
   ] /; x \[Element] Reals && n >= 1

with that one can look at $\pi$

In[98]:= primeStop[\[Pi], 3100 - 18]
Out[98]= {3, 14159, 2, 653, 5, 89, 7, 9323, \
8462643383279502884197169399375105820974944592307816406286208998628034\
8253421170679821480865132823066470938446095505822317253594081284811174\
5028410270193852110555964462294895493038196442881097566593344612847564\
8233786783165271201909145648566923460348610454326648213393607260249141\
2737245870066063155881748815209209628292540917153643678925903600113305\
3054882046652138414695194151160943305727036575959195309218611738193261\
1793105118548074462379962749567351885752724891227938183011949129833673\
3624406566430860213949463952247371907021798609437027705392171762931767\
5238467481846766940513200056812714526356082778577134275778960917363717\
8721468440901224953430146549585371050792279689258923542019956112129021\
9608640344181598136297747713099605187072113499999983729780499510597317\
3281609631859502445945534690830264252230825334468503526193118817101000\
3137838752886587533208381420617177669147303598253490428755468731159562\
8638823537875937519577818577805321712268066130019278766111959092164201\
9893809525720106548586327886593615338182796823030195203530185296899577\
3622599413891249721775283479131515574857242454150695950829533116861727\
8558890750983817546374649393192550604009277016711390098488240128583616\
0356370766010471018194295559619894676783744944825537977472684710404753\
4646208046684259069491293313677028989152104752162056966024058038150193\
5112533824300355876402474964732639141992726042699227967823547816360093\
4172164121992458631503028618297455570674983850549458858692699569092721\
0797509302955321165344987202755960236480665499119881834797753566369807\
4265425278625518184175746728909777727938000816470600161452491921732172\
1477235014144197356854816136115735255213347574184946843852332390739414\
3334547762416862518983569485562099219222184272550254256887671790494601\
6534668049886272327917860857843838279679766814541009538837863609506800\
6422512520511739298489608412848862694560424196528502221066118630674427\
8622039194945047123713786960956364371917287467764657573962413890865832\
6459958133904780275900994657640789512694683983525957098258226205224894\
0772671947826848260147699090264013639443745530506820349625245174939965\
1431429809190659250937221696461515709858387410597885959772975498930161\
7539284681382686838689427741559918559252459539594310499725246808459872\
7364469584865383673622262609912460805124388439045124413654976278079771\
5691435997700129616089441694868555848406353422072225828488648158456028\
5060168427394522674676788952521385225499546667278239864565961163548862\
3057745649803559363456817432411251507606947945109659609402522887971089\
3145669136867228748940560101503308617928680920874760917824938589009714\
9096759852613655497818931297848216829989487226588048575640142704775551\
3237964145152374623436454285844479526586782105114135473573952311342716\
6102135969536231442952484937187110145765403590279934403742007310578539\
0621983874478084784896833214457138687519435064302184531910484810053706\
1468067491927819119793995206141966342875444064374512371819217999839101\
5919561814675142691239748940907186494231961567945208095146550225231603\
88193014209376213785595663893778708303906979207, 7, 3, 467, 2, 2}

interesting how long a prime number appears between shorter ones in $\pi$. With the $e$ it looks as

In[99]:= primeStop[E, 2630 - 6]
    Out[99]= {2, 7, \
    1828182845904523536028747135266249775724709369995957496696762772407663\
    0353547594571382178525166427427466391932003059921817413596629043572900\
    3342952605956307381323286279434907632338298807531952510190115738341879\
    3070215408914993488416750924476146066808226480016847741185374234544243\
    7107539077744992069551702761838606261331384583000752044933826560297606\
    7371132007093287091274437470472306969772093101416928368190255151086574\
    6377211125238978442505695369677078544996996794686445490598793163688923\
    0098793127736178215424999229576351482208269895193668033182528869398496\
    4651058209392398294887933203625094431173012381970684161403970198376793\
    2068328237646480429, 5, 3, 11, 80232878250981945581530175671, 7, 3, \
    61, 3, 3, 2, 6981125099618188159304169035159888851934580727386673, \
    8589422879228499892086805825749279610484198444363463244968487560233624\
    8270419786232090021609902353043699418491463140934317381436405462531520\
    9618369088870701676839642437814059271456354906130310720851038375051011\
    5747704171898610687396965521267154688957035035402123407849819334321068\
    1701210056278802351930332247450158539047304199577770935036604169973297\
    2508868769664035557071622684471625607988265178713419512466520103059212\
    3667719432527867539855894489697096409754591856956380236370162112047742\
    7228364896134225164450781824423529486363721417402388934412479635743702\
    6375529444833799801612549227850925778256209262264832627793338656648162\
    7725164019105900491644998289315056604725802778631864155195653244258698\
    2946959308019152987211725563475463964479101459040905862984967912874068\
    7050489585867174798546677575732056812884592054133405392200011378630094\
    5560688166740016984205580403363795376452030402432256613527836951177883\
    8638744396625322498506549958862342818997077332761717839280349465014345\
    5889707194258639877275471096295374152111513683506275260232648472870392\
    0764310059584116612054529703023647254929666938115137322753645098889031\
    3602057248176585118063036442812314965507047510254465011727211555194866\
    8508003685322818315219600373562527944951582841882947876108526398139559\
    9006737648292244375287184624578036192981971399147564488262603903381441\
    8232625150974827987779964373089970388867782271383605772978824125611907\
    1766394650706330452795466185509666618566470971134447401607046262156807\
    1748187784437143698821855967095910259686200235371858874856965220005031\
    1734392073211390803293634479727355955277349071783793421637012050054513\
    2638354400018632399149070547977805669785335804896690629511943247309958\
    7655236812859041383241160722602998330535370876138939639177957454016137\
    2236187893652605381558415871869255386061647798340254351284396129460352\
    9133259427949043372990857315802909586313826832914771, 163, 96337}

for the Euler constant primeStop[E,10500] was not able the get the next prime number, i.e. the next prime number appearing has at least

In[146]:= 10500 - 2630 + 6
Out[146]= 7876

digits. Should one expect that the prime number chain primeStop produces out of a transcendental number is never-ending?

One can also decompose the prime numbers themselfes into prime chunk decompositions: Between the first 10000 prime numbers are 6132 which contain non-prime chunks:

In[88]:= Select[Prime /@ Range[10000], FromDigits[primeStop[#]] != # &] // Length
Out[88]= 6132

There are 3170 primes under the first 10000 ones which are also chunk-prime:

In[89]:= Select[Prime /@ Range[10000], (First[primeStop[#]] == # &&  Length[primeStop[#]] == 1) &] // Length
Out[89]= 3170 

Last but not least there are 698 primes under the first 10000 ones which are chunk-composed of primes:

In[90]:= Select[Prime /@ Range[10000], (FromDigits[primeStop[#]] == # && Length[primeStop[#]] > 1) &] // Length
Out[90]= 698
POSTED BY: Udo Krause
7 Replies

but what is the measure of such numbers?

Udo, does your code answer that question?

Even if primeChunkFree[n] would produce for a given $0 < n < \infty$ after $\alpha 10^n$ calls all prime chunk free numbers, where $\alpha$ is a positive finite real constant, one still needs a topology to measure them in the $n$-digit integers.The point-topology (counting) will do it for a fixed $n$: one has to estimate $\alpha$ as $\alpha(n)$. In the case of an infinite $n$ and prime chunk free numbers $\xi$ between 0 and 1 it is not clear to me whether some, all, or none of them are transcendental much less how to measure them in the reals.

POSTED BY: Udo Krause

Here is a simple example of a transcendental number that has no prime chunks (using a Liouville number)

4/9+Sum[2/(10^(n!)),{n,1, Infinity}] \[TildeEqual] .664446444444444444444446444444444444444444444444

but what is the measure of such numbers?

Udo, does your code answer that question?

The prime number theorem suggests that the chances improve when adding a digit to a number that one of those 10 numbers will be prime (maybe by a factor of 2), so it becomes unlikely for a random sequence of digits to not become prime, but on the other hand the integer lengths of these numbers can be large.

RandomChunkPrime[init_] := Module[{n = init}, While[Not[PrimeQ[n]], n = 10 n + RandomInteger[{0, 9}]]; n]

50 random chunked primes

POSTED BY: Todd Rowland
POSTED BY: Udo Krause
POSTED BY: Udo Krause

I am not sure what this question means.

"Should one expect that the prime number chain primeStop produces out of a transcendental number is never-ending?"

If you are asking whether there will be infinitely many primes, the answer is yes. Do there have to be infinitely many distinct primes? Probably, but I don't have a proof offhand.

POSTED BY: Daniel Lichtblau
Posted 11 years ago

Interesting, could your code be altered to find say blocks that were perfect squares?

POSTED BY: Paul Cleary

Change the test

Clear[squareStop]
squareStop[x_, n_: 1] := Block[{l = If[IntegerQ[x],
      IntegerDigits[x], First[RealDigits[N[x, n]]]], o, r = {}},
   While[Length[l] > 0,
    {o, l} = {{First[l]}, Rest[l]};
    While[Length[l] > 0 && ! SameQ[Head[Sqrt[FromDigits[o]]], Integer],
     {o, l} = {Join[o, {First[l]}], Rest[l]};
    ];
    r = Join[r, {o}]
   ];
   If[SameQ[Head[Sqrt[Last[#]]], Integer], #, Most[#]] &[FromDigits /@ r]
  ] /; x \[Element] Reals && n >= 1

Under this test 0 and 1 are perfect squares. But there are far to few square numbers

In[40]:= squareStop[FromDigits[Flatten[IntegerDigits /@ (Range[2, 100]^2)]]]
Out[40]= {4, 9, 1, 625, 36, 4, 9, 64, 81, 1, 0, 0, 1}

In[43]:= squareStop[FromDigits[Flatten[IntegerDigits /@ (Range[1, 100]^2)]]]
Out[43]= {1, 4, 9, 1, 625, 36, 4, 9, 64, 81, 1, 0, 0, 1}

In[46]:= FromDigits[Flatten[IntegerDigits /@ (Range[1, 100]^2)]]
Out[46]= 1491625364964811001211441691962252562893243614004414845295766\
2567672978484190096110241089115612251296136914441521160016811764184919\
3620252116220923042401250026012704280929163025313632493364348136003721\
3844396940964225435644894624476149005041518453295476562557765929608462\
4164006561672468897056722573967569774479218100828184648649883690259216\
94099604980110000

to generate long decompositions. No consecutive, from the left starting range of digits of

2114416919622525628932436140044148452957662567672978484190096110241089\
1156122512961369144415211600168117641849193620252116220923042401250026\
0127042809291630253136324933643481360037213844396940964225435644894624\
4761490050415184532954765625577659296084624164006561672468897056722573\
96756977447921810082818464864988369025921694099604980110000

is a square anymore. Square numbers are too seldom for chunk decompositions.

In[44]:= squareStop[E, 2630 - 6]
Out[44]={}

In[45]:= squareStop[\[Pi], 3100 - 18]
Out[45]= {}
POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard