多項式(x^5+x^4+x^3+x^2+
x+1)*x^21+x^6+x^5+x^4+x^3+x^2+x+1
Ver.1.000 2012.5.13
更新履歴
2012.5.13 Ver.1.000 新規作成
多項式を変える。
(%i1) factor((x^5+x^4+x^3+x^2+x+1)*x^20+x^6+x^5+x^4+x^3+x^2+x+1);
12 11 10
9 8 7
6 5 4
3 2
(%o1) (x +
x + x + x + x + x + x +
x + x + x + x + x + 1)
13 7
(x - x + 1)
(%i2) factor((x^5+x^4+x^3+x^2+x+1)*x^21+x^6+x^5+x^4+x^3+x^2+x+1);
26 25 24
23 22 21
6 5 4
3 2
(%o2) x +
x + x + x + x +
x + x + x + x + x + x + x + 1
より、X20は、因数分解できるので、X21を検討する。
e11.batを作った。以下に示す。
for x:2
while x<20 do(
y:factor((x^5+x^4+x^3+x^2+x+1)*x^21+x^6+x^5+x^4+x^3+x^2+x+1),
print("
x=",x),
print("factor(x)=",y)
);
e11.batをmaximaで実行した。
(%i3) batch("e11.bat");
read and interpret file: e11.bat
(%i4) for x from 2 while x < 20 do (y :
2 3 4
5
6
2 3 4
5 21
factor(1 + x + x + x + x + x + x + (1 + x + x + x + x + x ) x ),
print( x=, x), print(factor(x)=, y))
x= 2
factor(x)= 11 13 373 2477
x= 3
factor(x)= 5 761513713397
x= 4
factor(x)= 383 6263 2502714349
x= 5
factor(x)= 11 10069681 16814886191
x= 6
factor(x)= 23 227 479 81849351133097
x= 7
factor(x)= 12347 35836729 24751545851
x= 8
factor(x)= 5 723266963 95512743448279
x= 9
factor(x)= 971 7485791398564743586871
x= 10
factor(x)= 71263 2176709 716296092760133
x= 11
factor(x)= 31 10823327 3907327199092677209
x= 12
factor(x)= 1193 38328443 273110999455969327
x= 13
factor(x)= 5 11 1806868250678731731983128867
x= 14
factor(x)= 13 1151 36590920469 1239143327927413
x= 15
factor(x)= 13 47 757 2447 9413 380922655218760253
x= 16
factor(x)= 11 79 139321807 4042017691 44209047881
x= 17
factor(x)= 37 104959 26839811920715797753344151
x= 18
factor(x)= 5 31 59 51941 214213 19696063 229081194497
x= 19
factor(x)= 97 643 863 5333227 6502661383952753111
(%o4)
done
(%o4)
e11.bat
(%i5)
これより、b.txtは、以下のようになった。
11,2
13,2
373,2
5,3
383,4
11,5
23,6
227,6
479,6
5,8
971,9
31,11
5,13
11,13
13,14
13,15
47,15
757,15
11,16
79,16
37,17
5,18
31,18
59,18
97,19
643,19
863,19
Autohajiku.cを編集して
#include
<stddef.h>
#include
<stdlib.h>
#include
<stdio.h>
#define
max 1 /* この数から+100まで生成する */
FILE
*fp;
FILE
*rp;
struct
b_{
int n;
int p;
};
struct
b_ b_txt[1000];
int n=1;
int
Flag=0;
int
max_i,i;
int
main (void)
{
/* 保存はカレントディレクトリーのhajiku-6.cというファイル名で上書きする */
if((fp=fopen("hajiku-6.c","w"))== NULL){
printf("cannot open hajiku-6.c\n");
exit(1);
}
/* はじくしきを読み込む */
if((rp=fopen("b.txt","r"))== NULL){
printf("cannot open b.txt\n");
exit(1);
}
i=0;
while(EOF!=fscanf(rp,"%d,%d\n",&b_txt[i].n,&b_txt[i].p)){
printf("%dn+%d\n",b_txt[i].n,b_txt[i].p);
i++;
}
fclose(rp);
printf("b.txt read! %d 個 \n",i);
max_i=i;
const
char c='%';
const
char slash=0x5c;
const
char dash=0x22;
fprintf(fp,"#include
<stddef.h>\n");
fprintf(fp,"#include
<stdlib.h>\n");
fprintf(fp,"#include
<stdio.h>\n");
fprintf(fp,"\n");
fprintf(fp,"FILE
*fp; \n");
fprintf(fp,"\n");
fprintf(fp,"int
n=1;\n");
fprintf(fp,"int
Flag=0;\n");
fprintf(fp,"\n");
fprintf(fp,"int
main (void)\n");
fprintf(fp,"\n");
fprintf(fp,"{
\n");
fprintf(fp,"
/* 保存はカレントディレクトリーのa.batというファイル名で上書きする */\n");
fprintf(fp,"
if((fp=fopen(%ca.bat%c,%cw%c))== NULL){\n",dash,dash,dash,dash);
fprintf(fp,"
printf(%ccannot open a.bat%cn%c);\n",dash,slash,dash);
fprintf(fp,"
exit(1);\n");
fprintf(fp,"
}\n");
fprintf(fp,"\n");
fprintf(fp,"
for(n=%d;n<%d;n++){\n",max,max+100);
fprintf(fp,"
Flag=0;\n");
for(i=0;i<max_i;i++){
fprintf(fp,"
if((n>%d) && (((n-%d) %c
%d)==0)){",b_txt[i].p-1,b_txt[i].p,c,b_txt[i].n);
fprintf(fp,"
/* %dx+%d */ \n",b_txt[i].n,b_txt[i].p);
fprintf(fp,"
printf(%c%cd=%dx%cd+%cd
%cn%c,n,(n-%d)/%d,%d);\n",dash,c,b_txt[i].n,c,c,slash,dash,b_txt[i].p,b_txt[i].n,b_txt[i].p);
fprintf(fp,"
Flag++;\n");
fprintf(fp,"
};\n");
}
fprintf(fp,"
if(Flag==0){
/* どれでもないとき */ \n");
fprintf(fp,"
printf(%c!!! %cd !!! %cn%c,n);\n",dash,c,slash,dash);
fprintf(fp,"
fprintf(fp,%cfactor((%cd^5+%cd^4+%cd^3+%cd^2+%cd+1)*%cd^21+%cd^6+%cd^5+%cd^4+%cd^3+%cd^2+%cd+1);%cn%c,n,n,n,n,n,n,n,n,n,n,n,n);\n",dash,c,c,c,c,c,c,c,c,c,c,c,c,slash,dash);
fprintf(fp,"
};\n");
fprintf(fp,"
};\n");
fprintf(fp,"
fclose(fp);\n");
fprintf(fp,"
return(0);\n");
fprintf(fp,"}\n");
fclose(fp);
return(0);
}
これより、
$gcc
-Wall Autohajiku.c -o Autohajiku
$./Autohajiku
11n+2
13n+2
373n+2
5n+3
383n+4
11n+5
23n+6
227n+6
479n+6
5n+8
971n+9
31n+11
5n+13
11n+13
13n+14
13n+15
47n+15
757n+15
11n+16
79n+16
37n+17
5n+18
31n+18
59n+18
97n+19
643n+19
863n+19
b.txt read! 27 個
$gcc -Wall hajiku-6.c -o hajiku-6
$./hajiku-6
!!! 1 !!!
2=11x0+2
2=13x0+2
2=373x0+2
3=5x0+3
4=383x0+4
5=11x0+5
6=23x0+6
6=227x0+6
6=479x0+6
!!! 7 !!!
8=5x1+3
8=5x0+8
9=971x0+9
!!! 10 !!!
11=31x0+11
!!! 12 !!!
13=11x1+2
13=5x2+3
13=5x1+8
13=5x0+13
13=11x0+13
14=13x0+14
15=13x1+2
15=13x0+15
15=47x0+15
15=757x0+15
16=11x1+5
16=11x0+16
16=79x0+16
17=37x0+17
18=5x3+3
18=5x2+8
18=5x1+13
18=5x0+18
18=31x0+18
18=59x0+18
19=97x0+19
19=643x0+19
19=863x0+19
!!! 20 !!!
!!! 21 !!!
!!! 22 !!!
23=5x4+3
23=5x3+8
23=5x2+13
23=5x1+18
24=11x2+2
24=11x1+13
!!! 25 !!!
!!! 26 !!!
27=11x2+5
27=13x1+14
27=11x1+16
28=13x2+2
28=5x5+3
28=5x4+8
28=5x3+13
28=13x1+15
28=5x2+18
29=23x1+6
!!! 30 !!!
!!! 31 !!!
!!! 32 !!!
33=5x6+3
33=5x5+8
33=5x4+13
33=5x3+18
!!! 34 !!!
35=11x3+2
35=11x2+13
!!! 36 !!!
!!! 37 !!!
38=5x7+3
38=11x3+5
38=5x6+8
38=5x5+13
38=11x2+16
38=5x4+18
!!! 39 !!!
40=13x2+14
41=13x3+2
41=13x2+15
42=31x1+11
43=5x8+3
43=5x7+8
43=5x6+13
43=5x5+18
!!! 44 !!!
!!! 45 !!!
46=11x4+2
46=11x3+13
!!! 47 !!!
48=5x9+3
48=5x8+8
48=5x7+13
48=5x6+18
49=11x4+5
49=11x3+16
49=31x1+18
!!! 50 !!!
!!! 51 !!!
52=23x2+6
53=5x10+3
53=5x9+8
53=5x8+13
53=13x3+14
53=5x7+18
54=13x4+2
54=13x3+15
54=37x1+17
!!! 55 !!!
!!! 56 !!!
57=11x5+2
57=11x4+13
58=5x11+3
58=5x10+8
58=5x9+13
58=5x8+18
!!! 59 !!!
60=11x5+5
60=11x4+16
!!! 61 !!!
62=47x1+15
63=5x12+3
63=5x11+8
63=5x10+13
63=5x9+18
!!! 64 !!!
!!! 65 !!!
66=13x4+14
67=13x5+2
67=13x4+15
68=11x6+2
68=5x13+3
68=5x12+8
68=5x11+13
68=11x5+13
68=5x10+18
!!! 69 !!!
!!! 70 !!!
71=11x6+5
71=11x5+16
!!! 72 !!!
73=5x14+3
73=5x13+8
73=31x2+11
73=5x12+13
73=5x11+18
!!! 74 !!!
75=23x3+6
!!! 76 !!!
77=59x1+18
78=5x15+3
78=5x14+8
78=5x13+13
78=5x12+18
79=11x7+2
79=11x6+13
79=13x5+14
80=13x6+2
80=13x5+15
80=31x2+18
!!! 81 !!!
82=11x7+5
82=11x6+16
83=5x16+3
83=5x15+8
83=5x14+13
83=5x13+18
!!! 84 !!!
!!! 85 !!!
!!! 86 !!!
!!! 87 !!!
88=5x17+3
88=5x16+8
88=5x15+13
88=5x14+18
!!! 89 !!!
90=11x8+2
90=11x7+13
91=37x2+17
92=13x6+14
93=13x7+2
93=5x18+3
93=11x8+5
93=5x17+8
93=5x16+13
93=13x6+15
93=11x7+16
93=5x15+18
!!! 94 !!!
95=79x1+16
!!! 96 !!!
!!! 97 !!!
98=5x19+3
98=23x4+6
98=5x18+8
98=5x17+13
98=5x16+18
!!! 99 !!!
!!! 100 !!!
生成されたa.batは、
factor((1^5+1^4+1^3+1^2+1+1)*1^21+1^6+1^5+1^4+1^3+1^2+1+1);
factor((7^5+7^4+7^3+7^2+7+1)*7^21+7^6+7^5+7^4+7^3+7^2+7+1);
factor((10^5+10^4+10^3+10^2+10+1)*10^21+10^6+10^5+10^4+10^3+10^2+10+1);
factor((12^5+12^4+12^3+12^2+12+1)*12^21+12^6+12^5+12^4+12^3+12^2+12+1);
factor((20^5+20^4+20^3+20^2+20+1)*20^21+20^6+20^5+20^4+20^3+20^2+20+1);
factor((21^5+21^4+21^3+21^2+21+1)*21^21+21^6+21^5+21^4+21^3+21^2+21+1);
factor((22^5+22^4+22^3+22^2+22+1)*22^21+22^6+22^5+22^4+22^3+22^2+22+1);
factor((25^5+25^4+25^3+25^2+25+1)*25^21+25^6+25^5+25^4+25^3+25^2+25+1);
factor((26^5+26^4+26^3+26^2+26+1)*26^21+26^6+26^5+26^4+26^3+26^2+26+1);
factor((30^5+30^4+30^3+30^2+30+1)*30^21+30^6+30^5+30^4+30^3+30^2+30+1);
factor((31^5+31^4+31^3+31^2+31+1)*31^21+31^6+31^5+31^4+31^3+31^2+31+1);
factor((32^5+32^4+32^3+32^2+32+1)*32^21+32^6+32^5+32^4+32^3+32^2+32+1);
factor((34^5+34^4+34^3+34^2+34+1)*34^21+34^6+34^5+34^4+34^3+34^2+34+1);
factor((36^5+36^4+36^3+36^2+36+1)*36^21+36^6+36^5+36^4+36^3+36^2+36+1);
factor((37^5+37^4+37^3+37^2+37+1)*37^21+37^6+37^5+37^4+37^3+37^2+37+1);
factor((39^5+39^4+39^3+39^2+39+1)*39^21+39^6+39^5+39^4+39^3+39^2+39+1);
factor((44^5+44^4+44^3+44^2+44+1)*44^21+44^6+44^5+44^4+44^3+44^2+44+1);
factor((45^5+45^4+45^3+45^2+45+1)*45^21+45^6+45^5+45^4+45^3+45^2+45+1);
factor((47^5+47^4+47^3+47^2+47+1)*47^21+47^6+47^5+47^4+47^3+47^2+47+1);
factor((50^5+50^4+50^3+50^2+50+1)*50^21+50^6+50^5+50^4+50^3+50^2+50+1);
factor((51^5+51^4+51^3+51^2+51+1)*51^21+51^6+51^5+51^4+51^3+51^2+51+1);
factor((55^5+55^4+55^3+55^2+55+1)*55^21+55^6+55^5+55^4+55^3+55^2+55+1);
factor((56^5+56^4+56^3+56^2+56+1)*56^21+56^6+56^5+56^4+56^3+56^2+56+1);
factor((59^5+59^4+59^3+59^2+59+1)*59^21+59^6+59^5+59^4+59^3+59^2+59+1);
factor((61^5+61^4+61^3+61^2+61+1)*61^21+61^6+61^5+61^4+61^3+61^2+61+1);
factor((64^5+64^4+64^3+64^2+64+1)*64^21+64^6+64^5+64^4+64^3+64^2+64+1);
factor((65^5+65^4+65^3+65^2+65+1)*65^21+65^6+65^5+65^4+65^3+65^2+65+1);
factor((69^5+69^4+69^3+69^2+69+1)*69^21+69^6+69^5+69^4+69^3+69^2+69+1);
factor((70^5+70^4+70^3+70^2+70+1)*70^21+70^6+70^5+70^4+70^3+70^2+70+1);
factor((72^5+72^4+72^3+72^2+72+1)*72^21+72^6+72^5+72^4+72^3+72^2+72+1);
factor((74^5+74^4+74^3+74^2+74+1)*74^21+74^6+74^5+74^4+74^3+74^2+74+1);
factor((76^5+76^4+76^3+76^2+76+1)*76^21+76^6+76^5+76^4+76^3+76^2+76+1);
factor((81^5+81^4+81^3+81^2+81+1)*81^21+81^6+81^5+81^4+81^3+81^2+81+1);
factor((84^5+84^4+84^3+84^2+84+1)*84^21+84^6+84^5+84^4+84^3+84^2+84+1);
factor((85^5+85^4+85^3+85^2+85+1)*85^21+85^6+85^5+85^4+85^3+85^2+85+1);
factor((86^5+86^4+86^3+86^2+86+1)*86^21+86^6+86^5+86^4+86^3+86^2+86+1);
factor((87^5+87^4+87^3+87^2+87+1)*87^21+87^6+87^5+87^4+87^3+87^2+87+1);
factor((89^5+89^4+89^3+89^2+89+1)*89^21+89^6+89^5+89^4+89^3+89^2+89+1);
factor((94^5+94^4+94^3+94^2+94+1)*94^21+94^6+94^5+94^4+94^3+94^2+94+1);
factor((96^5+96^4+96^3+96^2+96+1)*96^21+96^6+96^5+96^4+96^3+96^2+96+1);
factor((97^5+97^4+97^3+97^2+97+1)*97^21+97^6+97^5+97^4+97^3+97^2+97+1);
factor((99^5+99^4+99^3+99^2+99+1)*99^21+99^6+99^5+99^4+99^3+99^2+99+1);
factor((100^5+100^4+100^3+100^2+100+1)*100^21+100^6+100^5+100^4+100^3+100^2+100+1);
実行結果を示す。
(%i5) batch("a.bat");
read and interpret file: a.bat
2 3 4
5
6
2 3 4
5 21
(%i6) factor(1 + 1 + 1 + 1 + 1 + 1 + 1 + (1 + 1 + 1 + 1 + 1 + 1 ) 1 )
(%o6)
13
素数ですね。
2 3 4
5
6
2 3 4
5 21
(%i7) factor(1 + 7 + 7 + 7 + 7 + 7 + 7 + (1 + 7 + 7 + 7 + 7 + 7 ) 7 )
(%o7)
12347 35836729 24751545851
2 3
4 5 6
(%i8) factor(1 + 10 + 10 + 10 + 10 + 10 + 10
2 3
4 5 21
+ (1 + 10 + 10 + 10 + 10 + 10 ) 10 )
(%o8)
71263 2176709 716296092760133
2 3
4 5 6
(%i9) factor(1 + 12 + 12 + 12 + 12 + 12 + 12
2 3
4 5 21
+ (1 + 12 + 12 + 12 + 12 + 12 ) 12 )
(%o9)
1193 38328443 273110999455969327
2 3
4 5 6
(%i10) factor(1 + 20 + 20 + 20 + 20 + 20 + 20
2 3
4 5 21
+ (1 + 20 + 20 + 20 + 20 + 20 ) 20 )
(%o10)
7064090836992000000000000067368421
素数ですね。
2 3
4 5 6
(%i11) factor(1 + 21 + 21 + 21 + 21 + 21 + 21
2 3
4 5 21
+ (1 + 21 + 21 + 21 + 21 + 21 ) 21 )
(%o11)
25054800966466719162333804231375253
素数ですね。
2 3
4 5 6
(%i12) factor(1 + 22 + 22 + 22 + 22 + 22 + 22
2 3
4 5 21
+ (1 + 22 + 22 + 22 + 22 + 22 ) 22 )
(%o12) 53 2693 198972133 550700659 5357633590261
2 3
4 5 6
(%i13) factor(1 + 25 + 25 + 25 + 25 + 25 + 25
2 3
4 5 21
+ (1 + 25 + 25 + 25 + 25 + 25 ) 25 )
(%o13) 615103 686333 5478810311946877281820799
2 3
4 5 6
(%i14) factor(1 + 26 + 26 + 26 + 26 + 26 + 26
2 3
4 5 21
+ (1 + 26 + 26 + 26 + 26 + 26 ) 26 )
(%o14) 282409 189589271 6587229167 18152871060151
2 3
4 5 6
(%i15) factor(1 + 30 + 30 + 30 + 30 + 30 + 30
2 3
4 5 21
+ (1 + 30 + 30 + 30 + 30 + 30 ) 30 )
(%o15) 12119 620351 5840213 60807077 98489241496699
2 3
4 5 6
(%i16) factor(1 + 31 + 31 + 31 + 31 + 31 + 31
2 3
4 5 21
+ (1 + 31 + 31 + 31 + 31 + 31 ) 31 )
(%o16) 1231201 500397946449537997598174682274273
2 3
4 5 6
(%i17) factor(1 + 32 + 32 + 32 + 32 + 32 + 32
2 3
4 5 21
+ (1 + 32 + 32 + 32 + 32 + 32 ) 32 )
(%o17) 67 19777 1398737 758082447149162444910666011
2 3
4 5 6
(%i18) factor(1 + 34 + 34 + 34 + 34 + 34 + 34
2 3
4 5 21
+ (1 + 34 + 34 + 34 + 34 + 34 ) 34 )
(%o18) 211 82591 1570501 388940675633 637206296530127
2 3
4 5 6
(%i19) factor(1 + 36 + 36 + 36 + 36 + 36 + 36
2 3
4 5 21
+ (1 + 36 + 36 + 36 + 36 + 36 ) 36 )
(%o19) 239 9239 75806092993 178802050184744356063261
2 3
4 5 6
(%i20) factor(1 + 37 + 37 + 37 + 37 + 37 + 37
2 3
4 5 21
+ (1 + 37 + 37 + 37 + 37 + 37 ) 37 )
(%o20) 487 238373 27814181 301006660621 62735829294823
2 3
4 5 6
(%i21) factor(1 + 39 + 39 + 39 + 39 + 39 + 39
2 3
4 5 21
+ (1 + 39 + 39 + 39 + 39 + 39 ) 39 )
(%o21) 849015921329053 281867470732800510776815237
2 3
4 5 6
(%i22) factor(1 + 44 + 44 + 44 + 44 + 44 + 44
2 3
4 5 21
+ (1 + 44 + 44 + 44 + 44 + 44 ) 44 )
(%o22) 45095525977 121792446029460082907520993165253
2 3
4 5 6
(%i23) factor(1 + 45 + 45 + 45 + 45 + 45 + 45
2 3
4 5 21
+ (1 + 45 + 45 + 45 + 45 + 45 ) 45 )
(%o23) 59 1483 82245726208167787 1368291701595556511639
2 3
4 5 6
(%i24) factor(1 + 47 + 47 + 47 + 47 + 47 + 47
2 3
4 5 21
+ (1 + 47 + 47 + 47 + 47 + 47 ) 47 )
(%o24) 239 467 252293 23179834901023429 46682489876897213
2 3
4 5 6
(%i25) factor(1 + 50 + 50 + 50 + 50 + 50 + 50
2 3
4 5 21
+ (1 + 50 + 50 + 50 + 50 + 50 ) 50 )
(%o25) 630783425759 241053678686392747913284031415089
2 3
4 5 6
(%i26) factor(1 + 51 + 51 + 51 + 51 + 51 + 51
2 3
4 5 21
+ (1 + 51 + 51 + 51 + 51 + 51 ) 51 )
(%o26) 2557049581 3040461659 322369230973 101482810639139
2 3
4 5 6
(%i27) factor(1 + 55 + 55 + 55 + 55 + 55 + 55
2 3
4 5 21
+ (1 + 55 + 55 + 55 + 55 + 55 ) 55 )
(%o27) 239 6609263 134549824744425887 8510690264173041359
2 3
4 5 6
(%i28) factor(1 + 56 + 56 + 56 + 56 + 56 + 56
2 3
4 5 21
+ (1 + 56 + 56 + 56 + 56 + 56 ) 56 )
(%o28) 542013547 5329713920270057701425706320903033259
2 3
4 5 6
(%i29) factor(1 + 59 + 59 + 59 + 59 + 59 + 59
2 3
4 5 21
+ (1 + 59 + 59 + 59 + 59 + 59 ) 59 )
(%o29) 11209243945391297724161780554294525934724184441
素数ですね。
2 3
4 5 6
(%i30) factor(1 + 61 + 61 + 61 + 61 + 61 + 61
2 3
4 5 21
+ (1 + 61 + 61 + 61 + 61 + 61 ) 61 )
(%o30) 25841 16528612097 62403448682630163601279682207029
2 3
4 5 6
(%i31) factor(1 + 64 + 64 + 64 + 64 + 64 + 64
2 3
4 5 21
+ (1 + 64 + 64 + 64 + 64 + 64 ) 64 )
(%o31) 39869 9874091168681 235714485635791448422532041549
2 3
4 5 6
(%i32) factor(1 + 65 + 65 + 65 + 65 + 65 + 65
2 3
4 5 21
+ (1 + 65 + 65 + 65 + 65 + 65 ) 65 )
(%o32) 223 283 462989742481109 4751360549781226484976449861
2 3
4 5 6
(%i33) factor(1 + 69 + 69 + 69 + 69 + 69 + 69
2 3
4 5 21
+ (1 + 69 + 69 + 69 + 69 + 69 ) 69 )
(%o33) 71 239 38615377741371528568504975926325088303996749
2 3
4 5 6
(%i34) factor(1 + 70 + 70 + 70 + 70 + 70 + 70
2 3
4 5 21
+ (1 + 70 + 70 + 70 + 70 + 70 ) 70 )
(%o34) 1314561307 13685567548277 52936391316893640706747589
2 3
4 5 6
(%i35) factor(1 + 72 + 72 + 72 + 72 + 72 + 72
2 3
4 5 21
+ (1 + 72 + 72 + 72 + 72 + 72 ) 72 )
(%o35) 83 856614281 27851952902042056762500867504549648091
2 3
4 5 6
(%i36) factor(1 + 74 + 74 + 74 + 74 + 74 + 74
2 3
4 5 21
+ (1 + 74 + 74 + 74 + 74 + 74 ) 74 )
(%o36) 1481 176417 15446784281015004985648891419236644519663
2 3
4 5 6
(%i37) factor(1 + 76 + 76 + 76 + 76 + 76 + 76
2 3
4 5 21
+ (1 + 76 + 76 + 76 + 76 + 76 ) 76 )
(%o37) 227 52387403 9569232971 70921167009366442870116318263
2 3
4 5 6
(%i38) factor(1 + 81 + 81 + 81 + 81 + 81 + 81
2 3
4 5 21
+ (1 + 81 + 81 + 81 + 81 + 81 ) 81 )
(%o38) 2098781 168412411 54889312130626121 2178595073671312843
2 3
4 5 6
(%i39) factor(1 + 84 + 84 + 84 + 84 + 84 + 84
2 3
4 5 21
+ (1 + 84 + 84 + 84 + 84 + 84 ) 84 )
(%o39) 595939 2190986257727 83295429103218347883096661515497
2 3
4 5 6
(%i40) factor(1 + 85 + 85 + 85 + 85 + 85 + 85
2 3
4 5 21
+ (1 + 85 + 85 + 85 + 85 + 85 ) 85 )
(%o40) 97 1548597569 984739595326160436743642492440338239477
2 3
4 5 6
(%i41) factor(1 + 86 + 86 + 86 + 86 + 86 + 86
2 3
4 5 21
+ (1 + 86 + 86 + 86 + 86 + 86 ) 86 )
(%o41) 30497 742369 1161113 7625842342181626853186423429995387
2 3
4 5 6
(%i42) factor(1 + 87 + 87 + 87 + 87 + 87 + 87
2 3
4 5 21
+ (1 + 87 + 87 + 87 + 87 + 87 ) 87 )
(%o42) 59 369829 12407046063221620118851962519106437826399943
2 3
4 5 6
(%i43) factor(1 + 89 + 89 + 89 + 89 + 89 + 89
2 3
4 5 21
+ (1 + 89 + 89 + 89 + 89 + 89 ) 89 )
(%o43) 2017 3889 3456941 18022361572559883089630953149256513217
2 3
4 5 6
(%i44) factor(1 + 94 + 94 + 94 + 94 + 94 + 94
2 3
4 5 21
+ (1 + 94 + 94 + 94 + 94 + 94 ) 94 )
(%o44) 2022875239880941584394816463470029156467245502069131
素数ですね。
2 3
4 5 6
(%i45) factor(1 + 96 + 96 + 96 + 96 + 96 + 96
2 3
4 5 21
+ (1 + 96 + 96 + 96 + 96 + 96 ) 96 )
(%o45) 53 2218683244851384877 29732300501028085582958233168913
2 3
4 5 6
(%i46) factor(1 + 97 + 97 + 97 + 97 + 97 + 97
2 3
4 5 21
+ (1 + 97 + 97 + 97 + 97 + 97 ) 97 )
(%o46) 4576838543471990909597511693589453040349637141951693
素数ですね。
2 3
4 5 6
(%i47) factor(1 + 99 + 99 + 99 + 99 + 99 + 99
2 3
4 5 21
+ (1 + 99 + 99 + 99 + 99 + 99 ) 99 )
(%o47) 67 163 9883 72073062442035029307507711594787381985145907
2 3
4 5 6
(%i48) factor(1 + 100 + 100 + 100 + 100 + 100 + 100
2 3
4 5 21
+ (1 + 100 + 100 + 100 + 100 + 100 ) 100 )
(%o48) 10101010101000000000000000000000000000001010101010101
素数ですね。
(%o48)
a.bat
(%i49)
b.txtに追加されるものは、
53,22
67,32
211,34
239,36
487,37
59,45
239,47
467,47
223,65
283,65
71,69
239,69
83,72
227,76
97,85
59,87
53,96
67,99
これより、Autohajiku.cの
#define max 1 /* この数から+100まで生成する
*/
を
#define max 100 /*
この数から+100まで生成する */
になおして、
Autohajiku.cをコンパイル実行する。
$gcc -Wall Autohajiku.c -o Autohajiku
$./Autohajiku
11n+2
13n+2
373n+2
5n+3
383n+4
11n+5
23n+6
227n+6
479n+6
5n+8
971n+9
31n+11
5n+13
11n+13
13n+14
13n+15
47n+15
757n+15
11n+16
79n+16
37n+17
5n+18
31n+18
59n+18
97n+19
643n+19
863n+19
53n+22
67n+32
211n+34
239n+36
487n+37
59n+45
239n+47
467n+47
223n+65
283n+65
71n+69
239n+69
83n+72
227n+76
97n+85
59n+87
53n+96
67n+99
b.txt read! 45 個
$gcc -Wall hajiku-6.c -o hajiku-6
$./hajiku-6
!!! 100 !!!
101=11x9+2
101=11x8+13
!!! 102 !!!
103=5x20+3
103=5x19+8
103=5x18+13
103=5x17+18
104=11x9+5
104=31x3+11
104=11x8+16
104=59x1+45
105=13x7+14
106=13x8+2
106=13x7+15
!!! 107 !!!
108=5x21+3
108=5x20+8
108=5x19+13
108=5x18+18
109=47x2+15
!!! 110 !!!
111=31x3+18
112=11x10+2
112=11x9+13
113=5x22+3
113=5x21+8
113=5x20+13
113=5x19+18
!!! 114 !!!
115=11x10+5
115=11x9+16
116=97x1+19
!!! 117 !!!
118=5x23+3
118=5x22+8
118=5x21+13
118=13x8+14
118=5x20+18
119=13x9+2
119=13x8+15
!!! 120 !!!
121=23x5+6
!!! 122 !!!
123=11x11+2
123=5x24+3
123=5x23+8
123=5x22+13
123=11x10+13
123=5x21+18
!!! 124 !!!
!!! 125 !!!
126=11x11+5
126=11x10+16
!!! 127 !!!
128=5x25+3
128=5x24+8
128=5x23+13
128=37x3+17
128=5x22+18
128=53x2+22
!!! 129 !!!
!!! 130 !!!
131=13x9+14
132=13x10+2
132=13x9+15
133=5x26+3
133=5x25+8
133=5x24+13
133=5x23+18
134=11x12+2
134=11x11+13
135=31x4+11
136=59x2+18
137=11x12+5
137=11x11+16
138=5x27+3
138=5x26+8
138=5x25+13
138=5x24+18
!!! 139 !!!
140=71x1+69
!!! 141 !!!
142=31x4+18
143=5x28+3
143=5x27+8
143=5x26+13
143=5x25+18
144=23x6+6
144=13x10+14
145=11x13+2
145=13x11+2
145=11x12+13
145=13x10+15
146=59x1+87
!!! 147 !!!
148=5x29+3
148=11x13+5
148=5x28+8
148=5x27+13
148=11x12+16
148=5x26+18
149=53x1+96
!!! 150 !!!
!!! 151 !!!
!!! 152 !!!
153=5x30+3
153=5x29+8
153=5x28+13
153=5x27+18
!!! 154 !!!
155=83x1+72
156=11x14+2
156=11x13+13
156=47x3+15
157=13x11+14
158=13x12+2
158=5x31+3
158=5x30+8
158=5x29+13
158=13x11+15
158=5x28+18
159=11x14+5
159=11x13+16
!!! 160 !!!
!!! 161 !!!
!!! 162 !!!
163=5x32+3
163=5x31+8
163=5x30+13
163=5x29+18
163=59x2+45
!!! 164 !!!
165=37x4+17
166=31x5+11
166=67x2+32
166=67x1+99
167=11x15+2
167=23x7+6
167=11x14+13
168=5x33+3
168=5x32+8
168=5x31+13
168=5x30+18
!!! 169 !!!
170=11x15+5
170=13x12+14
170=11x14+16
171=13x13+2
171=13x12+15
!!! 172 !!!
173=5x34+3
173=5x33+8
173=5x32+13
173=5x31+18
173=31x5+18
174=79x2+16
!!! 175 !!!
!!! 176 !!!
!!! 177 !!!
178=11x16+2
178=5x35+3
178=5x34+8
178=5x33+13
178=11x15+13
178=5x32+18
!!! 179 !!!
!!! 180 !!!
181=11x16+5
181=11x15+16
181=53x3+22
182=97x1+85
183=5x36+3
183=5x35+8
183=5x34+13
183=13x13+14
183=5x33+18
184=13x14+2
184=13x13+15
!!! 185 !!!
!!! 186 !!!
!!! 187 !!!
188=5x37+3
188=5x36+8
188=5x35+13
188=5x34+18
189=11x17+2
189=11x16+13
190=23x8+6
!!! 191 !!!
192=11x17+5
192=11x16+16
193=5x38+3
193=5x37+8
193=5x36+13
193=5x35+18
!!! 194 !!!
195=59x3+18
196=13x14+14
197=13x15+2
197=31x6+11
197=13x14+15
198=5x39+3
198=5x38+8
198=5x37+13
198=5x36+18
!!! 199 !!!
生成されたa.batは、
factor((100^5+100^4+100^3+100^2+100+1)*100^21+100^6+100^5+100^4+100^3+100^2+100+1);
factor((102^5+102^4+102^3+102^2+102+1)*102^21+102^6+102^5+102^4+102^3+102^2+102+1);
factor((107^5+107^4+107^3+107^2+107+1)*107^21+107^6+107^5+107^4+107^3+107^2+107+1);
factor((110^5+110^4+110^3+110^2+110+1)*110^21+110^6+110^5+110^4+110^3+110^2+110+1);
factor((114^5+114^4+114^3+114^2+114+1)*114^21+114^6+114^5+114^4+114^3+114^2+114+1);
factor((117^5+117^4+117^3+117^2+117+1)*117^21+117^6+117^5+117^4+117^3+117^2+117+1);
factor((120^5+120^4+120^3+120^2+120+1)*120^21+120^6+120^5+120^4+120^3+120^2+120+1);
factor((122^5+122^4+122^3+122^2+122+1)*122^21+122^6+122^5+122^4+122^3+122^2+122+1);
factor((124^5+124^4+124^3+124^2+124+1)*124^21+124^6+124^5+124^4+124^3+124^2+124+1);
factor((125^5+125^4+125^3+125^2+125+1)*125^21+125^6+125^5+125^4+125^3+125^2+125+1);
factor((127^5+127^4+127^3+127^2+127+1)*127^21+127^6+127^5+127^4+127^3+127^2+127+1);
factor((129^5+129^4+129^3+129^2+129+1)*129^21+129^6+129^5+129^4+129^3+129^2+129+1);
factor((130^5+130^4+130^3+130^2+130+1)*130^21+130^6+130^5+130^4+130^3+130^2+130+1);
factor((139^5+139^4+139^3+139^2+139+1)*139^21+139^6+139^5+139^4+139^3+139^2+139+1);
factor((141^5+141^4+141^3+141^2+141+1)*141^21+141^6+141^5+141^4+141^3+141^2+141+1);
factor((147^5+147^4+147^3+147^2+147+1)*147^21+147^6+147^5+147^4+147^3+147^2+147+1);
factor((150^5+150^4+150^3+150^2+150+1)*150^21+150^6+150^5+150^4+150^3+150^2+150+1);
factor((151^5+151^4+151^3+151^2+151+1)*151^21+151^6+151^5+151^4+151^3+151^2+151+1);
factor((152^5+152^4+152^3+152^2+152+1)*152^21+152^6+152^5+152^4+152^3+152^2+152+1);
factor((154^5+154^4+154^3+154^2+154+1)*154^21+154^6+154^5+154^4+154^3+154^2+154+1);
factor((160^5+160^4+160^3+160^2+160+1)*160^21+160^6+160^5+160^4+160^3+160^2+160+1);
factor((161^5+161^4+161^3+161^2+161+1)*161^21+161^6+161^5+161^4+161^3+161^2+161+1);
factor((162^5+162^4+162^3+162^2+162+1)*162^21+162^6+162^5+162^4+162^3+162^2+162+1);
factor((164^5+164^4+164^3+164^2+164+1)*164^21+164^6+164^5+164^4+164^3+164^2+164+1);
factor((169^5+169^4+169^3+169^2+169+1)*169^21+169^6+169^5+169^4+169^3+169^2+169+1);
factor((172^5+172^4+172^3+172^2+172+1)*172^21+172^6+172^5+172^4+172^3+172^2+172+1);
factor((175^5+175^4+175^3+175^2+175+1)*175^21+175^6+175^5+175^4+175^3+175^2+175+1);
factor((176^5+176^4+176^3+176^2+176+1)*176^21+176^6+176^5+176^4+176^3+176^2+176+1);
factor((177^5+177^4+177^3+177^2+177+1)*177^21+177^6+177^5+177^4+177^3+177^2+177+1);
factor((179^5+179^4+179^3+179^2+179+1)*179^21+179^6+179^5+179^4+179^3+179^2+179+1);
factor((180^5+180^4+180^3+180^2+180+1)*180^21+180^6+180^5+180^4+180^3+180^2+180+1);
factor((185^5+185^4+185^3+185^2+185+1)*185^21+185^6+185^5+185^4+185^3+185^2+185+1);
factor((186^5+186^4+186^3+186^2+186+1)*186^21+186^6+186^5+186^4+186^3+186^2+186+1);
factor((187^5+187^4+187^3+187^2+187+1)*187^21+187^6+187^5+187^4+187^3+187^2+187+1);
factor((191^5+191^4+191^3+191^2+191+1)*191^21+191^6+191^5+191^4+191^3+191^2+191+1);
factor((194^5+194^4+194^3+194^2+194+1)*194^21+194^6+194^5+194^4+194^3+194^2+194+1);
factor((199^5+199^4+199^3+199^2+199+1)*199^21+199^6+199^5+199^4+199^3+199^2+199+1);
(%i49) batch("a.bat");
read and interpret file: a.bat
2 3
4 5 6
(%i50) factor(1 + 100 + 100 + 100 + 100 + 100 + 100
2 3
4 5 21
+ (1 + 100 + 100 + 100 + 100 + 100 ) 100 )
(%o50) 10101010101000000000000000000000000000001010101010101
素数ですね。
2 3
4 5 6
(%i51) factor(1 + 102 + 102 + 102 + 102 + 102 + 102
2 3
4 5 21
+ (1 + 102 + 102 + 102 + 102 + 102 ) 102 )
(%o51) 238413458303 34717519743107 2041755834067240435909803343
2 3
4 5 6
(%i52) factor(1 + 107 + 107 + 107 + 107 + 107 + 107
2 3
4 5 21
+ (1 + 107 + 107 + 107 + 107 + 107 ) 107 )
(%o52) 163 577 2488267 34881907 1378909056407 5207867076712062268661
2 3
4 5 6
(%i53) factor(1 + 110 + 110 + 110 + 110 + 110 + 110
2 3
4 5 21
+ (1 + 110 + 110 + 110 + 110 + 110 ) 110 )
(%o53) 547 219881491898974055601314965883950639853750983206313
2 3
4 5 6
(%i54) factor(1 + 114 + 114 + 114 + 114 + 114 + 114
2 3
4 5 21
+ (1 + 114 + 114 + 114 + 114 + 114 ) 114 )
(%o54) 388421982877158733 783517573367081651990928651793281067
2 3
4 5 6
(%i55) factor(1 + 117 + 117 + 117 + 117 + 117 + 117
2 3
4 5 21
+ (1 + 117 + 117 + 117 + 117 + 117 ) 117 )
(%o55) 1103 93889 2911453 58812769 33712320044950380080074052786807
2 3
4 5 6
(%i56) factor(1 + 120 + 120 + 120 + 120 + 120 + 120
2 3
4 5 21
+ (1 + 120 + 120 + 120 + 120 + 120 ) 120 )
(%o56) 131 57566144160597092351138737 153076401839599109841751043
2 3
4 5 6
(%i57) factor(1 + 122 + 122 + 122 + 122 + 122 + 122
2 3
4 5 21
+ (1 + 122 + 122 + 122 + 122 + 122 ) 122 )
(%o57) 1867 801970393711 1184751873644045197936297836595853808139
2 3
4 5 6
(%i58) factor(1 + 124 + 124 + 124 + 124 + 124 + 124
2 3
4 5 21
+ (1 + 124 + 124 + 124 + 124 + 124 ) 124 )
(%o58) 225840691 607365134691282899929 19734600359337735586535959
2 3
4 5 6
(%i59) factor(1 + 125 + 125 + 125 + 125 + 125 + 125
2 3
4 5 21
+ (1 + 125 + 125 + 125 + 125 + 125 ) 125 )
(%o59) 1367 2439945644314164624787359862611680165554543373271203
2 3
4 5 6
(%i60) factor(1 + 127 + 127 + 127 + 127 + 127 + 127
2 3
4 5 21
+ (1 + 127 + 127 + 127 + 127 + 127 ) 127 )
(%o60) 5038832486537099570851259159728375226403443476444445953
素数ですね。
2 3
4 5 6
(%i61) factor(1 + 129 + 129 + 129 + 129 + 129 + 129
2 3
4 5 21
+ (1 + 129 + 129 + 129 + 129 + 129 ) 129 )
(%o61) 131 1697 28638620791499 1187974097776438134890681256946489997
2 3
4 5 6
(%i62) factor(1 + 130 + 130 + 130 + 130 + 130 + 130
2 3
4 5 21
+ (1 + 130 + 130 + 130 + 130 + 130 ) 130 )
(%o62) 11839 44682936379 17475277303210787366607779928620730064051
2 3
4 5 6
(%i63) factor(1 + 139 + 139 + 139 + 139 + 139 + 139
2 3
4 5 21
+ (1 + 139 + 139 + 139 + 139 + 139 ) 139 )
(%o63) 337 798911 204119913805528863416081 958311814656027569515783
2 3
4 5 6
(%i64) factor(1 + 141 + 141 + 141 + 141 + 141 + 141
2 3
4 5 21
+ (1 + 141 + 141 + 141 + 141 + 141 ) 141 )
(%o64) 277279 191498429 1398414930127 1028181438479527113801575429849
2 3
4 5 6
(%i65) factor(1 + 147 + 147 + 147 + 147 + 147 + 147
2 3
4 5 21
+ (1 + 147 + 147 + 147 + 147 + 147 ) 147 )
(%o65) 1339817 168333168629217778874947523477646168593613485403329
2 3
4 5 6
(%i66) factor(1 + 150 + 150 + 150 + 150 + 150 + 150
2 3
4 5 21
+ (1 + 150 + 150 + 150 + 150 + 150 ) 150 )
(%o66) 381309588332820785595417022705078125000000011467072147651
素数ですね。
2 3
4 5 6
(%i67) factor(1 + 151 + 151 + 151 + 151 + 151 + 151
2 3
4 5 21
+ (1 + 151 + 151 + 151 + 151 + 151 ) 151 )
(%o67) 311 5685661 95054224033 2696333118351306060162865556956424291
2 3
4 5 6
(%i68) factor(1 + 152 + 152 + 152 + 152 + 152 + 152
2 3
4 5 21
+ (1 + 152 + 152 + 152 + 152 + 152 ) 152 )
(%o68) 782055971 14397905575986493411 47781829024550926102714821713
2 3
4 5 6
(%i69) factor(1 + 154 + 154 + 154 + 154 + 154 + 154
2 3
4 5 21
+ (1 + 154 + 154 + 154 + 154 + 154 ) 154 )
(%o69) 463 1216726767269933 95913332982953719 13986691484390337651371
2 3
4 5 6
(%i70) factor(1 + 160 + 160 + 160 + 160 + 160 + 160
2 3
4 5 21
+ (1 + 160 + 160 + 160 + 160 + 160 ) 160 )
(%o70) 224084257213 9108168588925603625896516442842019792914991797
2 3
4 5 6
(%i71) factor(1 + 161 + 161 + 161 + 161 + 161 + 161
2 3
4 5 21
+ (1 + 161 + 161 + 161 + 161 + 161 ) 161 )
(%o71) 1913 45031771 4371261509 6372911452397159601092277832729654819
2 3
4 5 6
(%i72) factor(1 + 162 + 162 + 162 + 162 + 162 + 162
2 3
4 5 21
+ (1 + 162 + 162 + 162 + 162 + 162 ) 162 )
(%o72) 619 5324083421141 855350307683161573575124153600711196292137
2 3
4 5 6
(%i73) factor(1 + 164 + 164 + 164 + 164 + 164 + 164
2 3
4 5 21
+ (1 + 164 + 164 + 164 + 164 + 164 ) 164 )
(%o73) 2087 38069 12581441 11721656395297543 330965711897024283720280049
2 3
4 5 6
(%i74) factor(1 + 169 + 169 + 169 + 169 + 169 + 169
2 3
4 5 21
+ (1 + 169 + 169 + 169 + 169 + 169 ) 169 )
(%o74) 17093 2061820834391557299937 240194205638666485972599844580441
2 3
4 5 6
(%i75) factor(1 + 172 + 172 + 172 + 172 + 172 + 172
2 3
4 5 21
+ (1 + 172 + 172 + 172 + 172 + 172 ) 172 )
(%o75) 223 293 119385029243108339 1714547820630542090078780865959796733
2 3
4 5 6
(%i76) factor(1 + 175 + 175 + 175 + 175 + 175 + 175
2 3
4 5 21
+ (1 + 175 + 175 + 175 + 175 + 175 ) 175 )
(%o76) 697372541399 30061678298613431612148676761681430804308097799
2 3
4 5 6
(%i77) factor(1 + 176 + 176 + 176 + 176 + 176 + 176
2 3
4 5 21
+ (1 + 176 + 176 + 176 + 176 + 176 ) 176 )
(%o77) 7069 12935058564792936431 265875060212436096658204341965703467
2 3
4 5 6
(%i78) factor(1 + 177 + 177 + 177 + 177 + 177 + 177
2 3
4 5 21
+ (1 + 177 + 177 + 177 + 177 + 177 ) 177 )
(%o78) 334783 6295417 67022409689 199414891488441900536740749261353507
2 3
4 5 6
(%i79) factor(1 + 179 + 179 + 179 + 179 + 179 + 179
2 3
4 5 21
+ (1 + 179 + 179 + 179 + 179 + 179 ) 179 )
(%o79) 2347 69193 9120532873 76762478543 331793124206968665945441616709
2 3
4 5 6
(%i80) factor(1 + 180 + 180 + 180 + 180 + 180 + 180
2 3
4 5 21
+ (1 + 180 + 180 + 180 + 180 + 180 ) 180 )
(%o80) 490097 287783033 46016167129 2822988519185801 2379785552838216989
2 3
4 5 6
(%i81) factor(1 + 185 + 185 + 185 + 185 + 185 + 185
2 3
4 5 21
+ (1 + 185 + 185 + 185 + 185 + 185 ) 185 )
(%o81) 4783 191693 96942052117013933548889879306820727403616823905119
2 3
4 5 6
(%i82) factor(1 + 186 + 186 + 186 + 186 + 186 + 186
2 3
4 5 21
+ (1 + 186 + 186 + 186 + 186 + 186 ) 186 )
2 3
4 5 21
+ (1 + 186 + 186 + 186 + 186 + 186 ) 186 )
(%o82) 3547 9187 948064069479742707637973 3309826074724880862201740939
2 3
4 5 6
(%i83) factor(1 + 187 + 187 + 187 + 187 + 187 + 187
2 3
4 5 21
+ (1 + 187 + 187 + 187 + 187 + 187 ) 187 )
(%o83) 9126571 12879612459385095964592734560260716908087692632384363
2 3
4 5 6
(%i84) factor(1 + 191 + 191 + 191 + 191 + 191 + 191
2 3
4 5 21
+ (1 + 191 + 191 + 191 + 191 + 191 ) 191 )
(%o84) 59443 19556325077 1652104853227 106101552952907498025349266722669
2 3
4 5 6
(%i85) factor(1 + 194 + 194 + 194 + 194 + 194 + 194
2 3
4 5 21
+ (1 + 194 + 194 + 194 + 194 + 194 ) 194 )
(%o85) 1556267 1755186013175923 968436733349474927 115507686923839115233
2 3
4 5 6
(%i86) factor(1 + 199 + 199 + 199 + 199 + 199 + 199
2 3
4 5 21
+ (1 + 199 + 199 + 199 + 199 + 199 ) 199 )
(%o86) 1901 17138324933 18172613223369965164403814507296602164021574897
(%o86)
a.bat
(%i87)
b.txtに追加されるものは、
163,107
577,107
547,110
131,120
131,129
337,139
311,151
463,154
619,162
223,172
293,172
これより、Autohajiku.cの
#define max 100 /*
この数から+100まで生成する
*/
を
#define max 200 /*
この数から+100まで生成する */
になおして、
Autohajiku.cをコンパイル、実行する。
$gcc -Wall Autohajiku.c -o Autohajiku
$./Autohajiku
11n+2
13n+2
373n+2
5n+3
383n+4
11n+5
23n+6
227n+6
479n+6
5n+8
971n+9
31n+11
5n+13
11n+13
13n+14
13n+15
47n+15
757n+15
11n+16
79n+16
37n+17
5n+18
31n+18
59n+18
97n+19
643n+19
863n+19
53n+22
67n+32
211n+34
239n+36
487n+37
59n+45
239n+47
467n+47
223n+65
283n+65
71n+69
239n+69
83n+72
227n+76
97n+85
59n+87
53n+96
67n+99
163n+107
577n+107
547n+110
131n+120
131n+129
337n+139
311n+151
463n+154
619n+162
223n+172
293n+172
b.txt read! 56 個
$gcc -Wall hajiku-6.c -o hajiku-6
$./hajiku-6
200=11x18+2
200=11x17+13
!!! 201 !!!
202=37x5+17
202=53x2+96
203=5x40+3
203=11x18+5
203=5x39+8
203=5x38+13
203=47x4+15
203=11x17+16
203=5x37+18
204=31x6+18
205=59x2+87
!!! 206 !!!
!!! 207 !!!
208=5x41+3
208=5x40+8
208=5x39+13
208=5x38+18
209=13x15+14
210=13x16+2
210=13x15+15
211=11x19+2
211=11x18+13
211=71x2+69
!!! 212 !!!
213=5x42+3
213=23x9+6
213=5x41+8
213=5x40+13
213=5x39+18
213=97x2+19
214=11x19+5
214=11x18+16
!!! 215 !!!
!!! 216 !!!
!!! 217 !!!
218=5x43+3
218=5x42+8
218=5x41+13
218=5x40+18
!!! 219 !!!
!!! 220 !!!
!!! 221 !!!
222=11x20+2
222=11x19+13
222=13x16+14
222=59x3+45
223=13x17+2
223=5x44+3
223=5x43+8
223=5x42+13
223=13x16+15
223=5x41+18
!!! 224 !!!
225=11x20+5
225=11x19+16
!!! 226 !!!
!!! 227 !!!
228=5x45+3
228=5x44+8
228=31x7+11
228=5x43+13
228=5x42+18
!!! 229 !!!
!!! 230 !!!
!!! 231 !!!
!!! 232 !!!
233=11x21+2
233=5x46+3
233=227x1+6
233=5x45+8
233=5x44+13
233=11x20+13
233=5x43+18
233=67x3+32
233=67x2+99
234=53x4+22
235=13x17+14
235=31x7+18
236=13x18+2
236=11x21+5
236=23x10+6
236=13x17+15
236=11x20+16
!!! 237 !!!
238=5x47+3
238=5x46+8
238=5x45+13
238=5x44+18
238=83x2+72
239=37x6+17
!!! 240 !!!
!!! 241 !!!
!!! 242 !!!
243=5x48+3
243=5x47+8
243=5x46+13
243=5x45+18
244=11x22+2
244=11x21+13
245=211x1+34
!!! 246 !!!
247=11x22+5
247=11x21+16
248=5x49+3
248=5x48+8
248=5x47+13
248=13x18+14
248=5x46+18
249=13x19+2
249=13x18+15
250=47x5+15
251=131x1+120
!!! 252 !!!
253=5x50+3
253=5x49+8
253=5x48+13
253=79x3+16
253=5x47+18
254=59x4+18
255=11x23+2
255=11x22+13
255=53x3+96
!!! 256 !!!
!!! 257 !!!
258=5x51+3
258=11x23+5
258=5x50+8
258=5x49+13
258=11x22+16
258=5x48+18
259=23x11+6
259=31x8+11
260=131x1+129
261=13x19+14
262=13x20+2
262=13x19+15
263=5x52+3
263=5x51+8
263=5x50+13
263=5x49+18
264=59x3+87
!!! 265 !!!
266=11x24+2
266=11x23+13
266=31x8+18
!!! 267 !!!
268=5x53+3
268=5x52+8
268=5x51+13
268=5x50+18
269=11x24+5
269=11x23+16
270=163x1+107
!!! 271 !!!
!!! 272 !!!
273=5x54+3
273=5x53+8
273=5x52+13
273=5x51+18
274=13x20+14
275=13x21+2
275=13x20+15
275=239x1+36
276=37x7+17
277=11x25+2
277=11x24+13
278=5x55+3
278=5x54+8
278=5x53+13
278=5x52+18
279=97x2+85
280=11x25+5
280=11x24+16
281=59x4+45
282=23x12+6
282=71x3+69
283=5x56+3
283=5x55+8
283=5x54+13
283=5x53+18
!!! 284 !!!
!!! 285 !!!
286=239x1+47
287=13x21+14
287=53x5+22
288=11x26+2
288=13x22+2
288=5x57+3
288=5x56+8
288=5x55+13
288=11x25+13
288=13x21+15
288=5x54+18
288=223x1+65
!!! 289 !!!
290=31x9+11
291=11x26+5
291=11x25+16
!!! 292 !!!
293=5x58+3
293=5x57+8
293=5x56+13
293=5x55+18
!!! 294 !!!
!!! 295 !!!
!!! 296 !!!
297=47x6+15
297=31x9+18
298=5x59+3
298=5x58+8
298=5x57+13
298=5x56+18
299=11x27+2
299=11x26+13
生成されたa.batは、
factor((201^5+201^4+201^3+201^2+201+1)*201^21+201^6+201^5+201^4+201^3+201^2+201+1);
factor((206^5+206^4+206^3+206^2+206+1)*206^21+206^6+206^5+206^4+206^3+206^2+206+1);
factor((207^5+207^4+207^3+207^2+207+1)*207^21+207^6+207^5+207^4+207^3+207^2+207+1);
factor((212^5+212^4+212^3+212^2+212+1)*212^21+212^6+212^5+212^4+212^3+212^2+212+1);
factor((215^5+215^4+215^3+215^2+215+1)*215^21+215^6+215^5+215^4+215^3+215^2+215+1);
factor((216^5+216^4+216^3+216^2+216+1)*216^21+216^6+216^5+216^4+216^3+216^2+216+1);
factor((217^5+217^4+217^3+217^2+217+1)*217^21+217^6+217^5+217^4+217^3+217^2+217+1);
factor((219^5+219^4+219^3+219^2+219+1)*219^21+219^6+219^5+219^4+219^3+219^2+219+1);
factor((220^5+220^4+220^3+220^2+220+1)*220^21+220^6+220^5+220^4+220^3+220^2+220+1);
factor((221^5+221^4+221^3+221^2+221+1)*221^21+221^6+221^5+221^4+221^3+221^2+221+1);
factor((224^5+224^4+224^3+224^2+224+1)*224^21+224^6+224^5+224^4+224^3+224^2+224+1);
factor((226^5+226^4+226^3+226^2+226+1)*226^21+226^6+226^5+226^4+226^3+226^2+226+1);
factor((227^5+227^4+227^3+227^2+227+1)*227^21+227^6+227^5+227^4+227^3+227^2+227+1);
factor((229^5+229^4+229^3+229^2+229+1)*229^21+229^6+229^5+229^4+229^3+229^2+229+1);
factor((230^5+230^4+230^3+230^2+230+1)*230^21+230^6+230^5+230^4+230^3+230^2+230+1);
factor((231^5+231^4+231^3+231^2+231+1)*231^21+231^6+231^5+231^4+231^3+231^2+231+1);
factor((232^5+232^4+232^3+232^2+232+1)*232^21+232^6+232^5+232^4+232^3+232^2+232+1);
factor((237^5+237^4+237^3+237^2+237+1)*237^21+237^6+237^5+237^4+237^3+237^2+237+1);
factor((240^5+240^4+240^3+240^2+240+1)*240^21+240^6+240^5+240^4+240^3+240^2+240+1);
factor((241^5+241^4+241^3+241^2+241+1)*241^21+241^6+241^5+241^4+241^3+241^2+241+1);
factor((242^5+242^4+242^3+242^2+242+1)*242^21+242^6+242^5+242^4+242^3+242^2+242+1);
factor((246^5+246^4+246^3+246^2+246+1)*246^21+246^6+246^5+246^4+246^3+246^2+246+1);
factor((252^5+252^4+252^3+252^2+252+1)*252^21+252^6+252^5+252^4+252^3+252^2+252+1);
factor((256^5+256^4+256^3+256^2+256+1)*256^21+256^6+256^5+256^4+256^3+256^2+256+1);
factor((257^5+257^4+257^3+257^2+257+1)*257^21+257^6+257^5+257^4+257^3+257^2+257+1);
factor((265^5+265^4+265^3+265^2+265+1)*265^21+265^6+265^5+265^4+265^3+265^2+265+1);
factor((267^5+267^4+267^3+267^2+267+1)*267^21+267^6+267^5+267^4+267^3+267^2+267+1);
factor((271^5+271^4+271^3+271^2+271+1)*271^21+271^6+271^5+271^4+271^3+271^2+271+1);
factor((272^5+272^4+272^3+272^2+272+1)*272^21+272^6+272^5+272^4+272^3+272^2+272+1);
factor((284^5+284^4+284^3+284^2+284+1)*284^21+284^6+284^5+284^4+284^3+284^2+284+1);
factor((285^5+285^4+285^3+285^2+285+1)*285^21+285^6+285^5+285^4+285^3+285^2+285+1);
factor((289^5+289^4+289^3+289^2+289+1)*289^21+289^6+289^5+289^4+289^3+289^2+289+1);
factor((292^5+292^4+292^3+292^2+292+1)*292^21+292^6+292^5+292^4+292^3+292^2+292+1);
factor((294^5+294^4+294^3+294^2+294+1)*294^21+294^6+294^5+294^4+294^3+294^2+294+1);
factor((295^5+295^4+295^3+295^2+295+1)*295^21+295^6+295^5+295^4+295^3+295^2+295+1);
factor((296^5+296^4+296^3+296^2+296+1)*296^21+296^6+296^5+296^4+296^3+296^2+296+1);
実行結果をしめす。
(%i87) batch("a.bat");
read and interpret file: a.bat
2 3
4 5 6
(%i88) factor(1 + 201 + 201 + 201 + 201 + 201 + 201
2 3
4 5 21
+ (1 + 201 + 201 + 201 + 201 + 201 ) 201 )
(%o88) 5990353 27104843 118108294691941 40039057363627547634319558079867
2 3
4 5 6
(%i89) factor(1 + 206 + 206 + 206 + 206 + 206 + 206
2 3
4 5 21
+ (1 + 206 + 206 + 206 + 206 + 206 ) 206 )
(%o89) 431 869519041 3880652206823749773006990899788384290660027241013
2 3
4 5 6
(%i90) factor(1 + 207 + 207 + 207 + 207 + 207 + 207
2 3
4 5 21
+ (1 + 207 + 207 + 207 + 207 + 207 ) 207 )
(%o90) 61603 26775047170326130165490861599400645561427866927021905771
2 3
4 5 6
(%i91) factor(1 + 212 + 212 + 212 + 212 + 212 + 212
2 3
4 5 21
+ (1 + 212 + 212 + 212 + 212 + 212 ) 212 )
(%o91) 2851 23651179430544915308931936821 45492077420496054018075470363
2 3
4 5 6
(%i92) factor(1 + 215 + 215 + 215 + 215 + 215 + 215
2 3
4 5 21
+ (1 + 215 + 215 + 215 + 215 + 215 ) 215 )
(%o92) 857 987249883032451088423 5224163150606752288108481254577445631
2 3
4 5 6
(%i93) factor(1 + 216 + 216 + 216 + 216 + 216 + 216
2 3
4 5 21
+ (1 + 216 + 216 + 216 + 216 + 216 ) 216 )
(%o93) 691 282221097449090926251002069 25570857819968044869876578638967
2 3
4 5 6
(%i94) factor(1 + 217 + 217 + 217 + 217 + 217 + 217
2 3
4 5 21
+ (1 + 217 + 217 + 217 + 217 + 217 ) 217 )
(%o94) 5622883205629344162760424895688063582534164779717070447670333
素数ですね。
2 3
4 5 6
(%i95) factor(1 + 219 + 219 + 219 + 219 + 219 + 219
2 3
4 5 21
+ (1 + 219 + 219 + 219 + 219 + 219 ) 219 )
(%o95) 86208072239413 704299943098693 117551728688645920421713340929009
2 3
4 5 6
(%i96) factor(1 + 220 + 220 + 220 + 220 + 220 + 220
2 3
4 5 21
+ (1 + 220 + 220 + 220 + 220 + 220 ) 220 )
(%o96) 1230990461 6526999505342857785463038729178766030837667067928561
2 3
4 5 6
(%i97) factor(1 + 221 + 221 + 221 + 221 + 221 + 221
2 3
4 5 21
+ (1 + 221 + 221 + 221 + 221 + 221 ) 221 )
(%o97) 461 10979 15473061859 13085689110036703 8821290783221650392248106031
2 3
4 5 6
(%i98) factor(1 + 224 + 224 + 224 + 224 + 224 + 224
2 3
4 5 21
+ (1 + 224 + 224 + 224 + 224 + 224 ) 224 )
(%o98) 1061 59797 2843059 480358651 148130798213981404369552786803522817817
2 3
4 5 6
(%i99) factor(1 + 226 + 226 + 226 + 226 + 226 + 226
2 3
4 5 21
+ (1 + 226 + 226 + 226 + 226 + 226 ) 226 )
(%o99) 59 233 1831 13273190159329 17887406716699479083 2705991098267766397337
2 3
4 5 6
(%i100) factor(1 + 227 + 227 + 227 + 227 + 227 + 227
2 3
4 5 21
+ (1 + 227 + 227 + 227 + 227 + 227 ) 227 )
(%o100) 1300710807487045829119736011 13944692961991425851900194858508923
2 3
4 5 6
(%i101) factor(1 + 229 + 229 + 229 + 229 + 229 + 229
2 3
4 5 21
+ (1 + 229 + 229 + 229 + 229 + 229 ) 229 )
(%o101) 383 563445691 105577734901997487236921509932856529079190924014257
2 3
4 5 6
(%i102) factor(1 + 230 + 230 + 230 + 230 + 230 + 230
2 3
4 5 21
+ (1 + 230 + 230 + 230 + 230 + 230 ) 230 )
(%o102) 82609 208836098356599770055619 1479051016971075198217268471568961
2 3
4 5 6
(%i103) factor(1 + 231 + 231 + 231 + 231 + 231 + 231
2 3
4 5 21
+ (1 + 231 + 231 + 231 + 231 + 231 ) 231 )
(%o103) 47 14293 42518150947191626668493414097293058536279643662583613763
2 3
4 5 6
(%i104) factor(1 + 232 + 232 + 232 + 232 + 232 + 232
2 3
4 5 21
+ (1 + 232 + 232 + 232 + 232 + 232 ) 232 )
(%o104) 43987 53702179 47293662677164763 286051619996985972127142477902787
2 3
4 5 6
(%i105) factor(1 + 237 + 237 + 237 + 237 + 237 + 237
2 3
4 5 21
+ (1 + 237 + 237 + 237 + 237 + 237 ) 237 )
(%o105) 2161 228829 43005442216106621 49953871060588189 52364256726857863793
2 3
4 5 6
(%i106) factor(1 + 240 + 240 + 240 + 240 + 240 + 240
2 3
4 5 21
+ (1 + 240 + 240 + 240 + 240 + 240 ) 240 )
(%o106) 137077 562783082860591509364079252225681249496151797896013937933
2 3
4 5 6
(%i107) factor(1 + 241 + 241 + 241 + 241 + 241 + 241
2 3
4 5 21
+ (1 + 241 + 241 + 241 + 241 + 241 ) 241 )
(%o107) 3730314600690313 190180827395954425453 121153709286845779024641337
2 3
4 5 6
(%i108) factor(1 + 242 + 242 + 242 + 242 + 242 + 242
2 3
4 5 21
+ (1 + 242 + 242 + 242 + 242 + 242 ) 242 )
(%o108) 379 1753 1656500355207668648312149 86973145958840627969539276735441
2 3
4 5 6
(%i109) factor(1 + 246 + 246 + 246 + 246 + 246 + 246
2 3
4 5 21
+ (1 + 246 + 246 + 246 + 246 + 246 ) 246 )
(%o109) 331 13467201359 44674920817909 736059069915184103277227451239217323
2 3
4 5 6
(%i110) factor(1 + 252 + 252 + 252 + 252 + 252 + 252
2 3
4 5 21
+ (1 + 252 + 252 + 252 + 252 + 252 ) 252 )
(%o110) 274246364807037820897105066437026183830932641229420993806677453
素数ですね。
2 3
4 5 6
(%i111) factor(1 + 256 + 256 + 256 + 256 + 256 + 256
2 3
4 5 21
+ (1 + 256 + 256 + 256 + 256 + 256 ) 256 )
(%o111) 24016356428757515843 17196171297568705656940145664171243794229611
2 3
4 5 6
(%i112) factor(1 + 257 + 257 + 257 + 257 + 257 + 257
2 3
4 5 21
+ (1 + 257 + 257 + 257 + 257 + 257 ) 257 )
(%o112) 102574453 2755781657 1616852304162098066178867420747175558138373153
2 3
4 5 6
(%i113) factor(1 + 265 + 265 + 265 + 265 + 265 + 265
2 3
4 5 21
+ (1 + 265 + 265 + 265 + 265 + 265 ) 265 )
(%o113) 81516451561 8462296305209 1469945303589185642532417613027228200509
2 3
4 5 6
(%i114) factor(1 + 267 + 267 + 267 + 267 + 267 + 267
2 3
4 5 21
+ (1 + 267 + 267 + 267 + 267 + 267 ) 267 )
(%o114) 30089 77353783483247 529703820593303002451047401116609770966929151
2 3
4 5 6
(%i115) factor(1 + 271 + 271 + 271 + 271 + 271 + 271
2 3
4 5 21
+ (1 + 271 + 271 + 271 + 271 + 271 ) 271 )
(%o115) 491 3695945830109159476849376386697206868043225520124375656050083
2 3
4 5 6
(%i116) factor(1 + 272 + 272 + 272 + 272 + 272 + 272
2 3
4 5 21
+ (1 + 272 + 272 + 272 + 272 + 272 ) 272 )
(%o116) 2416844767055501579 826308768384102767317931562870197047381306067
2 3
4 5 6
(%i117) factor(1 + 284 + 284 + 284 + 284 + 284 + 284
2 3
4 5 21
+ (1 + 284 + 284 + 284 + 284 + 284 ) 284 )
(%o117) 37061 165535678112570341426376887283400084250929347593858493929481
2 3
4 5 6
(%i118) factor(1 + 285 + 285 + 285 + 285 + 285 + 285
2 3
4 5 21
+ (1 + 285 + 285 + 285 + 285 + 285 ) 285 )
(%o118) 59 607 10080765483043 43252508772761919910717 430474433381738349707687
2 3
4 5 6
(%i119) factor(1 + 289 + 289 + 289 + 289 + 289 + 289
2 3
4 5 21
+ (1 + 289 + 289 + 289 + 289 + 289 ) 289 )
(%o119) 211 45768513923275895936732382512220160525406815495557283289440351
2 3
4 5 6
(%i120) factor(1 + 292 + 292 + 292 + 292 + 292 + 292
2 3
4 5 21
+ (1 + 292 + 292 + 292 + 292 + 292 ) 292 )
(%o120) 68447 3801257 48546994606352439659690985245340705265458599608639027
2 3
4 5 6
(%i121) factor(1 + 294 + 294 + 294 + 294 + 294 + 294
2 3
4 5 21
+ (1 + 294 + 294 + 294 + 294 + 294 ) 294 )
(%o121) 239 3271 1143514463408757221 16872917913256666226151913082993591033119
2 3
4 5 6
(%i122) factor(1 + 295 + 295 + 295 + 295 + 295 + 295
2 3
4 5 21
+ (1 + 295 + 295 + 295 + 295 + 295 ) 295 )
(%o122) 16475822367232963477081363031059936065370785844929402767653810321
素数ですね。
2 3
4 5 6
(%i123) factor(1 + 296 + 296 + 296 + 296 + 296 + 296
2 3
4 5 21
+ (1 + 296 + 296 + 296 + 296 + 296 ) 296 )
(%o123) 1669 69383 38093557 135441130332393499 30112213112113611203133624741173
(%o123)
a.bat
b.txtについかされるものは、
431,206
857,215
691,216
461,221
59,226
233,226
383,229
47,231
379,242
331,246
491,271
59,285
607,285
211,289
239,294