Mian-Chowla sequence: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Changed to Wren S/H) |
(added RPL) |
||
Line 1,887: | Line 1,887: | ||
The Mian─Chowla sequence for terms 91 ──► 100 (inclusive): |
The Mian─Chowla sequence for terms 91 ──► 100 (inclusive): |
||
22526 23291 23564 23881 24596 24768 25631 26037 26255 27219 |
22526 23291 23564 23881 24596 24768 25631 26037 26255 27219 |
||
</pre> |
|||
=={{header|RPL}}== |
|||
{{works with|RPL|HP48-R}} |
|||
« { 2 } → n sums |
|||
« { 1 } |
|||
'''WHILE''' DUP SIZE n < '''REPEAT''' |
|||
DUP DUP SIZE GET |
|||
1 CF |
|||
'''DO''' 1 + |
|||
DUP2 ADD DUP sums + SORT ΔLIST |
|||
'''IF''' 0 POS '''THEN''' DROP '''ELSE''' 1 SF '''END''' |
|||
'''UNTIL''' 1 FS? '''END''' |
|||
OVER DUP + + 'sums' STO+ + |
|||
'''END''' |
|||
» » '<span style="color:blue">A5282</span>' STO |
|||
30 <span style="color:blue">A5282</span> |
|||
{{out}} |
|||
<pre> |
|||
1: { 1 2 4 8 13 21 31 45 66 81 97 123 148 182 204 252 290 361 401 475 565 593 662 775 822 916 970 1016 1159 1312 } |
|||
</pre> |
</pre> |
||