多項式(x^5+x^4+x^3+x^2+
x+1)*x^27+x^6+x^5+x^4+x^3+x^2+x+1
Ver.1.000 2012.10.28
更新履歴
2012.10.28 Ver.1.000 新規作成
多項式を変える。
(%i1)
factor((x^5+x^4+x^3+x^2+x+1)*x^27+x^6+x^5+x^4+x^3+x^2+x+1);
32
31 30 29
28 27 6
5 4 3 2
(%o1) x + x + x + x +
x + x + x + x + x + x +
x + x + 1
より、
e17.batを作った。以下に示す。
for x:2
while x<20 do(
y:factor((x^5+x^4+x^3+x^2+x+1)*x^27+x^6+x^5+x^4+x^3+x^2+x+1),
print(" x=",x),
print("factor(x)=",y)
);
e17.batをmaximaで実行した。
(%i2) batch("e17.bat");
read and interpret file: e17.bat
(%i3) for x from 2 while x < 20 do (y :
2 3 4
5
6
2 3 4
5 27
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)= 239 457 77417
x= 3
factor(x)= 521 5327672715041
x= 4
factor(x)= 3877 6342443633077873
x= 5
factor(x)= 25588853 1137290827829777
x= 6
factor(x)= 6301 1371072721 1105457320543
x= 7
factor(x)= 1381 8817223187 105816858980783
x= 8
factor(x)= 137 1609 410764840280250669941177
x= 9
factor(x)= 983493780532867 3927718817925823
x= 10
factor(x)= 2301453985966843 48278610251389477
x= 11
factor(x)= 23 571 670560299 263728207916434797079
x= 12
factor(x)= 823 1559 45263 642094578909175923266371
x= 13
factor(x)= 1039 230523195239 2002714821514210137101
x= 14
factor(x)= 13 470711885144359219 834801558174438013
x= 15
factor(x)= 149 18211 19290679 883112227246586246890361
x= 16
factor(x)= 109 557 5978420378080984036353847265827241
x= 17
factor(x)= 151 1229 6213391 1749821783419 1246932865744331
x= 18
factor(x)= 43 101 397 1489 15647 388720654975560377122945507
x= 19
factor(x)= 37 4045001803 650597723202359 901910274482969
(%o3)
done
(%o3)
e17.bat
(%i4)
これより、b.txtは、以下のようになった。
239,2
457,2
521,3
137,8
23,11
571,11
823,12
13,14
149,15
109,16
557,16
151,17
43,18
101,18
397,18
37,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^27+%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
239n+2
457n+2
521n+3
137n+8
23n+11
571n+11
823n+12
13n+14
149n+15
109n+16
557n+16
151n+17
43n+18
101n+18
397n+18
37n+19
b.txt read! 16 個
$gcc
-Wall
hajiku-6.c -o hajiku-6
$./hajiku-6
!!! 1 !!!
2=239x0+2
2=457x0+2
3=521x0+3
!!! 4 !!!
!!! 5 !!!
!!! 6 !!!
!!! 7 !!!
8=137x0+8
!!! 9 !!!
!!! 10 !!!
11=23x0+11
11=571x0+11
12=823x0+12
!!! 13 !!!
14=13x0+14
15=149x0+15
16=109x0+16
16=557x0+16
17=151x0+17
18=43x0+18
18=101x0+18
18=397x0+18
19=37x0+19
!!! 20 !!!
!!! 21 !!!
!!! 22 !!!
!!! 23 !!!
!!! 24 !!!
!!! 25 !!!
!!! 26 !!!
27=13x1+14
!!! 28 !!!
!!! 29 !!!
!!! 30 !!!
!!! 31 !!!
!!! 32 !!!
!!! 33 !!!
34=23x1+11
!!! 35 !!!
!!! 36 !!!
!!! 37 !!!
!!! 38 !!!
!!! 39 !!!
40=13x2+14
!!! 41 !!!
!!! 42 !!!
!!! 43 !!!
!!! 44 !!!
!!! 45 !!!
!!! 46 !!!
!!! 47 !!!
!!! 48 !!!
!!! 49 !!!
!!! 50 !!!
!!! 51 !!!
!!! 52 !!!
53=13x3+14
!!! 54 !!!
!!! 55 !!!
56=37x1+19
57=23x2+11
!!! 58 !!!
!!! 59 !!!
!!! 60 !!!
61=43x1+18
!!! 62 !!!
!!! 63 !!!
!!! 64 !!!
!!! 65 !!!
66=13x4+14
!!! 67 !!!
!!! 68 !!!
!!! 69 !!!
!!! 70 !!!
!!! 71 !!!
!!! 72 !!!
!!! 73 !!!
!!! 74 !!!
!!! 75 !!!
!!! 76 !!!
!!! 77 !!!
!!! 78 !!!
79=13x5+14
80=23x3+11
!!! 81 !!!
!!! 82 !!!
!!! 83 !!!
!!! 84 !!!
!!! 85 !!!
!!! 86 !!!
!!! 87 !!!
!!! 88 !!!
!!! 89 !!!
!!! 90 !!!
!!! 91 !!!
92=13x6+14
93=37x2+19
!!! 94 !!!
!!! 95 !!!
!!! 96 !!!
!!! 97 !!!
!!! 98 !!!
!!! 99 !!!
!!! 100 !!!
生成されたa.batは、
factor((1^5+1^4+1^3+1^2+1+1)*1^27+1^6+1^5+1^4+1^3+1^2+1+1);
factor((4^5+4^4+4^3+4^2+4+1)*4^27+4^6+4^5+4^4+4^3+4^2+4+1);
factor((5^5+5^4+5^3+5^2+5+1)*5^27+5^6+5^5+5^4+5^3+5^2+5+1);
factor((6^5+6^4+6^3+6^2+6+1)*6^27+6^6+6^5+6^4+6^3+6^2+6+1);
factor((7^5+7^4+7^3+7^2+7+1)*7^27+7^6+7^5+7^4+7^3+7^2+7+1);
factor((9^5+9^4+9^3+9^2+9+1)*9^27+9^6+9^5+9^4+9^3+9^2+9+1);
factor((10^5+10^4+10^3+10^2+10+1)*10^27+10^6+10^5+10^4+10^3+10^2+10+1);
factor((13^5+13^4+13^3+13^2+13+1)*13^27+13^6+13^5+13^4+13^3+13^2+13+1);
factor((20^5+20^4+20^3+20^2+20+1)*20^27+20^6+20^5+20^4+20^3+20^2+20+1);
factor((21^5+21^4+21^3+21^2+21+1)*21^27+21^6+21^5+21^4+21^3+21^2+21+1);
factor((22^5+22^4+22^3+22^2+22+1)*22^27+22^6+22^5+22^4+22^3+22^2+22+1);
factor((23^5+23^4+23^3+23^2+23+1)*23^27+23^6+23^5+23^4+23^3+23^2+23+1);
factor((24^5+24^4+24^3+24^2+24+1)*24^27+24^6+24^5+24^4+24^3+24^2+24+1);
factor((25^5+25^4+25^3+25^2+25+1)*25^27+25^6+25^5+25^4+25^3+25^2+25+1);
factor((26^5+26^4+26^3+26^2+26+1)*26^27+26^6+26^5+26^4+26^3+26^2+26+1);
factor((28^5+28^4+28^3+28^2+28+1)*28^27+28^6+28^5+28^4+28^3+28^2+28+1);
factor((29^5+29^4+29^3+29^2+29+1)*29^27+29^6+29^5+29^4+29^3+29^2+29+1);
factor((30^5+30^4+30^3+30^2+30+1)*30^27+30^6+30^5+30^4+30^3+30^2+30+1);
factor((31^5+31^4+31^3+31^2+31+1)*31^27+31^6+31^5+31^4+31^3+31^2+31+1);
factor((32^5+32^4+32^3+32^2+32+1)*32^27+32^6+32^5+32^4+32^3+32^2+32+1);
factor((33^5+33^4+33^3+33^2+33+1)*33^27+33^6+33^5+33^4+33^3+33^2+33+1);
factor((35^5+35^4+35^3+35^2+35+1)*35^27+35^6+35^5+35^4+35^3+35^2+35+1);
factor((36^5+36^4+36^3+36^2+36+1)*36^27+36^6+36^5+36^4+36^3+36^2+36+1);
factor((37^5+37^4+37^3+37^2+37+1)*37^27+37^6+37^5+37^4+37^3+37^2+37+1);
factor((38^5+38^4+38^3+38^2+38+1)*38^27+38^6+38^5+38^4+38^3+38^2+38+1);
factor((39^5+39^4+39^3+39^2+39+1)*39^27+39^6+39^5+39^4+39^3+39^2+39+1);
factor((41^5+41^4+41^3+41^2+41+1)*41^27+41^6+41^5+41^4+41^3+41^2+41+1);
factor((42^5+42^4+42^3+42^2+42+1)*42^27+42^6+42^5+42^4+42^3+42^2+42+1);
factor((43^5+43^4+43^3+43^2+43+1)*43^27+43^6+43^5+43^4+43^3+43^2+43+1);
factor((44^5+44^4+44^3+44^2+44+1)*44^27+44^6+44^5+44^4+44^3+44^2+44+1);
factor((45^5+45^4+45^3+45^2+45+1)*45^27+45^6+45^5+45^4+45^3+45^2+45+1);
factor((46^5+46^4+46^3+46^2+46+1)*46^27+46^6+46^5+46^4+46^3+46^2+46+1);
factor((47^5+47^4+47^3+47^2+47+1)*47^27+47^6+47^5+47^4+47^3+47^2+47+1);
factor((48^5+48^4+48^3+48^2+48+1)*48^27+48^6+48^5+48^4+48^3+48^2+48+1);
factor((49^5+49^4+49^3+49^2+49+1)*49^27+49^6+49^5+49^4+49^3+49^2+49+1);
factor((50^5+50^4+50^3+50^2+50+1)*50^27+50^6+50^5+50^4+50^3+50^2+50+1);
factor((51^5+51^4+51^3+51^2+51+1)*51^27+51^6+51^5+51^4+51^3+51^2+51+1);
factor((52^5+52^4+52^3+52^2+52+1)*52^27+52^6+52^5+52^4+52^3+52^2+52+1);
factor((54^5+54^4+54^3+54^2+54+1)*54^27+54^6+54^5+54^4+54^3+54^2+54+1);
factor((55^5+55^4+55^3+55^2+55+1)*55^27+55^6+55^5+55^4+55^3+55^2+55+1);
factor((58^5+58^4+58^3+58^2+58+1)*58^27+58^6+58^5+58^4+58^3+58^2+58+1);
factor((59^5+59^4+59^3+59^2+59+1)*59^27+59^6+59^5+59^4+59^3+59^2+59+1);
factor((60^5+60^4+60^3+60^2+60+1)*60^27+60^6+60^5+60^4+60^3+60^2+60+1);
factor((62^5+62^4+62^3+62^2+62+1)*62^27+62^6+62^5+62^4+62^3+62^2+62+1);
factor((63^5+63^4+63^3+63^2+63+1)*63^27+63^6+63^5+63^4+63^3+63^2+63+1);
factor((64^5+64^4+64^3+64^2+64+1)*64^27+64^6+64^5+64^4+64^3+64^2+64+1);
factor((65^5+65^4+65^3+65^2+65+1)*65^27+65^6+65^5+65^4+65^3+65^2+65+1);
factor((67^5+67^4+67^3+67^2+67+1)*67^27+67^6+67^5+67^4+67^3+67^2+67+1);
factor((68^5+68^4+68^3+68^2+68+1)*68^27+68^6+68^5+68^4+68^3+68^2+68+1);
factor((69^5+69^4+69^3+69^2+69+1)*69^27+69^6+69^5+69^4+69^3+69^2+69+1);
factor((70^5+70^4+70^3+70^2+70+1)*70^27+70^6+70^5+70^4+70^3+70^2+70+1);
factor((71^5+71^4+71^3+71^2+71+1)*71^27+71^6+71^5+71^4+71^3+71^2+71+1);
factor((72^5+72^4+72^3+72^2+72+1)*72^27+72^6+72^5+72^4+72^3+72^2+72+1);
factor((73^5+73^4+73^3+73^2+73+1)*73^27+73^6+73^5+73^4+73^3+73^2+73+1);
factor((74^5+74^4+74^3+74^2+74+1)*74^27+74^6+74^5+74^4+74^3+74^2+74+1);
factor((75^5+75^4+75^3+75^2+75+1)*75^27+75^6+75^5+75^4+75^3+75^2+75+1);
factor((76^5+76^4+76^3+76^2+76+1)*76^27+76^6+76^5+76^4+76^3+76^2+76+1);
factor((77^5+77^4+77^3+77^2+77+1)*77^27+77^6+77^5+77^4+77^3+77^2+77+1);
factor((78^5+78^4+78^3+78^2+78+1)*78^27+78^6+78^5+78^4+78^3+78^2+78+1);
factor((81^5+81^4+81^3+81^2+81+1)*81^27+81^6+81^5+81^4+81^3+81^2+81+1);
factor((82^5+82^4+82^3+82^2+82+1)*82^27+82^6+82^5+82^4+82^3+82^2+82+1);
factor((83^5+83^4+83^3+83^2+83+1)*83^27+83^6+83^5+83^4+83^3+83^2+83+1);
factor((84^5+84^4+84^3+84^2+84+1)*84^27+84^6+84^5+84^4+84^3+84^2+84+1);
factor((85^5+85^4+85^3+85^2+85+1)*85^27+85^6+85^5+85^4+85^3+85^2+85+1);
factor((86^5+86^4+86^3+86^2+86+1)*86^27+86^6+86^5+86^4+86^3+86^2+86+1);
factor((87^5+87^4+87^3+87^2+87+1)*87^27+87^6+87^5+87^4+87^3+87^2+87+1);
factor((88^5+88^4+88^3+88^2+88+1)*88^27+88^6+88^5+88^4+88^3+88^2+88+1);
factor((89^5+89^4+89^3+89^2+89+1)*89^27+89^6+89^5+89^4+89^3+89^2+89+1);
factor((90^5+90^4+90^3+90^2+90+1)*90^27+90^6+90^5+90^4+90^3+90^2+90+1);
factor((91^5+91^4+91^3+91^2+91+1)*91^27+91^6+91^5+91^4+91^3+91^2+91+1);
factor((94^5+94^4+94^3+94^2+94+1)*94^27+94^6+94^5+94^4+94^3+94^2+94+1);
factor((95^5+95^4+95^3+95^2+95+1)*95^27+95^6+95^5+95^4+95^3+95^2+95+1);
factor((96^5+96^4+96^3+96^2+96+1)*96^27+96^6+96^5+96^4+96^3+96^2+96+1);
factor((97^5+97^4+97^3+97^2+97+1)*97^27+97^6+97^5+97^4+97^3+97^2+97+1);
factor((98^5+98^4+98^3+98^2+98+1)*98^27+98^6+98^5+98^4+98^3+98^2+98+1);
factor((99^5+99^4+99^3+99^2+99+1)*99^27+99^6+99^5+99^4+99^3+99^2+99+1);
factor((100^5+100^4+100^3+100^2+100+1)*100^27+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 27
(%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 27
(%i7) factor(1 + 4 + 4 + 4 + 4 + 4 + 4 +
(1 + 4 + 4 + 4 + 4 + 4 ) 4 )
(%o7)
3877 6342443633077873
2 3 4
5
6
2 3 4
5 27
(%i8) factor(1 + 5 + 5 + 5 + 5 + 5 + 5 +
(1 + 5 + 5 + 5 + 5 + 5 ) 5 )
(%o8)
25588853 1137290827829777
2 3 4
5
6
2 3 4
5 27
(%i9) factor(1 + 6 + 6 + 6 + 6 + 6 + 6 +
(1 + 6 + 6 + 6 + 6 + 6 ) 6 )
(%o9)
6301 1371072721 1105457320543
2 3 4
5
6
2 3 4
5 27
(%i10) factor(1 + 7 + 7 + 7 + 7 + 7 + 7 +
(1 + 7 + 7 + 7 + 7 + 7 ) 7 )
(%o10)
1381 8817223187 105816858980783
2 3 4
5
6
2 3 4
5 27
(%i11) factor(1 + 9 + 9 + 9 + 9 + 9 + 9 +
(1 + 9 + 9 + 9 + 9 + 9 ) 9 )
(%o11)
983493780532867 3927718817925823
2 3
4 5 6
(%i12) factor(1 + 10 + 10 + 10 + 10 + 10 + 10
2 3
4 5 27
+ (1 + 10 + 10 + 10 + 10 + 10 ) 10 )
(%o12)
2301453985966843 48278610251389477
2 3
4 5 6
(%i13) factor(1 + 13 + 13 + 13 + 13 + 13 + 13
2 3
4 5 27
+ (1 + 13 + 13 + 13 + 13 + 13 ) 13 )
(%o13)
1039 230523195239 2002714821514210137101
2 3
4 5 6
(%i14) factor(1 + 20 + 20 + 20 + 20 + 20 + 20
2 3
4 5 27
+ (1 + 20 + 20 + 20 + 20 + 20 ) 20 )
(%o14) 61547
59500741 953910917 129419335888026870919
2 3
4 5 6
(%i15) factor(1 + 21 + 21 + 21 + 21 + 21 + 21
2 3
4 5 27
+ (1 + 21 + 21 + 21 + 21 + 21 ) 21 )
(%o15) 61 1233107
1081026989299 26426496516934196785601
2 3
4 5 6
(%i16) factor(1 + 22 + 22 + 22 + 22 + 22 + 22
2 3
4 5 27
+ (1 + 22 + 22 + 22 + 22 + 22 ) 22 )
素数ですね。
(%o16)
9500121695063921020625368223879627116145731
2 3
4 5 6
(%i17) factor(1 + 23 + 23 + 23 + 23 + 23 + 23
2 3
4 5 27
+ (1 + 23 + 23 + 23 + 23 + 23 ) 23 )
素数ですね。
(%o17)
39318406177214890380559461608951704851162481
2 3
4 5 6
(%i18) factor(1 + 24 + 24 + 24 + 24 + 24 + 24
2 3
4 5 27
+ (1 + 24 + 24 + 24 + 24 + 24 ) 24 )
(%o18) 3373663781779
4263968175167 10649455050996280157
2 3
4 5 6
(%i19) factor(1 + 25 + 25 + 25 + 25 + 25 + 25
2 3
4 5 27
+ (1 + 25 + 25 + 25 + 25 + 25 ) 25 )
(%o19) 15971 10040491 16451161
600546049 356433992366345669
2 3
4 5 6
(%i20) factor(1 + 26 + 26 + 26 + 26 + 26 + 26
2 3
4 5 27
+ (1 + 26 + 26 + 26 + 26 + 26 ) 26 )
(%o20) 2179 17982409 1337757053
770302939963 48982005948347
2 3
4 5 6
(%i21) factor(1 + 28 + 28 + 28 + 28 + 28 + 28
2 3
4 5 27
+ (1 + 28 + 28 + 28 + 28 + 28 ) 28 )
(%o21) 187136425591337
112899739349941995025774810441253
2 3
4 5 6
(%i22) factor(1 + 29 + 29 + 29 + 29 + 29 + 29
2 3
4 5 27
+ (1 + 29 + 29 + 29 + 29 + 29 ) 29 )
(%o22) 31973 22643572199
265231284107 337771359430785128789
2 3
4 5 6
(%i23) factor(1 + 30 + 30 + 30 + 30 + 30 + 30
2 3
4 5 27
+ (1 + 30 + 30 + 30 + 30 + 30 ) 30 )
(%o23) 739
8191696780281008704561 31665408903555627071689
2 3
4 5 6
(%i24) factor(1 + 31 + 31 + 31 + 31 + 31 + 31
2 3
4 5 27
+ (1 + 31 + 31 + 31 + 31 + 31 ) 31 )
(%o24) 7603
71916683419449849504146576316841346520104251
2 3
4 5 6
(%i25) factor(1 + 32 + 32 + 32 + 32 + 32 + 32
2 3
4 5 27
+ (1 + 32 + 32 + 32 + 32 + 32 ) 32 )
(%o25) 1117
1350623858579511664788684879533575154583356053
2 3
4 5 6
(%i26) factor(1 + 33 + 33 + 33 + 33 + 33 + 33
2 3
4 5 27
+ (1 + 33 + 33 + 33 + 33 + 33 ) 33 )
(%o26) 1889
2135886050618539721822392510495219619981253869
2 3
4 5 6
(%i27) factor(1 + 35 + 35 + 35 + 35 + 35 + 35
2 3
4 5 27
+ (1 + 35 + 35 + 35 + 35 + 35 ) 35 )
(%o27) 42144863
628090030270508528355614957449151199707447
2 3
4 5 6
(%i28) factor(1 + 36 + 36 + 36 + 36 + 36 + 36
2 3
4 5 27
+ (1 + 36 + 36 + 36 + 36 + 36 ) 36 )
(%o28) 13195393 10536027449 106608559111
4395650805548224531259
2 3
4 5 6
(%i29) factor(1 + 37 + 37 + 37 + 37 + 37 + 37
2 3
4 5 27
+ (1 + 37 + 37 + 37 + 37 + 37 ) 37 )
(%o29) 433 2727749797
132453050468317148669369113622519421361
2 3
4 5 6
(%i30) factor(1 + 38 + 38 + 38 + 38 + 38 + 38
2 3
4 5 27
+ (1 + 38 + 38 + 38 + 38 + 38 ) 38 )
(%o30) 57301 103426951453033433
61924290458168849287714488287
2 3
4 5 6
(%i31) factor(1 + 39 + 39 + 39 + 39 + 39 + 39
2 3
4 5 27
+ (1 + 39 + 39 + 39 + 39 + 39 ) 39 )
(%o31) 41299 640043 99046981510951577
321631445248650922728649
2 3
4 5 6
(%i32) factor(1 + 41 + 41 + 41 + 41 + 41 + 41
2 3
4 5 27
+ (1 + 41 + 41 + 41 + 41 + 41 ) 41 )
(%o32) 227436066540961
18320948107530783814037965055139746653
2 3
4 5 6
(%i33) factor(1 + 42 + 42 + 42 + 42 + 42 + 42
2 3
4 5 27
+ (1 + 42 + 42 + 42 + 42 + 42 ) 42 )
(%o33) 271 131267 19376923057
13062703245789942061425006118130579
2 3
4 5 6
(%i34) factor(1 + 43 + 43 + 43 + 43 + 43 + 43
2 3
4 5 27
+ (1 + 43 + 43 + 43 + 43 + 43 ) 43 )
(%o34) 20629240247279500913
926246350845376413558059633567177
2 3
4 5 6
(%i35) factor(1 + 44 + 44 + 44 + 44 + 44 + 44
2 3
4 5 27
+ (1 + 44 + 44 + 44 + 44 + 44 ) 44 )
(%o35) 123547 122583733 32709262339679556599
80451486237390019469
2 3
4 5 6
(%i36) factor(1 + 45 + 45 + 45 + 45 + 45 + 45
2 3
4 5 27
+ (1 + 45 + 45 + 45 + 45 + 45 ) 45 )
素数ですね。
(%o36)
81763651420190393781115041620648458600044258980768821
2 3
4 5 6
(%i37) factor(1 + 46 + 46 + 46 + 46 + 46 + 46
2 3
4 5 27
+ (1 + 46 + 46 + 46 + 46 + 46 ) 46 )
(%o37) 1877 1924450428058031
45711442930169756657966254148497729
2 3
4 5 6
(%i38) factor(1 + 47 + 47 + 47 + 47 + 47 + 47
2 3
4 5 27
+ (1 + 47 + 47 + 47 + 47 + 47 ) 47 )
(%o38) 15455567891656687229
21251349460862912166459280293563189
2 3
4 5 6
(%i39) factor(1 + 48 + 48 + 48 + 48 + 48 + 48
2 3
4 5 27
+ (1 + 48 + 48 + 48 + 48 + 48 ) 48 )
(%o39) 131 229 43391 104256979
4745165911859950872041054657475230971
2 3
4 5 6
(%i40) factor(1 + 49 + 49 + 49 + 49 + 49 + 49
2 3
4 5 27
+ (1 + 49 + 49 + 49 + 49 + 49 ) 49 )
(%o40) 5119 2074180627 25263773196515591
4641939614326878804361847
2 3
4 5 6
(%i41) factor(1 + 50 + 50 + 50 + 50 + 50 + 50
2 3
4 5 27
+ (1 + 50 + 50 + 50 + 50 + 50 ) 50 )
(%o41) 827
2872820912061896549026507708585247883917775109968413
2 3
4 5 6
(%i42) factor(1 + 51 + 51 + 51 + 51 + 51 + 51
2 3
4 5 27
+ (1 + 51 + 51 + 51 + 51 + 51 ) 51 )
(%o42) 71 97 937 151849
4567348985456611434952034942715379504792223
2 3
4 5 6
(%i43) factor(1 + 52 + 52 + 52 + 52 + 52 + 52
2 3
4 5 27
+ (1 + 52 + 52 + 52 + 52 + 52 ) 52 )
(%o43) 67 41143 1358134739383430696251
2224469970705444566160672211
2 3
4 5 6
(%i44) factor(1 + 54 + 54 + 54 + 54 + 54 + 54
2 3
4 5 27
+ (1 + 54 + 54 + 54 + 54 + 54 ) 54 )
(%o44) 113 11568957373
21298329430957945442402062825297582824491279
2 3
4 5 6
(%i45) factor(1 + 55 + 55 + 55 + 55 + 55 + 55
2 3
4 5 27
+ (1 + 55 + 55 + 55 + 55 + 55 ) 55 )
素数ですね。
(%o45)
50069700484700364096801133543565967500209808377802620081
2 3
4 5 6
(%i46) factor(1 + 58 + 58 + 58 + 58 + 58 + 58
2 3
4 5 27
+ (1 + 58 + 58 + 58 + 58 + 58 ) 58 )
(%o46) 79 8183011 39178577219
10805877632418069655936512357067700081
2 3
4 5 6
(%i47) factor(1 + 59 + 59 + 59 + 59 + 59 + 59
2 3
4 5 27
+ (1 + 59 + 59 + 59 + 59 + 59 ) 59 )
素数ですね。
(%o47)
472811891328753200562652723196879876401907196118137585241
2 3
4 5 6
(%i48) factor(1 + 60 + 60 + 60 + 60 + 60 + 60
2 3
4 5 27
+ (1 + 60 + 60 + 60 + 60 + 60 ) 60 )
(%o48) 29816863
27144215912178488256326713085008305535025599441747
2 3
4 5 6
(%i49) factor(1 + 62 + 62 + 62 + 62 + 62 + 62
2 3
4 5 27
+ (1 + 62 + 62 + 62 + 62 + 62 ) 62 )
(%o49) 180149069676892578117007
12822239799684445402709543675593573
2 3
4 5 6
(%i50) factor(1 + 63 + 63 + 63 + 63 + 63 + 63
2 3
4 5 27
+ (1 + 63 + 63 + 63 + 63 + 63 ) 63 )
(%o50) 103 12890991292088443
2902170362649794468610871820060011352149
2 3
4 5 6
(%i51) factor(1 + 64 + 64 + 64 + 64 + 64 + 64
2 3
4 5 27
+ (1 + 64 + 64 + 64 + 64 + 64 ) 64 )
(%o51) 2950151 30108846983192513
71789383214378823151411208919643447
2 3
4 5 6
(%i52) factor(1 + 65 + 65 + 65 + 65 + 65 + 65
2 3
4 5 27
+ (1 + 65 + 65 + 65 + 65 + 65 ) 65 )
(%o52) 103
101653788891456182086016464167689126051600696971859219947
2 3
4 5 6
(%i53) factor(1 + 67 + 67 + 67 + 67 + 67 + 67
2 3
4 5 27
+ (1 + 67 + 67 + 67 + 67 + 67 ) 67 )
(%o53) 71
388746243002548143201156645378675011750683999798969713551
2 3
4 5 6
(%i54) factor(1 + 68 + 68 + 68 + 68 + 68 + 68
2 3
4 5 27
+ (1 + 68 + 68 + 68 + 68 + 68 ) 68 )
(%o54) 9293 20490243042573147538511
232817847504031851138190557305287
2 3
4 5 6
(%i55) factor(1 + 69 + 69 + 69 + 69 + 69 + 69
2 3
4 5 27
+ (1 + 69 + 69 + 69 + 69 + 69 ) 69 )
(%o55) 1398289 3623769600237961 339061806804885869 41159936027310664481
2 3
4 5 6
(%i56) factor(1 + 70 + 70 + 70 + 70 + 70 + 70
2 3
4 5 27
+ (1 + 70 + 70 + 70 + 70 + 70 ) 70 )
(%o56) 28429 18523878388241
212761344016151301626131725930356158932239
2 3
4 5 6
(%i57) factor(1 + 71 + 71 + 71 + 71 + 71 + 71
2 3
4 5 27
+ (1 + 71 + 71 + 71 + 71 + 71 ) 71 )
(%o57) 157 199 52204027069 60135011392280795543
1798222117874265938527433
2 3
4 5 6
(%i58) factor(1 + 72 + 72 + 72 + 72 + 72 + 72
2 3
4 5 27
+ (1 + 72 + 72 + 72 + 72 + 72 ) 72 )
(%o58) 178067 248389 3056649203 12313168949 535891854371
309247102093619251
2 3
4 5 6
(%i59) factor(1 + 73 + 73 + 73 + 73 + 73 + 73
2 3
4 5 27
+ (1 + 73 + 73 + 73 + 73 + 73 ) 73 )
(%o59) 2699 500177
317683958494708342600609110606058742767987203572647
2 3
4 5 6
(%i60) factor(1 + 74 + 74 + 74 + 74 + 74 + 74
2 3
4 5 27
+ (1 + 74 + 74 + 74 + 74 + 74 ) 74 )
(%o60) 5099 328442482274704481 7371919762613639479 53678324775796960051
2 3
4 5 6
(%i61) factor(1 + 75 + 75 + 75 + 75 + 75 + 75
2 3
4 5 27
+ (1 + 75 + 75 + 75 + 75 + 75 ) 75 )
(%o61) 531545576885923
1915355810671190025283891067097576838378942387
2 3
4 5 6
(%i62) factor(1 + 76 + 76 + 76 + 76 + 76 + 76
2 3
4 5 27
+ (1 + 76 + 76 + 76 + 76 + 76 ) 76 )
(%o62) 8443 26423 165287 43998733184406478420303
958582504485720839017897
2 3
4 5 6
(%i63) factor(1 + 77 + 77 + 77 + 77 + 77 + 77
2 3
4 5 27
+ (1 + 77 + 77 + 77 + 77 + 77 ) 77 )
(%o63) 133244538881 13135980291905265241 1349796917461014269303472871421
2 3
4 5 6
(%i64) factor(1 + 78 + 78 + 78 + 78 + 78 + 78
2 3
4 5 27
+ (1 + 78 + 78 + 78 + 78 + 78 ) 78 )
(%o64) 157649 795306437 1430738291
19899641176354202670021293778298592117
2 3
4 5 6
(%i65) factor(1 + 81 + 81 + 81 + 81 + 81 + 81
2 3
4 5 27
+ (1 + 81 + 81 + 81 + 81 + 81 ) 81 )
(%o65) 108233 4150242313543 26575563731112206372416502533552343297147987
2 3
4 5 6
(%i66) factor(1 + 82 + 82 + 82 + 82 + 82 + 82
2 3
4 5 27
+ (1 + 82 + 82 + 82 + 82 + 82 ) 82 )
(%o66) 61 1103 14914799
17613649802747887636885362114732205169196394588603
2 3
4 5 6
(%i67) factor(1 + 83 + 83 + 83 + 83 + 83 + 83
2 3
4 5 27
+ (1 + 83 + 83 + 83 + 83 + 83 ) 83 )
(%o67) 881173
29559835613080540601635188587302297277961962090642729317
2 3
4 5 6
(%i68) factor(1 + 84 + 84 + 84 + 84 + 84 + 84
2 3
4 5 27
+ (1 + 84 + 84 + 84 + 84 + 84 ) 84 )
(%o68) 23781127 47541880986496345107649 33793218386876883777739472022067
2 3
4 5 6
(%i69) factor(1 + 85 + 85 + 85 + 85 + 85 + 85
2 3
4 5 27
+ (1 + 85 + 85 + 85 + 85 + 85 ) 85 )
(%o69) 2023163 32567537 2605591124561537186111
324954987571213875712382321
2 3
4 5 6
(%i70) factor(1 + 86 + 86 + 86 + 86 + 86 + 86
2 3
4 5 27
+ (1 + 86 + 86 + 86 + 86 + 86 ) 86 )
(%o70)
81101701423575551361088240566373463892345972799456672681037443
2 3
4 5 6
(%i71) factor(1 + 87 + 87 + 87 + 87 + 87 + 87
2 3
4 5 27
+ (1 + 87 + 87 + 87 + 87 + 87 ) 87 )
(%o71) 18301 68360361227 6419695094117 45190434904148297
323442282209145707
2 3
4 5 6
(%i72) factor(1 + 88 + 88 + 88 + 88 + 88 + 88
2 3
4 5 27
+ (1 + 88 + 88 + 88 + 88 + 88 ) 88 )
(%o72) 273451255722424592288765363 618769653453025018617266571863809667
2 3
4 5 6
(%i73) factor(1 + 89 + 89 + 89 + 89 + 89 + 89
2 3
4 5 27
+ (1 + 89 + 89 + 89 + 89 + 89 ) 89 )
(%o73) 149 1630051323433833178152086053920411504986404779945311220781289
2 3
4 5 6
(%i74) factor(1 + 90 + 90 + 90 + 90 + 90 + 90
2 3
4 5 27
+ (1 + 90 + 90 + 90 + 90 + 90 ) 90 )
(%o74) 4899547 62621106255029854209709
1131712574122881121734566785069417
2 3
4 5 6
(%i75) factor(1 + 91 + 91 + 91 + 91 + 91 + 91
2 3
4 5 27
+ (1 + 91 + 91 + 91 + 91 + 91 ) 91 )
(%o75) 344969 79399601 5013879833
3600403094670656294487319083319365931529
2 3
4 5 6
(%i76) factor(1 + 94 + 94 + 94 + 94 + 94 + 94
2 3
4 5 27
+ (1 + 94 + 94 + 94 + 94 + 94 ) 94 )
(%o76) 632189 2640227 440441876731
1898276244109048325095160835933166643767
2 3
4 5 6
(%i77) factor(1 + 95 + 95 + 95 + 95 + 95 + 95
2 3
4 5 27
+ (1 + 95 + 95 + 95 + 95 + 95 ) 95 )
(%o77) 89839993 426038654105687417
51148441763745915301630083670624381841
2 3
4 5 6
(%i78) factor(1 + 96 + 96 + 96 + 96 + 96 + 96
2 3
4 5 27
+ (1 + 96 + 96 + 96 + 96 + 96 ) 96 )
(%o78) 1051 2531 10199042657
100872507249927285529111900620167189357249303569
2 3
4 5 6
(%i79) factor(1 + 97 + 97 + 97 + 97 + 97 + 97
2 3
4 5 27
+ (1 + 97 + 97 + 97 + 97 + 97 ) 97 )
(%o79) 6701 38183 8713450454129 192858266141779576769
8866616163992142890407
2 3
4 5 6
(%i80) factor(1 + 98 + 98 + 98 + 98 + 98 + 98
2 3
4 5 27
+ (1 + 98 + 98 + 98 + 98 + 98 ) 98 )
(%o80) 229424158975067729
23070107342473412187638078874942526204834901039
2 3
4 5 6
(%i81) factor(1 + 99 + 99 + 99 + 99 + 99 + 99
2 3
4 5 27
+ (1 + 99 + 99 + 99 + 99 + 99 ) 99 )
(%o81) 2605240874393 359359985183219
7822719284479314135805248797178658603
2 3
4 5 6
(%i82) factor(1 + 100 + 100 + 100 + 100 + 100 +
100
2 3
4 5 27
+ (1 + 100 + 100 + 100 + 100 + 100 ) 100 )
(%o82) 1087 3851 3370043 1514549929012675102613809
472762156981855375162593379
(%o82)
a.bat
b.txtに追加されるものは、
61,21
739,30
433,37
271,42
131,48
827,50
71,51
97,51
937,51
67,52
113,54
79,58
103,63
103,65
71,67
157,71
61,82
149,89
これより、Autohajiku.cの
#define max 1 /* この数から+100まで生成する
*/
を
#define max 100 /*
この数から+100まで生成する */
になおして、
Autohajiku.cをコンパイル実行する。
$gcc
-Wall Autohajiku.c -o Autohajiku
$./Autohajiku
239n+2
457n+2
521n+3
137n+8
23n+11
571n+11
823n+12
13n+14
149n+15
109n+16
557n+16
151n+17
43n+18
101n+18
397n+18
37n+19
61n+21
739n+30
433n+37
271n+42
131n+48
827n+50
71n+51
97n+51
937n+51
67n+52
113n+54
79n+58
103n+63
103n+65
71n+67
157n+71
61n+82
149n+89
b.txt read! 34 個
$gcc
-Wall hajiku-6.c -o hajiku-6
$./hajiku-6
!!! 100 !!!
!!! 101 !!!
!!! 102 !!!
103=23x4+11
104=43x2+18
105=13x7+14
!!! 106 !!!
!!! 107 !!!
!!! 108 !!!
!!! 109 !!!
!!! 110 !!!
!!! 111 !!!
!!! 112 !!!
!!! 113 !!!
!!! 114 !!!
!!! 115 !!!
!!! 116 !!!
!!! 117 !!!
118=13x8+14
119=101x1+18
119=67x1+52
!!! 120 !!!
!!! 121 !!!
122=71x1+51
!!! 123 !!!
!!! 124 !!!
125=109x1+16
126=23x5+11
!!! 127 !!!
!!! 128 !!!
!!! 129 !!!
130=37x3+19
131=13x9+14
!!! 132 !!!
!!! 133 !!!
!!! 134 !!!
!!! 135 !!!
!!! 136 !!!
137=79x1+58
138=71x1+67
!!! 139 !!!
!!! 140 !!!
!!! 141 !!!
!!! 142 !!!
143=61x2+21
143=61x1+82
144=13x10+14
145=137x1+8
!!! 146 !!!
147=43x3+18
148=97x1+51
149=23x6+11
!!! 150 !!!
!!! 151 !!!
!!! 152 !!!
!!! 153 !!!
!!! 154 !!!
!!! 155 !!!
!!! 156 !!!
157=13x11+14
!!! 158 !!!
!!! 159 !!!
!!! 160 !!!
!!! 161 !!!
!!! 162 !!!
!!! 163 !!!
164=149x1+15
!!! 165 !!!
166=103x1+63
167=37x4+19
167=113x1+54
168=151x1+17
168=103x1+65
!!! 169 !!!
170=13x12+14
!!! 171 !!!
172=23x7+11
!!! 173 !!!
!!! 174 !!!
!!! 175 !!!
!!! 176 !!!
!!! 177 !!!
!!! 178 !!!
179=131x1+48
!!! 180 !!!
!!! 181 !!!
!!! 182 !!!
183=13x13+14
!!! 184 !!!
!!! 185 !!!
186=67x2+52
!!! 187 !!!
!!! 188 !!!
!!! 189 !!!
190=43x4+18
!!! 191 !!!
!!! 192 !!!
193=71x2+51
!!! 194 !!!
195=23x8+11
196=13x14+14
!!! 197 !!!
!!! 198 !!!
!!! 199 !!!
生成されたa.batは、
factor((100^5+100^4+100^3+100^2+100+1)*100^27+100^6+100^5+100^4+100^3+100^2+100+1);
factor((101^5+101^4+101^3+101^2+101+1)*101^27+101^6+101^5+101^4+101^3+101^2+101+1);
factor((102^5+102^4+102^3+102^2+102+1)*102^27+102^6+102^5+102^4+102^3+102^2+102+1);
factor((106^5+106^4+106^3+106^2+106+1)*106^27+106^6+106^5+106^4+106^3+106^2+106+1);
factor((107^5+107^4+107^3+107^2+107+1)*107^27+107^6+107^5+107^4+107^3+107^2+107+1);
factor((108^5+108^4+108^3+108^2+108+1)*108^27+108^6+108^5+108^4+108^3+108^2+108+1);
factor((109^5+109^4+109^3+109^2+109+1)*109^27+109^6+109^5+109^4+109^3+109^2+109+1);
factor((110^5+110^4+110^3+110^2+110+1)*110^27+110^6+110^5+110^4+110^3+110^2+110+1);
factor((111^5+111^4+111^3+111^2+111+1)*111^27+111^6+111^5+111^4+111^3+111^2+111+1);
factor((112^5+112^4+112^3+112^2+112+1)*112^27+112^6+112^5+112^4+112^3+112^2+112+1);
factor((113^5+113^4+113^3+113^2+113+1)*113^27+113^6+113^5+113^4+113^3+113^2+113+1);
factor((114^5+114^4+114^3+114^2+114+1)*114^27+114^6+114^5+114^4+114^3+114^2+114+1);
factor((115^5+115^4+115^3+115^2+115+1)*115^27+115^6+115^5+115^4+115^3+115^2+115+1);
factor((116^5+116^4+116^3+116^2+116+1)*116^27+116^6+116^5+116^4+116^3+116^2+116+1);
factor((117^5+117^4+117^3+117^2+117+1)*117^27+117^6+117^5+117^4+117^3+117^2+117+1);
factor((120^5+120^4+120^3+120^2+120+1)*120^27+120^6+120^5+120^4+120^3+120^2+120+1);
factor((121^5+121^4+121^3+121^2+121+1)*121^27+121^6+121^5+121^4+121^3+121^2+121+1);
factor((123^5+123^4+123^3+123^2+123+1)*123^27+123^6+123^5+123^4+123^3+123^2+123+1);
factor((124^5+124^4+124^3+124^2+124+1)*124^27+124^6+124^5+124^4+124^3+124^2+124+1);
factor((127^5+127^4+127^3+127^2+127+1)*127^27+127^6+127^5+127^4+127^3+127^2+127+1);
factor((128^5+128^4+128^3+128^2+128+1)*128^27+128^6+128^5+128^4+128^3+128^2+128+1);
factor((129^5+129^4+129^3+129^2+129+1)*129^27+129^6+129^5+129^4+129^3+129^2+129+1);
factor((132^5+132^4+132^3+132^2+132+1)*132^27+132^6+132^5+132^4+132^3+132^2+132+1);
factor((133^5+133^4+133^3+133^2+133+1)*133^27+133^6+133^5+133^4+133^3+133^2+133+1);
factor((134^5+134^4+134^3+134^2+134+1)*134^27+134^6+134^5+134^4+134^3+134^2+134+1);
factor((135^5+135^4+135^3+135^2+135+1)*135^27+135^6+135^5+135^4+135^3+135^2+135+1);
factor((136^5+136^4+136^3+136^2+136+1)*136^27+136^6+136^5+136^4+136^3+136^2+136+1);
factor((139^5+139^4+139^3+139^2+139+1)*139^27+139^6+139^5+139^4+139^3+139^2+139+1);
factor((140^5+140^4+140^3+140^2+140+1)*140^27+140^6+140^5+140^4+140^3+140^2+140+1);
factor((141^5+141^4+141^3+141^2+141+1)*141^27+141^6+141^5+141^4+141^3+141^2+141+1);
factor((142^5+142^4+142^3+142^2+142+1)*142^27+142^6+142^5+142^4+142^3+142^2+142+1);
factor((146^5+146^4+146^3+146^2+146+1)*146^27+146^6+146^5+146^4+146^3+146^2+146+1);
factor((150^5+150^4+150^3+150^2+150+1)*150^27+150^6+150^5+150^4+150^3+150^2+150+1);
factor((151^5+151^4+151^3+151^2+151+1)*151^27+151^6+151^5+151^4+151^3+151^2+151+1);
factor((152^5+152^4+152^3+152^2+152+1)*152^27+152^6+152^5+152^4+152^3+152^2+152+1);
factor((153^5+153^4+153^3+153^2+153+1)*153^27+153^6+153^5+153^4+153^3+153^2+153+1);
factor((154^5+154^4+154^3+154^2+154+1)*154^27+154^6+154^5+154^4+154^3+154^2+154+1);
factor((155^5+155^4+155^3+155^2+155+1)*155^27+155^6+155^5+155^4+155^3+155^2+155+1);
factor((156^5+156^4+156^3+156^2+156+1)*156^27+156^6+156^5+156^4+156^3+156^2+156+1);
factor((158^5+158^4+158^3+158^2+158+1)*158^27+158^6+158^5+158^4+158^3+158^2+158+1);
factor((159^5+159^4+159^3+159^2+159+1)*159^27+159^6+159^5+159^4+159^3+159^2+159+1);
factor((160^5+160^4+160^3+160^2+160+1)*160^27+160^6+160^5+160^4+160^3+160^2+160+1);
factor((161^5+161^4+161^3+161^2+161+1)*161^27+161^6+161^5+161^4+161^3+161^2+161+1);
factor((162^5+162^4+162^3+162^2+162+1)*162^27+162^6+162^5+162^4+162^3+162^2+162+1);
factor((163^5+163^4+163^3+163^2+163+1)*163^27+163^6+163^5+163^4+163^3+163^2+163+1);
factor((165^5+165^4+165^3+165^2+165+1)*165^27+165^6+165^5+165^4+165^3+165^2+165+1);
factor((169^5+169^4+169^3+169^2+169+1)*169^27+169^6+169^5+169^4+169^3+169^2+169+1);
factor((171^5+171^4+171^3+171^2+171+1)*171^27+171^6+171^5+171^4+171^3+171^2+171+1);
factor((173^5+173^4+173^3+173^2+173+1)*173^27+173^6+173^5+173^4+173^3+173^2+173+1);
factor((174^5+174^4+174^3+174^2+174+1)*174^27+174^6+174^5+174^4+174^3+174^2+174+1);
factor((175^5+175^4+175^3+175^2+175+1)*175^27+175^6+175^5+175^4+175^3+175^2+175+1);
factor((176^5+176^4+176^3+176^2+176+1)*176^27+176^6+176^5+176^4+176^3+176^2+176+1);
factor((177^5+177^4+177^3+177^2+177+1)*177^27+177^6+177^5+177^4+177^3+177^2+177+1);
factor((178^5+178^4+178^3+178^2+178+1)*178^27+178^6+178^5+178^4+178^3+178^2+178+1);
factor((180^5+180^4+180^3+180^2+180+1)*180^27+180^6+180^5+180^4+180^3+180^2+180+1);
factor((181^5+181^4+181^3+181^2+181+1)*181^27+181^6+181^5+181^4+181^3+181^2+181+1);
factor((182^5+182^4+182^3+182^2+182+1)*182^27+182^6+182^5+182^4+182^3+182^2+182+1);
factor((184^5+184^4+184^3+184^2+184+1)*184^27+184^6+184^5+184^4+184^3+184^2+184+1);
factor((185^5+185^4+185^3+185^2+185+1)*185^27+185^6+185^5+185^4+185^3+185^2+185+1);
factor((187^5+187^4+187^3+187^2+187+1)*187^27+187^6+187^5+187^4+187^3+187^2+187+1);
factor((188^5+188^4+188^3+188^2+188+1)*188^27+188^6+188^5+188^4+188^3+188^2+188+1);
factor((189^5+189^4+189^3+189^2+189+1)*189^27+189^6+189^5+189^4+189^3+189^2+189+1);
factor((191^5+191^4+191^3+191^2+191+1)*191^27+191^6+191^5+191^4+191^3+191^2+191+1);
factor((192^5+192^4+192^3+192^2+192+1)*192^27+192^6+192^5+192^4+192^3+192^2+192+1);
factor((194^5+194^4+194^3+194^2+194+1)*194^27+194^6+194^5+194^4+194^3+194^2+194+1);
factor((197^5+197^4+197^3+197^2+197+1)*197^27+197^6+197^5+197^4+197^3+197^2+197+1);
factor((198^5+198^4+198^3+198^2+198+1)*198^27+198^6+198^5+198^4+198^3+198^2+198+1);
factor((199^5+199^4+199^3+199^2+199+1)*199^27+199^6+199^5+199^4+199^3+199^2+199+1);
(%i1) batch("a.bat");
read and interpret file: a.bat
2 3
4 5 6
(%i2) factor(1 + 100 + 100 + 100 + 100 + 100 +
100
2 3
4 5 27
+ (1 + 100 + 100 + 100 + 100 + 100 ) 100 )
(%o2) 1087 3851 3370043 1514549929012675102613809
472762156981855375162593379
2 3
4 5 6
(%i3) factor(1 + 101 + 101 + 101 + 101 + 101 +
101
2 3
4 5 27
+ (1 + 101 + 101 + 101 + 101 + 101 ) 101 )
(%o3) 193 1063483 52506437
1288560828858887943510768762554488541268080592371
2 3
4 5 6
(%i4) factor(1 + 102 + 102 + 102 + 102 + 102 +
102
2 3
4 5 27
+ (1 + 102 + 102 + 102 + 102 + 102 ) 102 )
素数ですね。
(%o4)
19031994098430147972472145061930329087064248517675522709562076691
2 3
4 5 6
(%i5) factor(1 + 106 + 106 + 106 + 106 + 106 +
106
2 3
4 5 27
+ (1 + 106 + 106 + 106 + 106 + 106 ) 106 )
(%o5) 40435563095406903979
1611167746582593025339186832984874528411015157
2 3
4 5 6
(%i6) factor(1 + 107 + 107 + 107 + 107 + 107 +
107
2 3
4 5 27
+ (1 + 107 + 107 + 107 + 107 + 107 ) 107 )
(%o6) 313 112939 1327341797 6043184723
310257210136481778098756274426608126653
2 3
4 5 6
(%i7) factor(1 + 108 + 108 + 108 + 108 + 108 +
108
2 3
4 5 27
+ (1 + 108 + 108 + 108 + 108 + 108 ) 108 )
(%o7) 1059169 29169857569
3834427966952816873221832738946342867218925342781
2 3
4 5 6
(%i8) factor(1 + 109 + 109 + 109 + 109 + 109 +
109
2 3
4 5 27
+ (1 + 109 + 109 + 109 + 109 + 109 ) 109 )
(%o8) 983 16231
9971302254281921852506853557873436540410228669643456388917
2 3
4 5 6
(%i9) factor(1 + 110 + 110 + 110 + 110 + 110 +
110
2 3
4 5 27
+ (1 + 110 + 110 + 110 + 110 + 110 ) 110 )
素数ですね。
(%o9) 213074811191510992172571264825156601281000000000000001787813853211
2 3
4 5 6
(%i10) factor(1 + 111 + 111 + 111 + 111 + 111 +
111
2 3
4 5 27
+ (1 + 111 + 111 + 111 + 111 + 111 ) 111 )
(%o10) 11609951 11612311 88437133 386104354291 442994004517
139565914804334032163
2 3
4 5 6
(%i11) factor(1 + 112 + 112 + 112 + 112 + 112 +
112
2 3
4 5 27
+ (1 + 112 + 112 + 112 + 112 + 112 ) 112 )
(%o11) 2687 35983 1078400867 73806514337 11374923902411
4331948754421989028315489
2 3
4 5 6
(%i12) factor(1 + 113 + 113 + 113 + 113 + 113 +
113
2 3
4 5 27
+ (1 + 113 + 113 + 113 + 113 + 113 ) 113 )
(%o12) 311 22417763
72279967689729525863759496526818186865517381118477556297
2 3
4 5 6
(%i13) factor(1 + 114 + 114 + 114 + 114 + 114 +
114
2 3
4 5 27
+ (1 + 114 + 114 + 114 + 114 + 114 ) 114 )
(%o13) 22861 64901
450230631000698559247838262477922283776522089851203783151
2 3
4 5 6
(%i14) factor(1 + 115 + 115 + 115 + 115 + 115 +
115
2 3
4 5 27
+ (1 + 115 + 115 + 115 + 115 + 115 ) 115 )
(%o14) 91369 72428287 363598310279
367108921147970359416128178282012254809193
2 3
4 5 6
(%i15) factor(1 + 116 + 116 + 116 + 116 + 116 +
116
2 3
4 5 27
+ (1 + 116 + 116 + 116 + 116 + 116 ) 116 )
素数ですね。
(%o15)
1165241125802829671300321841142927343616679292444406054789179448133
2 3
4 5 6
(%i16) factor(1 + 117 + 117 + 117 + 117 + 117 +
117
2 3
4 5 27
+ (1 + 117 + 117 + 117 + 117 + 117 ) 117 )
(%o16) 8693 120823 6452783 803155277 138129430442821
2039498334986424918575881049
2 3
4 5 6
(%i17) factor(1 + 120 + 120 + 120 + 120 + 120 +
120
2 3
4 5 27
+ (1 + 120 + 120 + 120 + 120 + 120 ) 120 )
(%o17) 173 17067433 2057570955703
567368248120299940482606127795704193642508723
2 3
4 5 6
(%i18) factor(1 + 121 + 121 + 121 + 121 + 121 +
121
2 3
4 5 27
+ (1 + 121 + 121 + 121 + 121 + 121 ) 121 )
(%o18) 173 311 9670621 418196659411
20658299035083202914188543773912039897823761
2 3
4 5 6
(%i19) factor(1 + 123 + 123 + 123 + 123 + 123 +
123
2 3
4 5 27
+ (1 + 123 + 123 + 123 + 123 + 123 ) 123 )
(%o19) 120495299 606978770173636114903978919
103840134451135455770531246577301
2 3
4 5 6
(%i20) factor(1 + 124 + 124 + 124 + 124 + 124 +
124
2 3
4 5 27
+ (1 + 124 + 124 + 124 + 124 + 124 ) 124 )
(%o20) 97 157 659 364607 209975452505303
12807376286474056081508202932745970980371
2 3
4 5 6
(%i21) factor(1 + 127 + 127 + 127 + 127 + 127 +
127
2 3
4 5 27
+ (1 + 127 + 127 + 127 + 127 + 127 ) 127 )
(%o21) 181 4021 23395189 234678737 976467101
5418532498964436074578870200965524537
2 3
4 5 6
(%i22) factor(1 + 128 + 128 + 128 + 128 + 128 +
128
2 3
4 5 27
+ (1 + 128 + 128 + 128 + 128 + 128 ) 128 )
(%o22) 101
269031977344234603258786512516023485814894638480017189032014817261
2 3
4 5 6
(%i23) factor(1 + 129 + 129 + 129 + 129 + 129 +
129
2 3
4 5 27
+ (1 + 129 + 129 + 129 + 129 + 129 ) 129 )
(%o23) 409 1997 7993 16189 1536023811677
214694694851934245286433562567992020493513
2 3
4 5 6
(%i24) factor(1 + 132 + 132 + 132 + 132 + 132 +
132
2 3
4 5 27
+ (1 + 132 + 132 + 132 + 132 + 132 ) 132 )
(%o24) 223 84391 328921 5077159436959979213922251
2313955668425260225397293945967
2 3
4 5 6
(%i25) factor(1 + 133 + 133 + 133 + 133 + 133 +
133
2 3
4 5 27
+ (1 + 133 + 133 + 133 + 133 + 133 ) 133 )
素数ですね。
(%o25)
92582780730311264933444842044454639376484518184986332302594467539141
2 3
4 5 6
(%i26) factor(1 + 134 + 134 + 134 + 134 + 134 +
134
2 3
4 5 27
+ (1 + 134 + 134 + 134 + 134 + 134 ) 134 )
(%o26) 2693 6091 1117111
6420745024482477990324991776439335962586920263816304387
2 3
4 5 6
(%i27) factor(1 + 135 + 135 + 135 + 135 + 135 +
135
2 3
4 5 27
+ (1 + 135 + 135 + 135 + 135 + 135 ) 135 )
(%o27) 26307821 82913885482428822445691
68422260227251715061970022997364169551
2 3
4 5 6
(%i28) factor(1 + 136 + 136 + 136 + 136 + 136 +
136
2 3
4 5 27
+ (1 + 136 + 136 + 136 + 136 + 136 ) 136 )
(%o28) 179 757 7927 39847 2235943 305598477139708450312397
6462266966533428626591269
2 3
4 5 6
(%i29) factor(1 + 139 + 139 + 139 + 139 + 139 +
139
2 3
4 5 27
+ (1 + 139 + 139 + 139 + 139 + 139 ) 139 )
(%o29) 17461807794763 2127123034416563
10226511424941066531258044307782529234569
2 3
4 5 6
(%i30) factor(1 + 140 + 140 + 140 + 140 + 140 +
140
2 3
4 5 27
+ (1 + 140 + 140 + 140 + 140 + 140 ) 140 )
(%o30) 449 201037
5292831171938998374298680188930971334070084917054737112432657
2 3
4 5 6
(%i31) factor(1 + 141 + 141 + 141 + 141 + 141 +
141
2 3
4 5 27
+ (1 + 141 + 141 + 141 + 141 + 141 ) 141 )
(%o31) 191 509 1948989139 223700848725514175342729
14153846508411968447517583278197
2 3
4 5 6
(%i32) factor(1 + 142 + 142 + 142 + 142 + 142 +
142
2 3
4 5 27
+ (1 + 142 + 142 + 142 + 142 + 142 ) 142 )
(%o32) 353 641 1037983
3202383034780080638565521212941267815776509258979173352069
2 3
4 5 6
(%i33) factor(1 + 146 + 146 + 146 + 146 + 146 +
146
2 3
4 5 27
+ (1 + 146 + 146 + 146 + 146 + 146 ) 146 )
(%o33) 12783007 5477236691 11343912693623 100016243323247
23027579463836727519774659
2 3
4 5 6
(%i34) factor(1 + 150 + 150 + 150 + 150 + 150 +
150
2 3
4 5 27
+ (1 + 150 + 150 + 150 + 150 + 150 ) 150 )
(%o34) 383 3529 47993201 4042323014201 57989629285084151
285636553667191409506926043
2 3
4 5 6
(%i35) factor(1 + 151 + 151 + 151 + 151 + 151 +
151
2 3
4 5 27
+ (1 + 151 + 151 + 151 + 151 + 151 ) 151 )
(%o35) 4159 36473 966213713
36653411083181533711398222476979931725880139400624343
2 3
4 5 6
(%i36) factor(1 + 152 + 152 + 152 + 152 + 152 +
152
2 3
4 5 27
+ (1 + 152 + 152 + 152 + 152 + 152 ) 152 )
(%o36) 401
16546916763650321323467162047337223697235014319709508780208084477641
2 3
4 5 6
(%i37) factor(1 + 153 + 153 + 153 + 153 + 153 +
153
2 3
4 5 27
+ (1 + 153 + 153 + 153 + 153 + 153 ) 153 )
(%o37) 220407203 1906096064312328669163702550149
19480632839203960171069250194163
2 3
4 5 6
(%i38) factor(1 + 154 + 154 + 154 + 154 + 154 +
154
2 3
4 5 27
+ (1 + 154 + 154 + 154 + 154 + 154 ) 154 )
(%o38) 35407471881607571
284706536330591186090868448246311887771527146137209901
2 3
4 5 6
(%i39) factor(1 + 155 + 155 + 155 + 155 + 155 +
155
2 3
4 5 27
+ (1 + 155 + 155 + 155 + 155 + 155 ) 155 )
(%o39) 187751
66045473780582032801952891614124482660321072974001476645652578431
2 3
4 5 6
(%i40) factor(1 + 156 + 156 + 156 + 156 + 156 +
156
2 3
4 5 27
+ (1 + 156 + 156 + 156 + 156 + 156 ) 156 )
(%o40) 44157540839 269674006007240353054906794433
1279193021870314293246551270219
2 3
4 5 6
(%i41) factor(1 + 158 + 158 + 158 + 158 + 158 +
158
2 3
4 5 27
+ (1 + 158 + 158 + 158 + 158 + 158 ) 158 )
(%o41) 20536203502433
1114972247967206330659833436725911295377397529313179629227
2 3
4 5 6
(%i42) factor(1 + 159 + 159 + 159 + 159 + 159 +
159
2 3
4 5 27
+ (1 + 159 + 159 + 159 + 159 + 159 ) 159 )
(%o42) 21424446102203
1307791206682424881627853319666423419965741654856558717747
2 3
4 5 6
(%i43) factor(1 + 160 + 160 + 160 + 160 + 160 +
160
2 3
4 5 27
+ (1 + 160 + 160 + 160 + 160 + 160 ) 160 )
(%o43) 141637 34912690949 51599347756857013 119539950094346591
1122651543359465093659
2 3
4 5 6
(%i44) factor(1 + 161 + 161 + 161 + 161 + 161 +
161
2 3
4 5 27
+ (1 + 161 + 161 + 161 + 161 + 161 ) 161 )
素数ですね。
(%o44)
41795923575765297099292607779892952884403145387375881452696091611321293
2 3
4 5 6
(%i45) factor(1 + 162 + 162 + 162 + 162 + 162 +
162
2 3
4 5 27
+ (1 + 162 + 162 + 162 + 162 + 162 ) 162 )
?????????????????????????????????????????????????????????????????????????????????
2 3
4 5 6
(%i2) factor(1 + 163 + 163 + 163 + 163 + 163 +
163
2 3
4 5 27
+ (1 + 163 + 163 + 163 + 163 + 163 ) 163 )
(%o2) 129382944648802318927
479511359207848767100430322057924645787573756334023
2 3
4 5 6
(%i3) factor(1 + 165 + 165 + 165 + 165 + 165 +
165
2 3
4 5 27
+ (1 + 165 + 165 + 165 + 165 + 165 ) 165 )
(%o3) 1987 58014061552127
795051337468771997518800735101685221066743525474892009
2 3
4 5 6
(%i4) factor(1 + 169 + 169 + 169 + 169 + 169 +
169
2 3
4 5 27
+ (1 + 169 + 169 + 169 + 169 + 169 ) 169 )
(%o4) 4007 98321 185140886657520002119479319
2703858759689024596060505180787398317
2 3
4 5 6
(%i5) factor(1 + 171 + 171 + 171 + 171 + 171 +
171
2 3
4 5 27
+ (1 + 171 + 171 + 171 + 171 + 171 ) 171 )
素数ですね。
(%o5)
287357622345634484244695974483273559414484123022909626097649823561126073
2 3
4 5 6
(%i6) factor(1 + 173 + 173 + 173 + 173 + 173 +
173
2 3
4 5 27
+ (1 + 173 + 173 + 173 + 173 + 173 ) 173 )
(%o6) 277 61737849998353
24375957613772181090748427447931903122238665269419411601
2 3
4 5 6
(%i7) factor(1 + 174 + 174 + 174 + 174 + 174 +
174
2 3
4 5 27
+ (1 + 174 + 174 + 174 + 174 + 174 ) 174 )
(%o7) 7791379
64337585695974518863749138204253984308310517704730039942502639769
2 3
4 5 6
(%i8) factor(1 + 175 + 175 + 175 + 175 + 175 +
175
2 3
4 5 27
+ (1 + 175 + 175 + 175 + 175 + 175 ) 175 )
(%o8) 974994439 2088482147542412021
295715066732390100284549640062850925069175579
2 3
4 5 6
(%i9) factor(1 + 176 + 176 + 176 + 176 + 176 +
176
2 3
4 5 27
+ (1 + 176 + 176 + 176 + 176 + 176 ) 176 )
??????????????????????????????????????????????????????????????????????????????
2 3
4 5 6
(%i2) factor(1 + 177 + 177 + 177 + 177 + 177 +
177
2 3
4 5 27
+ (1 + 177 + 177 + 177 + 177 + 177 ) 177 )
(%o2) 34598237 745914859 156208646677 34304796532213
6263282152960864689224663022827
2 3
4 5 6
(%i3) factor(1 + 178 + 178 + 178 + 178 + 178 +
178
2 3
4 5 27
+ (1 + 178 + 178 + 178 + 178 + 178 ) 178 )
(%o3) 3308533 4800623 121305724339 108538220686897357
4960092143119337084162654990123
2 3
4 5 6
(%i3) factor(1 + 180 + 180 + 180 + 180 + 180 +
180
2 3
4 5 27
+ (1 + 180 + 180 + 180 + 180 + 180 ) 180 )
(%o3) 101
14683117143275871244504928315784633896966164277227722772277566358776481
2 3
4 5 6
(%i4) factor(1 + 181 + 181 + 181 + 181 + 181 +
181
2 3
4 5 27
+ (1 + 181 + 181 + 181 + 181 + 181 ) 181 )
(%o4) 608730663590009
2908675591896190469674964752050767802746449164062059847117
2 3
4 5 6
(%i5) factor(1 + 182 + 182 + 182 + 182 + 182 +
182
2 3
4 5 27
+ (1 + 182 + 182 + 182 + 182 + 182 ) 182 )
(%o5) 7135595062763 125388546496673
2360419339366448026512743636276951435695666249
2 3
4 5 6
(%i6) factor(1 + 184 + 184 + 184 + 184 + 184 +
184
2 3
4 5 27
+ (1 + 184 + 184 + 184 + 184 + 184 ) 184 )
(%o6) 38921 122693118857 2220448657949017 74602402880223637
3787383837122207889735757
2 3
4 5 6
(%i7) factor(1 + 185 + 185 + 185 + 185 + 185 +
185
2 3
4 5 27
+ (1 + 185 + 185 + 185 + 185 + 185 ) 185 )
(%o7) 6688093 3990418595970356444743591
133514506589513928114247780507605420093847
2 3
4 5 6
(%i8) factor(1 + 187 + 187 + 187 + 187 + 187 +
187
2 3
4 5 27
+ (1 + 187 + 187 + 187 + 187 + 187 ) 187 )
素数ですね。
(%o8)
5026435008044125049912496346535086486452818083905842518911592183160828761
2 3
4 5 6
(%i9) factor(1 + 188 + 188 + 188 + 188 + 188 +
188
2 3
4 5 27
+ (1 + 188 + 188 + 188 + 188 + 188 ) 188 )
(%o9) 38206067 1935570694400342663308681847
80616891494622535408004201597387769529
2 3
4 5 6
(%i10) factor(1 + 189 + 189 + 189 + 189 + 189 +
189
2 3
4 5 27
+ (1 + 189 + 189 + 189 + 189 + 189 ) 189 )
????????????????????????????????????????????????????????????????????????????????
2 3
4 5 6
(%i2) factor(1 + 191 + 191 + 191 + 191 + 191 +
191
2 3
4 5 27
+ (1 + 191 + 191 + 191 + 191 + 191 ) 191 )
(%o2) 11087 34422016388724707
25923710546515816293531381458714994017331874938861637
2 3
4 5 6
(%i3) factor(1 + 192 + 192 + 192 + 192 + 192 +
192
2 3
4 5 27
+ (1 + 192 + 192 + 192 + 192 + 192 ) 192 )
(%o3) 258732072253663 479942489581523
94160273888880023731993801138271882719602629
2 3
4 5 6
(%i4) factor(1 + 194 + 194 + 194 + 194 + 194 +
194
2 3
4 5 27
+ (1 + 194 + 194 + 194 + 194 + 194 ) 194 )
(%o4) 2699 52529
114894108844429786931654773436154375917691814920814772496171433261
2 3
4 5 6
(%i5) factor(1 + 197 + 197 + 197 + 197 + 197 +
197
2 3
4 5 27
+ (1 + 197 + 197 + 197 + 197 + 197 ) 197 )
(%o5) 461 3493909 1052740267 12424603203047928479
1263319251761184327898189647641720833
2 3
4 5 6
(%i6) factor(1 + 198 + 198 + 198 + 198 + 198 +
198
2 3
4 5 27
+ (1 + 198 + 198 + 198 + 198 + 198 ) 198 )
(%o6) 5250899 43311911 74272943 217333097
8524865586813355960608518507291538568485649
2 3
4 5 6
(%i7) factor(1 + 199 + 199 + 199 + 199 + 199 +
199
2 3
4 5 27
+ (1 + 199 + 199 + 199 + 199 + 199 ) 199 )
(%o7) 1061 4346428921 8459726333
942501502982593071849624056859400099864147312572937
b.txtに追加されるものは、
193,101
313,107
983,109
311,113
173,120
173,121
311,121
97,124
157,124
659,124
181,127
101,128
409,129
223,132
179,136
757,136
449,140
191,141
509,141
353,142
641,142
383,150
401,152
277,173
101,180
461,197