Running this program
10 V$="1234567890":H$=V$
15 repeat
20 Twos=left(V$,3):Cups=mid(V$,4,3)
30 Two=val(Twos):Cup=val(Cups)
40 if left(Twos,1)<>"0" and left(Cups)<>"0" and mid(V$,9,1)<>"0" then
50 :T=left(V$,1)
60 :E=mid(V$,7,1)
70 :A=mid(V$,8,1)
80 :S=mid(V$,9,1)
90 :Teaset=val(T+E+A+S+E+T)
100 :Tea=val(T+E+A)
110 :Setv=val(S+E+T)
120 :if prmdiv(Two)=Two and prmdiv(Cup)=Cup and prmdiv(Tea)=Tea and prmdiv(Setv)=Setv and Two*Cup=Teaset then
130 :print Two;Cup;Teaset,
210 :S$="":N=abs(Teaset)
220 :if N>0 then Limit=sqrt(N):else Limit=0:endif
230 :if Limit<>int(Limit) then Limit=int(Limit+1):endif
240 :Dv=2:gosub *DivideIt
250 :Dv=3:gosub *DivideIt
260 :Dv=5:gosub *DivideIt
270 :Dv=7
280 :loop
290 :if Dv>Limit then goto 400:endif
300 :gosub *DivideIt:Dv=Dv+4 '11
310 :gosub *DivideIt:Dv=Dv+2 '13
320 :gosub *DivideIt:Dv=Dv+4 '17
330 :gosub *DivideIt:Dv=Dv+2 '19
340 :gosub *DivideIt:Dv=Dv+4 '23
350 :gosub *DivideIt:Dv=Dv+6 '29
360 :gosub *DivideIt:Dv=Dv+2 '31
370 :gosub *DivideIt:Dv=Dv+6 '37
380 :if inkey=chr(27) then S$=chr(27):end:endif
390 :endloop
400 :'
410 :if N>1 then S$=S$+str(N):endif
420 :print S$
520 gosub *Permute(&V$)
535 until V$=H$
540 end
800
produces no output. The factoring of the answer was in case that helped figure a property of TEASET, but no teaset was found to factor.
I've checked my logic but don't see a bug.
|
Posted by Charlie
on 2013-02-07 13:46:11 |