June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,11 @@
|
|||
USING: kernel math.parser prettyprint sequences ;
|
||||
IN: rosetta-code.self-describing-numbers
|
||||
|
||||
: digits ( n -- seq ) number>string string>digits ;
|
||||
|
||||
: digit-count ( seq n -- m ) [ = ] curry count ;
|
||||
|
||||
: self-describing-number? ( n -- ? )
|
||||
digits dup [ digit-count = ] with map-index [ t = ] all? ;
|
||||
|
||||
100,000,000 <iota> [ self-describing-number? ] filter .
|
||||
Loading…
Add table
Add a link
Reference in a new issue