Jump to content

Square-free integers: Difference between revisions

m
Line 658:
=={{header|J}}==
'''Solution:'''
<lang j>isSqrFree=: (#@~. = #)@q: NB. are there no duplicates in the prime factors of a number?
filter=: 1adverb def :' #~ u' NB. filter right arg using verb to left
countSqrFree=: +/@:isSqrFree
thru=: <. + i.@(+ *)@-~ NB. helper verb</lang>
 
'''Required Examples:'''
892

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.