Sexy primes: Difference between revisions

→‎{{header|J}}: rely on params, not globals
(→‎{{header|J}}: fix unsexy bug)
(→‎{{header|J}}: rely on params, not globals)
Line 966:
 
sp =: dyad define
'spd os' =. x NB. prime distance, orgy size
p =. pngt y
o =. orgy p
g =. o +/&.> <\ +/\ _1 |.!.0 os # spd NB. Groups
 
's g' =. split g NB. Split singles from groups
Line 978:
NB. it causes the kind of edge-case issues the spec warns
NB. about with 1000033
us =. _6 6p (] #~ [: +:/ 1 p: +/)~ p(+,-) pd NB. Unsexy numbers
( (#&.> g) ,. l ) ,~ (# ; _10&{.) us
)
Anonymous user