MathDB
changing the sign of every number divisible by $m$

Source: Moldova TST 2022

April 1, 2022
combinatoricsnumber theory

Problem Statement

Let nn be a positive integer. On a board there are written all integers from 11 to nn. Alina does nn moves consecutively: for every integer mm (1mn)(1 \leq m \leq n) the move mm consists in changing the sign of every number divisible by mm. At the end Alina sums the numbers. Find this sum.