1,6

Iterating A067565 will always result in a perfect square, because all fixed points are squares, and A067565(n) <= n all n.

a(n) = 0 if and only if n is a perfect square.

a(n) = 1 if and only if n is prime.

Peter Kagey, Table of n, a(n) for n = 1..5000

Let g(n) = A067565(n)

a(12) = 3 because g(g(g(12))) = g(g(6)) = g(3) = 0, which is a perfect square.

(Ruby)

def a(n)

c = 0

n = a067565(n) while n.is_nonsquare? && c += 1

c

end

Cf. A067565.

Sequence in context: A115862 A296030 A270144 * A029357 A118054 A322019

Adjacent sequences: A255977 A255978 A255979 * A255981 A255982 A255983

nonn

Peter Kagey, Mar 12 2015

approved