A Problem about Number Theory

Revision en1, by user_wangkaiwei, 2026-07-20 05:12:44

Description:

You have a number $$$n$$$, and the smallest prime factor of $$$n$$$ is $$$p$$$. Turning $$$n$$$ into $$$\frac{n+p}{2}$$$ is called an operation.

You should do this until $$$n$$$ is prime.

Find the number of times the operation can be performed.

No limits.Could you find the lowest complexity of this problem?It's unnecessary to consider the complexity of input and output.

Tags number theory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English user_wangkaiwei 2026-07-20 05:12:44 402 Initial revision (published)