Arithmetic derivative: Difference between revisions

Content added Content deleted
Line 41: Line 41:
<lang J>D=: {{ (*y)*+/1*/\.q:1>.|y }}"0</lang>
<lang J>D=: {{ (*y)*+/1*/\.q:1>.|y }}"0</lang>


In other words: find the prime factors of the absolute value of y as a sequence, find and sum 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 1 for that case.)
In other words: find the prime factors of the absolute value of y as a sequence, find and sum 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 1 for that case. (The sum of the elements of an empty list is zero, the product of the elements of an empty list is 1.))


Task example:
Task example: