I came across the below question in codewars. Regarding to the question, all I know is the sum of numbers ranging from 1 to n is $n(n+1)/2$. And I have no idea how to solve this question further. There were plenty of code solutions available but I wanted to understand mathematically. Can someone help me to solve this?
Given a sequence of numbers ranging from 1 to n, pick two numbers a and b from that sequence such that the product of a and b should be equal to the sum of all numbers in the sequence, excluding a and b