MathDB
program starts with n = 13^{13}

Source: 2022 Moldova JBMO TST p7

November 4, 2022
number theory

Problem Statement

A program works as follows. If the input is given a natural number nn (n2n \ge 2), then the program consecutively performs the following procedure: it determines the greatest proper divisor of the number n n (that is, different from 11 and nn) and subtracts it from the number nn, then applies again the same procedure to the obtained result and so on. If the program cannot find any proper divisor of the given number at a step, then it stops and outputs the total number mm of procedures performed (this number can be equal to 00). The input was given the number n=1313n = 13^{13}. Determine the respective number mm at the output.