Skip to content

Instantly share code, notes, and snippets.

@tangentstorm
Last active October 26, 2020 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tangentstorm/11a5f7c7e9688e0e380622655045278b to your computer and use it in GitHub Desktop.
Save tangentstorm/11a5f7c7e9688e0e380622655045278b to your computer and use it in GitHub Desktop.
c =: '01' ([: +/ =)"0 _ ] NB. count 0 and 1
t =: {{(*/ <:/"1 c\ y) *. =/c y }} NB. the two rules
g =: {{'01' {~ #:i.2^2*y}} NB. generate the numbers
f =: {{y {~ I.t"1 y}} NB. filter by t
f g 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment