Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Untouchable-numbers/J/untouchable-numbers.j
Normal file
15
Task/Untouchable-numbers/J/untouchable-numbers.j
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
factor=: 3 : 0 NB. explicit
|
||||
'primes powers'=. __&q: y
|
||||
input_to_cartesian_product=. primes ^&.> i.&.> >: powers
|
||||
cartesian_product=. , { input_to_cartesian_product
|
||||
, */&> cartesian_product
|
||||
)
|
||||
|
||||
factor=: [: , [: */&> [: { [: (^&.> i.&.>@>:)/ __&q: NB. tacit
|
||||
|
||||
|
||||
proper_divisors=: [: }: factor
|
||||
sum_of_proper_divisors=: +/@proper_divisors
|
||||
|
||||
candidates=: 5 , [: +: [: #\@i. >.@-: NB. within considered range, all but one candidate are even.
|
||||
spds=:([:sum_of_proper_divisors"0(#\@i.-.i.&.:(p:inv))@*:)f. NB. remove primes which contribute 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue