login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A255980
Number of iterations of A067565 required to reach a perfect square.
1
0, 1, 1, 0, 1, 2, 1, 2, 0, 2, 1, 3, 1, 2, 3, 0, 1, 3, 1, 4, 3, 2, 1, 4, 0, 2, 4, 4, 1, 5, 1, 5, 3, 2, 5, 0, 1, 2, 3, 5, 1, 6, 1, 4, 6, 2, 1, 6, 0, 6, 3, 4, 1, 7, 5, 7, 3, 2, 1, 7, 1, 2, 7, 0, 5, 6, 1, 4, 3, 8, 1, 8, 1, 2, 8, 4, 8, 6, 1, 7, 0, 2, 1, 9, 5, 2, 3
OFFSET
1,6
COMMENTS
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.
EXAMPLE
Let g(n) = A067565(n)
a(12) = 3 because g(g(g(12))) = g(g(6)) = g(3) = 0, which is a perfect square.
PROG
(Ruby)
def a(n)
c = 0
n = a067565(n) while n.is_nonsquare? && c += 1
c
end
CROSSREFS
Cf. A067565.
Sequence in context: A115862 A296030 A270144 * A029357 A118054 A322019
KEYWORD
nonn
AUTHOR
Peter Kagey, Mar 12 2015
STATUS
approved