Distinct power numbers: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added wording to the REXX section header.)
m (→‎{{header|REXX}}: increased columnar width, showed another example.)
Line 527: Line 527:
if hi=='' | hi=="," then hi= 5 /* " " " " " " */
if hi=='' | hi=="," then hi= 5 /* " " " " " " */
if cols=='' | cols=="," then cols= 10 /* " " " " " " */
if cols=='' | cols=="," then cols= 10 /* " " " " " " */
w= 10 /*width of a number in any column. */
w= 11 /*width of a number in any column. */
title= ' distinct power integers, a^b, where a and b are: ' lo "≤ both ≤" hi
title= ' distinct power integers, a^b, where a and b are: ' lo "≤ both ≤" hi
say ' index │'center(title, 1 + cols*(w+1) )
say ' index │'center(title, 1 + cols*(w+1) )
Line 557: Line 557:
{{out|output|text=  when using the default inputs:}}
{{out|output|text=  when using the default inputs:}}
<pre>
<pre>
index │ distinct power integers, a^b, where a and b are: 2 ≤ both ≤ 5
index │ distinct power integers, a^b, where a and b are: 2 ≤ both ≤ 5
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 4 8 9 16 25 27 32 64 81 125
1 │ 4 8 9 16 25 27 32 64 81 125
11 │ 243 256 625 1,024 3,125
11 │ 243 256 625 1,024 3,125
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────


Found 15 distinct power integers, a^b, where a and b are: 2 ≤ both ≤ 5
Found 15 distinct power integers, a^b, where a and b are: 2 ≤ both ≤ 5
</pre>

{{out|output|text=&nbsp; when using the inputs of: &nbsp; &nbsp; <tt> 2 &nbsp; 8 </tt>}}
<pre>
index │ distinct power integers, a^b, where a and b are: 2 ≤ both ≤ 8
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 4 8 9 16 25 27 32 36 49 64
11 │ 81 125 128 216 243 256 343 512 625 729
21 │ 1,024 1,296 2,187 2,401 3,125 4,096 6,561 7,776 15,625 16,384
31 │ 16,807 32,768 46,656 65,536 78,125 117,649 262,144 279,936 390,625 823,543
41 │ 1,679,616 2,097,152 5,764,801 16,777,216
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Found 44 distinct power integers, a^b, where a and b are: 2 ≤ both ≤ 8
</pre>
</pre>