MathDB
finding the number of 2015 and 2016 in an infinite sequence

Source: 2017 Azerbaijan Junior National Olympiad

April 28, 2022
combinatoricsnumber theorySequence

Problem Statement

For all n>1n>1 let f(n)f(n) be the sum of the smallest factor of nn that is not 1 and nn . The computer prints f(2),f(3),f(4),...f(2),f(3),f(4),... with order:4,6,6,...4,6,6,... ( Because f(2)=2+2=4,f(3)=3+3=6,f(4)=4+2=6f(2)=2+2=4,f(3)=3+3=6,f(4)=4+2=6 etc.). In this infinite sequence, how many times will be 2015 2015 and 2016 2016 written? (Explain your answer)