Skip to content

Instantly share code, notes, and snippets.

@naxmefy
Created April 24, 2021 22:53
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 naxmefy/5e826ee2092dc41212abadbbbd19add4 to your computer and use it in GitHub Desktop.
Save naxmefy/5e826ee2092dc41212abadbbbd19add4 to your computer and use it in GitHub Desktop.
unique prime factors in range from a to b
require'prime'
gets
$<.map{|s|p (s.to_i..s[/ .+/].to_i).count{|n|n>0&&n.prime_division[1]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment