Tap here to switch tabs
Problem
Submissions

Problem: Sum of Increasing Product Blocks

Try to solve the Sum of Increasing Product Blocks problem.

Statement

Given an integer n, consider a sequence of blocks formed by consecutive positive integers starting from 11:

  • The 1extst1^{ ext{st}} block contains 11 integer: 11

  • The 2extnd2^{ ext{nd}} block contains the next 22 integers: 2,32, 3

  • The 3extrd3^{ ext{rd}} block contains the next 33 integers: 4,5,64, 5, 6

  • In general, the kextthk^{ ext{th}} block contains the next kk consecutive integers.

The value of each block is the product of all integers contained within it.

Return the sum of the values of the first n blocks modulo 109+710^9 + 7.

Constraints:

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Increasing Product Blocks

Try to solve the Sum of Increasing Product Blocks problem.

Statement

Given an integer n, consider a sequence of blocks formed by consecutive positive integers starting from 11:

  • The 1extst1^{ ext{st}} block contains 11 integer: 11

  • The 2extnd2^{ ext{nd}} block contains the next 22 integers: 2,32, 3

  • The 3extrd3^{ ext{rd}} block contains the next 33 integers: 4,5,64, 5, 6

  • In general, the kextthk^{ ext{th}} block contains the next kk consecutive integers.

The value of each block is the product of all integers contained within it.

Return the sum of the values of the first n blocks modulo 109+710^9 + 7.

Constraints:

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