Tap here to switch tabs
Problem
Submissions

Problem: Count Distinct Numbers on Board

med
30 min
Try to solve the Count Distinct Numbers on Board problem.

Statement

You are given a positive integer n, which is initially present on a board.

Every day, for 10910^9 days, the following process is performed:

  • For each integer x currently on the board, find all integers i such that 1≤1 \leq i ≤\leq n and x % i == 1.

  • Add every such integer i to the board.

Return the count of distinct integers present on the board after 10910^9 days.

Note: Once a number is added to the board, it remains on the board indefinitely.

Constraints:

  • 1≤1 \leq n ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Distinct Numbers on Board

med
30 min
Try to solve the Count Distinct Numbers on Board problem.

Statement

You are given a positive integer n, which is initially present on a board.

Every day, for 10910^9 days, the following process is performed:

  • For each integer x currently on the board, find all integers i such that 1≤1 \leq i ≤\leq n and x % i == 1.

  • Add every such integer i to the board.

Return the count of distinct integers present on the board after 10910^9 days.

Note: Once a number is added to the board, it remains on the board indefinitely.

Constraints:

  • 1≤1 \leq n ≤100\leq 100