Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
# Input: a positive integer
|
||||
# Output: the "middle-square"
|
||||
def middle_square:
|
||||
(tostring|length) as $len
|
||||
| (. * .)
|
||||
| tostring
|
||||
| (3*length/4|ceil) as $n
|
||||
| .[ -$n : $len-$n]
|
||||
| if length == 0 then 0 else tonumber end;
|
||||
|
||||
# Input: a positive integer
|
||||
# Output: middle_square, applied recursively
|
||||
def middle_squares:
|
||||
middle_square | ., middle_squares;
|
||||
|
||||
limit(5; 675248 | middle_squares)
|
||||
Loading…
Add table
Add a link
Reference in a new issue