English
Source / code snippets

The n. Permutation in the Lucas-Lehmer-code present

 

p.specht

Dezimalzahlen are so aufgebaut, that left new dazukommende to put each around the factor 10 More worth are as The previous place right of it.

Lucas-Lehmer-numbers are so aufgebaut, that the Base not fix 10 is, separate itself with the Stellenzahl changes. The Stellenwert is means not 10^(Stellenzahl-1) is, separate "Produkt all numbers of 1 To (Stellenzahl-1)".

such "Zahlen" having The particular quality, that tappt im dunkeln lexikalische Permutationen of Elementen "ein-eindeutig" mark. one can means z.B. The 12.354ste Umordnung (Permutation) the items A B C D E F G H I directly so produce, and must not of 0 To there any Umordnungen the row to detect, around the to get. too The umgekehrte Fragestellung ("Die wievielte Permutation is this pretended pattern really?") can itself so leichter clarify. virtually Applications find The Lucas-Lehmer-Codes z.B. at creak of RSA-Cryptosystemen.

here one kurzes Program, the The (dezimal) n.th Umordnung into Lucas-Lehmer-code GetControlParas (B:
Window Title "Permutationen in the eindeutigen Lucas-Lehmer code darstellen"
CLS
AppendMenuBar 10, "Summe aufeinanderfolgenden faculties time their index is Nächste_Fakultät-1"
' "https://de.wikipedia.org/wiki/Fakult%C3%A4tsbasiertes_Zahlensystem"
var xf!=0.797:var xr%=(%WinRight- %WinLeft-width(%Hwnd))+1
var yf!=0.72 :var yr%=(%WinBottom-%WinTop-height(%Hwnd))+1
var u%= 640*1.5 : var v%= 480*1.5
Window (u%-xr%)*xf!+xr%, (v%-yr%)*yf!+yr%
SetWindowPos %HWnd=(%maxx-u%)/2,((%maxy-v%)/2) - u%,v%
Declare s$,s!,n!,m!,m&,mmax&,prod!,lprod!,w&[200]
set("decimals",0)
Font 2:randomize
nomoi:
CLS rnd(8^8)
Print " Zugrundeliegende question: which product all Integerzahlen of n To 1 "
Print " yields one bestimmtes Result 'Fakultät of n' = \n ";
Input s$
s!=val(s$)
Print "\n (remainder)-Laufprodukt:"
ausloten:
prod!=1

WhileLoop 2147483647

    n!=&Loop
    lprod!=prod!
    Prod!=Prod!*n!
    case Prod!>S!:break

EndWhile

'print " Drüber:  product 1 .. "; n!;" with product ";tab(40);Prod!
'print " Drunter: product 1 .. "; n!-1; " with product ";tab(40);LProd!
m!=n!-1
m&=m!
case mmax&<m&:mmax&=m&
'print m!,
w&[m&]=w&[m&]+1
S!=s!-LProd!
case s!>0: goto "ausloten"
print
print
'print " = ";mmax&;":";

WhileLoop mmax&,0,-1

    if W&[&Loop]>9:print "'";

        if W&[&Loop]>99:print "'";

            if W&[&Loop]>999:print "'";

            endif

        endif

    endif

    print W&[&Loop];
    'case (&Loop>1):print ",";

EndWhile

WaitInput
clear w&[]
mmax&=0
goto "nomoi"

' example, around the n. Permuation objectively To detect:
'
' "4041000" = 4*6!+0*5!+4*4!+1*3!+0*2!+0*1!+0*0!
' Stellenwert = (len-pos)! = (7-1)! = 6!
' Permutation produce from Fakultätsbasierter number:
' Grundordnung: 0123456
factor Subtrakt remainder
' -4 01234564
' -0 0123560
' -4 12356 6
' -1 12352
' -0 1351
' -0 353
' -0 5 5

The 4.041.000 order is means: "4062135"
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
06/13/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.422 Views

Untitledvor 0 min.
Stringray01/05/22
p.specht11/18/21
Wilfried Friebe11/17/21
Jürgen Strahl11/17/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie