#J, 23 bytes
J, 23 bytes
[:+/](([:=&0]|[)#])1+i.
For J fans, there is a clever 13 byte solution: >:@#.~/.~&.q: but since it wasn't my invention I'm not posting it as my official answer.
My own solution simply filters 1..n, finding divisors, then sums them. The crux of it is the dyadic fork
](([:=&0]|[)#])
Note that in this context ] is 1..n, and [ is n itself. Hence ]|[ are the remainders when dividing each element of 1..n into n, and =&0 tells you if they're equal to 0.
#J, 23 bytes
[:+/](([:=&0]|[)#])1+i.
For J fans, there is a clever 13 byte solution: >:@#.~/.~&.q: but since it wasn't my invention I'm not posting it as my official answer.
My own solution simply filters 1..n, finding divisors, then sums them. The crux of it is the dyadic fork
](([:=&0]|[)#])
Note that in this context ] is 1..n, and [ is n itself. Hence ]|[ are the remainders when dividing each element of 1..n into n, and =&0 tells you if they're equal to 0.
J, 23 bytes
[:+/](([:=&0]|[)#])1+i.
For J fans, there is a clever 13 byte solution: >:@#.~/.~&.q: but since it wasn't my invention I'm not posting it as my official answer.
My own solution simply filters 1..n, finding divisors, then sums them. The crux of it is the dyadic fork
](([:=&0]|[)#])
Note that in this context ] is 1..n, and [ is n itself. Hence ]|[ are the remainders when dividing each element of 1..n into n, and =&0 tells you if they're equal to 0.
#J, 23 bytes
[:+/](([:=&0]|[)#])1+i.
For J fans, there is a clever 13 byte solution: >:@#.~/.~&.q: but since it wasn't my invention I'm not posting it as my official answer.
My own solution simply filters 1..n, finding divisors, then sums them. The crux of it is the dyadic fork
](([:=&0]|[)#])
Note that in this context ] is 1..n, and [ is n itself. Hence ]|[ are the remainders when dividing each element of 1..n into n, and =&0 tells you if they're equal to 0.