Puzzle - RPL and others
|
04-22-2021, 11:52 PM
Post: #2
|
|||
|
|||
RE: Puzzle - RPL and others
(04-22-2021 06:55 PM)Gene Wrote: For the other machines, post your solution and let's see what can be done. Ok,this 6-liner, 195-byte recursive HP-71B program will do: 1 DESTROY ALL @ STD @ FOR I=1 TO 9 @ CALL TST((I),2,9) @ NEXT I 2 SUB TST(N,D,M) @ N=10*N @ FOR I=1 TO 9 @ X=N+I @ IF MOD(X,D) THEN 6 3 A$=STR$(X) @ FOR J=1 TO LEN(A$) @ IF POS(A$[J+1],A$[J,J]) THEN 6 4 NEXT J @ IF LEN(A$)=9 THEN DISP X @ END ALL 5 IF D#M THEN CALL TST(X,D+1,M) 6 NEXT I Quote:PLEASE DO NOT POST the actual number until about 18 hours after this post ? (6am EASTERN USA TIME 4/23/21). :-) Ok, I won't post the result of running my program but rest assured that it's the correct number. By the way, if you add to it a final 0 it will cease to be a Social Security number but it will be a 10-digit number which meets all other requirements. Best regards V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)