Advertisement
Guest User

Untitled

a guest
May 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Input: 3 Output: 2, -2
  2. Input: 10 Output: 8, 4
  3. Input: 50 Output: 48, 35
  4. Input: 1000 Output: 1000, 971
  5. Input: 9999 Output: 9984, 9802
  6.  
  7. Num PrimeFacs PrimeFacs^2 SumPrimeFacs^2 Result
  8. 2 [2] [4] 4 -2
  9. 3 [3] [9] 9 -6
  10. 4 [2] [4] 4 0
  11. 5 [5] [25] 25 -20
  12. 6 [2, 3] [4, 9] 13 -7
  13. 7 [7] [49] 49 -42
  14. 8 [2] [4] 4 4
  15. 9 [3] [9] 9 0
  16. 10 [2, 5] [4, 25] 29 -19
  17.  
  18. u2x;`;y;*@-`M;M;)@í@E
  19.  
  20. u2x;`;y;*@-`M;M;)@í@E
  21. u2x; push two copies of range(2, n+1) ([2, n])
  22. ` `M map:
  23. ; duplicate
  24. y; push two copies of prime divisors
  25. * dot product of prime divisors lists (equivalent to sum of squares)
  26. @- subtract from n
  27. ;M;) duplicate, two copies of max, move one copy to bottom of stack
  28. @í get index of max element
  29. @E get corresponding element from range
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement