Prove every number in the sequence 38, 381, 3811, 38111, 381111, ... is composite.
Number and its prime factors:
38 2 19
381 3 127
3811 37 103
38111 23 1657
381111 3 127037
3811111 17 37 73 83
38111111 233 163567
381111111 3 3 42345679
3811111111 37 113 613 1487
38111111111 31 2333 526957
381111111111 3 2399 52954163
3811111111111 37 103003003003
38111111111111 23333 1633356667
381111111111111 3 73 1740233384069
3811111111111111 37 2287 45038479669
38111111111111111 353 661 163333566667
381111111111111111 3 3 131 323249458109509
3811111111111111111 37 114346289 900798827
38111111111111111111 19 227 541 2857 5716953331
381111111111111111111 3 879449 1140233 126685261
4 word 255:kill "38and1s.txt":open "38and1s.txt" for output as #2
5 N=38
10 for I=2 to 20
20 print N;:Fctors=fnFactor(N):N=N*10+1
25 print #2,N;
30 next
40 close #2
999 end
1000 fnFactor(Num)
1005 local Fctrs,S,N,I
1010 N=abs(Num):Ct=0:Fctrs=0:S=""
1020 if N>0 then Limit=sqrt(N):else Limit=0
1030 if Limit<>int(Limit) then Limit=int(Limit+1)
1040 Dv=2:gosub *DivideIt
1050 Dv=3:gosub *DivideIt
1060 Dv=5:gosub *DivideIt
1070 Dv=7
1080 loop
1090 if Dv>Limit then goto *Afterloop
1100 gosub *DivideIt:Dv=Dv+4 '11
1110 gosub *DivideIt:Dv=Dv+2 '13
1120 gosub *DivideIt:Dv=Dv+4 '17
1130 gosub *DivideIt:Dv=Dv+2 '19
1140 gosub *DivideIt:Dv=Dv+4 '23
1150 gosub *DivideIt:Dv=Dv+6 '29
1160 gosub *DivideIt:Dv=Dv+2 '31
1170 gosub *DivideIt:Dv=Dv+6 '37
1180 if inkey=chr(27) then S$=chr(27):end
1190 endloop
1200 *Afterloop
1210 if N>1 then S=str(S)+str(N):Ct=Ct+1
1220 print S
1221 print #2,S
1230 return(Ct)
1240
1250 *DivideIt
1255 Did=0
1260 loop
1270 Q=int(N/Dv)
1280 if Q*Dv=N and N>0 then
1290 :N=Q:Fctrs=Fctrs+1:S=str(S)+str(Dv):Ct=Ct+1
1291 :Did=Did+1
1300 :if N>0 then Limit=sqrt(N):else Limit=0:endif
1310 :if Limit<>int(Limit) then Limit=int(Limit+1):endif
1320 :else
1330 :goto *Afterdo
1340 :endif
1350 endloop
1360 *Afterdo
1370 return
Wolfram Alpha supplies:
3811111111111111111111 37 393380951 261840342653
38111111111111111111111 17 73 1372549 22374429543379
381111111111111111111111 3 55711 158823283 14357381249
Every third one seems to be a multiple of three, and the one after that is a multiple of 37. The one after than would seem to be unpredicatable, but is actually always divisible by 2333..., with one more 3 each occurrence. it's disquised by the fact that 233333 = 353*661 and 2333333 = 19*227*541 and 23333333 = 17*1372549.
|
Posted by Charlie
on 2017-06-30 09:04:10 |