Jump to content

Radical of an integer: Difference between revisions

J
(J)
Line 28:
* OEIS sequence [[oeis:A007947|A007947: Largest square free number dividing n]]
<br>
=={{header|J}}==
<syntaxhighlight lang=J> ~.&.q: 1+i.5 10
1 2 3 2 5 6 7 2 3 10
11 6 13 14 15 2 17 6 19 10
21 22 23 6 5 26 3 14 29 30
31 2 33 34 35 6 37 38 39 10
41 42 43 22 15 46 47 6 7 10
~.&.q: 99999 499999 999999
33333 3937 111111
(~.,.#/.~) #@~.@q: 1+i.1e6
0 1
1 78734
2 288726
3 379720
4 208034
5 42492
6 2285
7 8</syntaxhighlight>
 
=={{header|jq}}==
'''Adapted from [[#Wren|Wren]]'''
6,962

edits

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