Arithmetic derivative: Difference between revisions

→‎{{header|J}}: even simpler
(Added Go)
(→‎{{header|J}}: even simpler)
Line 135:
=={{header|J}}==
Implementation:
<lang J>D=: {{ (*y)*+/1*/\.y%q:1>.|y }}"0</lang>
 
In other words: find the prime factorssum of the absoluteargument valuedivided of y as a sequence, find and sumby each of the products with exactly one value removed from this sequence and multiply by the sign of y. (And since 0's prime factor list does not exist, use the empty list of prime factors of 1its forabsolute that case.value (Thewith suma ofspecial thecase elements of an empty list isfor zero, the product of the elements of an empty list is 1).))
 
Task example:
6,962

edits