![]() |
News from da outaworlds |
mail files register groups login |
Message-ID: |
Subject | Author |
![]() | remy |
![]() ![]() | remy |
![]() ![]() | Nomen Nescio |
1 |
hello
take 2 prime numbers (p1)mod(p2) and change the two prime numbers
cdl remy
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
public class gene
{
static FileOutputStream file;
public static void main(String args[])
{
BigInteger p1,p2,tmpp1,tmpp2;
String p;
//initialisation if args[] is empy
Random rnd = new Random();
p1 = BigInteger.probablePrime(512, rnd);
p2 = BigInteger.probablePrime(128, rnd);
tmpp1=p1;
tmpp2=p2;
try {file=new FileOutputStream ("sortie08.bin");
} catch (FileNotFoundException e){System.out.println(e);}
while(true)
{
p=(p1.mod(p2)).toString(2);
write(p.substring(0,p.length()-3));
p1=newP(p1,p1.toString(2).length());
p2=newP(p2,p2.toString(2).length());
if(p1.toString(2).length()>1024)
{p1 =newP(tmpp1,tmpp1.toString(2).length()/2);tmpp1=p1;}
if(p2.toString(2).length()>256)
{p2 =newP(tmpp2,tmpp2.toString(2).length()/2);tmpp2=p2;}
}
}
public static void write(String p)
{
byte monByte;
String t;
int max=(int)p.length()/8-2;
for(int i=0;i<max;i++)
{
t=p.substring(p.length()-(i+1)*8,p.length()-i*8);
monByte = (byte)Integer.parseInt(t,2);
System.out.println(t+" "+monByte);
try {file.write(monByte);
} catch (IOException e){System.out.println(e);}
}
}
public static BigInteger newP(BigInteger p,int n )
{
BigInteger pow=new BigInteger("2");
pow=pow.pow(n);
p=p.add(pow);
int qtTest=0;
while(!p.isProbablePrime(100)){ p=p.add(pow);qtTest++;}
//System.out.println("qt de test pour generer un nombre
premier"+qtTest+" taille en base 2 "+p.toString(2).length());
return p;
}
}
--
http://remyaumeunier.chez-alice.fr/
toujours autant dyslexique
Le 22/12/2020 à 14:07, remy a écrit :
> hello
>
> take 2 prime numbers (p1)mod(p2) and change the two prime numbers
>
> cdl remy
>
>
> import java.util.*;
> import java.lang.*;
> import java.math.*;
> import java.io.*;
>
>
> public class gene
> {
> static FileOutputStream file;
> public static void main(String args[])
> {
>
> BigInteger p1,p2,tmpp1,tmpp2;
> String p;
>
> //initialisation if args[] is empy
> Random rnd = new Random();
> p1 = BigInteger.probablePrime(512, rnd);
> p2 = BigInteger.probablePrime(128, rnd);
> tmpp1=p1;
> tmpp2=p2;
>
>
> try {file=new FileOutputStream ("sortie08.bin");
> } catch (FileNotFoundException e){System.out.println(e);}
>
> while(true)
> {
> p=(p1.mod(p2)).toString(2);
> write(p.substring(0,p.length()-3));
> p1=newP(p1,p1.toString(2).length());
> p2=newP(p2,p2.toString(2).length());
> if(p1.toString(2).length()>1024)
> {p1 =newP(tmpp1,tmpp1.toString(2).length()/2);tmpp1=p1;}
> if(p2.toString(2).length()>256)
> {p2 =newP(tmpp2,tmpp2.toString(2).length()/2);tmpp2=p2;}
>
> }
> }
>
> public static void write(String p)
> {
> byte monByte;
> String t;
> int max=(int)p.length()/8-2;
> for(int i=0;i<max;i++)
> {
> t=p.substring(p.length()-(i+1)*8,p.length()-i*8);
> monByte = (byte)Integer.parseInt(t,2);
> System.out.println(t+" "+monByte);
> try {file.write(monByte);
> } catch (IOException e){System.out.println(e);}
> }
>
> }
>
> public static BigInteger newP(BigInteger p,int n )
> {
> BigInteger pow=new BigInteger("2");
> pow=pow.pow(n);
> p=p.add(pow);
> int qtTest=0;
> while(!p.isProbablePrime(100)){ p=p.add(pow);qtTest++;}
> //System.out.println("qt de test pour generer un nombre
> premier"+qtTest+" taille en base 2 "+p.toString(2).length());
> return p;
> }
> }
>
Hello
I saw the result of the tests on a file
cdl remy
Value Char Occurrences Fraction
0 47118 0.003871
1 47218 0.003879
2 47543 0.003906
3 47683 0.003917
4 47960 0.003940
5 47019 0.003863
6 47506 0.003903
7 47650 0.003915
8 47461 0.003899
9 47660 0.003915
10 47642 0.003914
11 47710 0.003920
12 47863 0.003932
13 47442 0.003898
14 47399 0.003894
15 47221 0.003879
16 47749 0.003923
17 47310 0.003887
18 47075 0.003867
19 47843 0.003931
20 47475 0.003900
21 47354 0.003890
22 47235 0.003881
23 47810 0.003928
24 47432 0.003897
25 47958 0.003940
26 47494 0.003902
27 47789 0.003926
28 47612 0.003912
29 47413 0.003895
30 47462 0.003899
31 47576 0.003909
32 47751 0.003923
33 ! 47552 0.003907
34 " 47592 0.003910
35 # 47480 0.003901
36 $ 47566 0.003908
37 % 47078 0.003868
38 & 47493 0.003902
39 ' 47134 0.003872
40 ( 47398 0.003894
41 ) 47587 0.003909
42 * 47291 0.003885
43 + 47726 0.003921
44 , 47506 0.003903
45 - 47745 0.003922
46 . 47653 0.003915
47 / 47929 0.003938
48 0 47628 0.003913
49 1 47426 0.003896
50 2 47755 0.003923
51 3 47790 0.003926
52 4 47603 0.003911
53 5 47698 0.003919
54 6 47184 0.003876
55 7 47217 0.003879
56 8 47605 0.003911
57 9 47396 0.003894
58 : 47378 0.003892
59 ; 47583 0.003909
60 < 47762 0.003924
61 = 47351 0.003890
62 > 47620 0.003912
63 ? 47428 0.003896
64 @ 47700 0.003919
65 A 47494 0.003902
66 B 47508 0.003903
67 C 47850 0.003931
68 D 47306 0.003886
69 E 47659 0.003915
70 F 47668 0.003916
71 G 47522 0.003904
72 H 47446 0.003898
73 I 47369 0.003892
74 J 47602 0.003911
75 K 47514 0.003903
76 L 47756 0.003923
77 M 47876 0.003933
78 N 47345 0.003890
79 O 47429 0.003896
80 P 47872 0.003933
81 Q 47807 0.003928
82 R 47513 0.003903
83 S 47524 0.003904
84 T 47348 0.003890
85 U 47921 0.003937
86 V 48021 0.003945
87 W 47595 0.003910
88 X 47936 0.003938
89 Y 47534 0.003905
90 Z 47845 0.003931
91 [ 46976 0.003859
92 \ 47364 0.003891
93 ] 47713 0.003920
94 ^ 47699 0.003919
95 _ 47700 0.003919
96 ` 47503 0.003903
97 a 47267 0.003883
98 b 47925 0.003937
99 c 47918 0.003937
100 d 47258 0.003882
101 e 47570 0.003908
102 f 47724 0.003921
103 g 47514 0.003903
104 h 47623 0.003912
105 i 47320 0.003888
106 j 47424 0.003896
107 k 47249 0.003882
108 l 47874 0.003933
109 m 47418 0.003896
110 n 47848 0.003931
111 o 47666 0.003916
112 p 47665 0.003916
113 q 47654 0.003915
114 r 47252 0.003882
115 s 47732 0.003921
116 t 47713 0.003920
117 u 47246 0.003881
118 v 47393 0.003894
119 w 47537 0.003905
120 x 47291 0.003885
121 y 47610 0.003911
122 z 47367 0.003891
123 { 47087 0.003868
124 | 47609 0.003911
125 } 48039 0.003947
126 ~ 47394 0.003894
127 47797 0.003927
128 47507 0.003903
129 47681 0.003917
130 47681 0.003917
131 47489 0.003901
132 48065 0.003949
133 47689 0.003918
134 47589 0.003910
135 47569 0.003908
136 47536 0.003905
137 47567 0.003908
138 47821 0.003929
139 47569 0.003908
140 47065 0.003867
141 47207 0.003878
142 47187 0.003877
143 47440 0.003897
144 47717 0.003920
145 47351 0.003890
146 47368 0.003891
147 47712 0.003920
148 47610 0.003911
149 47463 0.003899
150 47218 0.003879
151 47275 0.003884
152 47460 0.003899
153 47305 0.003886
154 47369 0.003892
155 47440 0.003897
156 47747 0.003923
157 47666 0.003916
158 47532 0.003905
159 47743 0.003922
160 47251 0.003882
161 ¡ 47285 0.003885
162 ¢ 47759 0.003924
163 £ 47687 0.003918
164 € 47644 0.003914
165 ¥ 47665 0.003916
166 Š 47572 0.003908
167 § 47665 0.003916
168 š 47523 0.003904
169 © 47775 0.003925
170 ª 47835 0.003930
171 « 47851 0.003931
172 ¬ 47605 0.003911
173 47217 0.003879
174 ® 47286 0.003885
175 ¯ 47558 0.003907
176 ° 47656 0.003915
177 ± 47761 0.003924
178 ² 47469 0.003900
179 ³ 47353 0.003890
180 Ž 47439 0.003897
181 µ 47993 0.003943
182 ¶ 47488 0.003901
183 · 47782 0.003925
184 ž 47933 0.003938
185 ¹ 47500 0.003902
186 º 47069 0.003867
187 » 47626 0.003913
188 Œ 47289 0.003885
189 œ 47394 0.003894
190 Ÿ 47393 0.003894
191 ¿ 47600 0.003911
192 À 47656 0.003915
ton programme java est-il autant dyslexique que toi ?
"remy" <remy@fctpas.fr> a �crit dans le message de news:
5fe1ef9a$0$3263$426a74cc@news.free.fr...
> hello
>
> take 2 prime numbers (p1)mod(p2) and change the two prime numbers
>
> cdl remy
>
>
> import java.util.*;
> import java.lang.*;
> import java.math.*;
> import java.io.*;
>
>
> public class gene
> {
> static FileOutputStream file;
> public static void main(String args[])
> {
>
> BigInteger p1,p2,tmpp1,tmpp2;
> String p;
>
> //initialisation if args[] is empy
> Random rnd = new Random();
> p1 = BigInteger.probablePrime(512, rnd);
> p2 = BigInteger.probablePrime(128, rnd);
> tmpp1=p1;
> tmpp2=p2;
>
>
> try {file=new FileOutputStream ("sortie08.bin");
> } catch (FileNotFoundException e){System.out.println(e);}
>
> while(true)
> {
> p=(p1.mod(p2)).toString(2);
> write(p.substring(0,p.length()-3));
> p1=newP(p1,p1.toString(2).length());
> p2=newP(p2,p2.toString(2).length());
> if(p1.toString(2).length()>1024)
> {p1 =newP(tmpp1,tmpp1.toString(2).length()/2);tmpp1=p1;}
> if(p2.toString(2).length()>256)
> {p2 =newP(tmpp2,tmpp2.toString(2).length()/2);tmpp2=p2;}
>
> }
> }
>
> public static void write(String p)
> {
> byte monByte;
> String t;
> int max=(int)p.length()/8-2;
> for(int i=0;i<max;i++)
> {
> t=p.substring(p.length()-(i+1)*8,p.length()-i*8);
> monByte = (byte)Integer.parseInt(t,2);
> System.out.println(t+" "+monByte);
> try {file.write(monByte);
> } catch (IOException e){System.out.println(e);}
> }
>
> }
>
> public static BigInteger newP(BigInteger p,int n )
> {
> BigInteger pow=new BigInteger("2");
> pow=pow.pow(n);
> p=p.add(pow);
> int qtTest=0;
> while(!p.isProbablePrime(100)){ p=p.add(pow);qtTest++;}
> //System.out.println("qt de test pour generer un nombre premier"+qtTest+"
> taille en base 2 "+p.toString(2).length());
> return p;
> }
> }
>
> --
> http://remyaumeunier.chez-alice.fr/
> toujours autant dyslexique
1 |