MathDB
Sequence

Source: Putnam 1991

May 23, 2006

Problem Statement

For each integer n0n\geq0, let S(n)=nm2S(n)=n-m^2, where mm is the greatest integer with m2nm^2\leq n. Define a sequence by a0=Aa_0=A and ak+1=ak+S(ak)a_{k+1}=a_k+S(a_k) for k0k\geq0. For what positive integers AA is this sequence eventually constant?