Tap here to switch tabs
Problem
Submissions

Problem: GCD of Odd and Even Sums

med
30 min
Try to solve the GCD of Odd and Even Sums problem.

Statement

Given an integer n, determine the greatest common divisor (GCD) of the sum of the first n positive odd integers and the sum of the first n positive even integers.

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: GCD of Odd and Even Sums

med
30 min
Try to solve the GCD of Odd and Even Sums problem.

Statement

Given an integer n, determine the greatest common divisor (GCD) of the sum of the first n positive odd integers and the sum of the first n positive even integers.

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000