June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,17 @@
USING: kernel math math.ranges math.text.utils memoize
prettyprint sequences tools.time ;
IN: rosetta-code.iterated-digits-squaring
: sum-digit-sq ( n -- m ) 1 digit-groups [ sq ] map-sum ;
MEMO: 1or89 ( n -- m )
[ dup [ 1 = ] [ 89 = ] bi or ] [ sum-digit-sq ] until ;
[
0 1
[
dup sum-digit-sq 1or89 89 = [ [ 1 + ] dip ] when
1 + dup 100,000,000 <
] loop
drop .
] time