[VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math"
|
02-20-2021, 10:07 PM
(This post was last modified: 02-23-2021 01:47 AM by Gerson W. Barbosa.)
Post: #24
|
|||
|
|||
RE: [VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math...
(02-19-2021 11:32 PM)Valentin Albillo Wrote: These were being answered, either explicitly or implicitly, in a post-scriptum to post #17 while you were still writing your post. Sorry for the delay. (02-19-2021 11:32 PM)Valentin Albillo Wrote: As you please, on the HP-75C: 10 OPTION BASE 1 15 DIM P(20),Y(100) 20 INPUT L 25 N=CEIL(3*(4*L/LOG(L)^2)^(1/3)) 30 FOR I=1 TO 20 35 READ P 40 P(I)=P*P 45 NEXT I 50 C=0 55 FOR I=1 TO N 60 FOR J=1 TO N+1-I 65 S=0 70 FOR K=J TO I+J-1 75 S=S+P(K) 80 NEXT K 85 IF S<=L THEN C=C+1 @ Y(C)=S 90 NEXT J 95 NEXT I 100 FOR I=1 TO C-1 105 FOR J=I TO C 110 IF Y(I)>Y(J) THEN T=Y(I) @ Y(I)=Y(J) @ Y(J)=T 115 NEXT J 120 NEXT I 125 FOR I=1 TO C 130 DISP USING 135 ; Y(I); 135 IMAGE 5d 140 NEXT I 145 DISP 150 END 200 DATA 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47 ,53,59,61,67,71 >RUN ?5000 4 9 13 25 34 38 49 74 83 87 121 169 170 195 204 208 289 290 339 361 364 373 377 458 529 579 628 650 653 662 666 819 841 890 940 961 989 1014 1023 1027 1179 1348 1369 1370 1469 1518 1543 1552 1556 1681 1731 1802 1849 2020 2189 2209 2310 2330 2331 2359 2384 2393 2397 2692 2809 2981 3050 3150 3171 3271 3320 3345 3354 3358 3481 3530 3700 3721 4011 4058 4061 4350 4489 4519 4640 4689 4714 4723 4727 4852 4899 > Best regards, Gerson. Edited to fix lack of linguistic precision in the first paragraph |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)