cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A255980 Number of iterations of A067565 required to reach a perfect square.

This page as a plain text file.
%I A255980 #13 Mar 23 2015 14:17:38
%S A255980 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,
%T A255980 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,
%U A255980 3,8,1,8,1,2,8,4,8,6,1,7,0,2,1,9,5,2,3
%N A255980 Number of iterations of A067565 required to reach a perfect square.
%C A255980 Iterating A067565 will always result in a perfect square, because all fixed points are squares, and A067565(n) <= n all n.
%C A255980 a(n) = 0 if and only if n is a perfect square.
%C A255980 a(n) = 1 if and only if n is prime.
%H A255980 Peter Kagey, <a href="/A255980/b255980.txt">Table of n, a(n) for n = 1..5000</a>
%e A255980 Let g(n) = A067565(n)
%e A255980 a(12) = 3 because g(g(g(12))) = g(g(6)) = g(3) = 0, which is a perfect square.
%o A255980 (Ruby)
%o A255980 def a(n)
%o A255980   c = 0
%o A255980   n = a067565(n) while n.is_nonsquare? && c += 1
%o A255980   c
%o A255980 end
%Y A255980 Cf. A067565.
%K A255980 nonn
%O A255980 1,6
%A A255980 _Peter Kagey_, Mar 12 2015