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.
%I A294656 #17 Nov 06 2017 13:14:34 %S A294656 3,3,4,2,4,3,3,6,5,7,3,2,4,4,4,3,3,6,5,3,3,3,4,4,4,3,3,4,4,3,3,3,3,4, %T A294656 4,3,3,5,5,5,3,3,3,4,5,3,3,4,6,5,3,3,4,4,4,3,3,6,3,6,3,3,4,4,4,3,3,7, %U A294656 3,5,3,3,4,5,4,3,3,6,4,4,3,3,4,4,3,3,3,4,8,6,3 %N A294656 Size of the orbit of n under iteration of the map A125256: x -> smallest odd prime divisor of n^2+1. %C A294656 The orbit or trajectory under A125256 appears to end in the cycle 5 -> 13 -> 5 -> etc. for any initial value n. %C A294656 Sequence A294658 gives the number of steps to reach either 5 or 13, i.e. an element of this terminating cycle. Therefore a(n) (which counts these two elements as well as the initial value) is 2 more than A294658(n) for all n. This is confirmed by careful examination of special cases - assuming, of course, that all trajectories end in the cycle (5, 13). %H A294656 Ray Chandler, <a href="/A294656/b294656.txt">Table of n, a(n) for n = 2..20001</a> %F A294656 a(n) = A294658(n) + 2. %e A294656 For n = 1 the map A125256 is not defined. %e A294656 a(2) = 3 = # { 2, 5, 13 }, because under A125256, 2 -> 2^2+1 = 5 (= its smallest odd prime factor), 5 -> least odd prime factor(5^2+1 = 26) = 13, 13 -> least odd prime factor(13^2 + 1 = 170 = 2*5*17) = 5, etc. %e A294656 a(3) = 3 = # { 3, 5, 13 }, because under A125256, 3 -> smallest odd prime factor(3^2+1 = 10) = 5, 5 -> 13, 13 -> 5 etc. %e A294656 a(4) = 4 = # { 4, 17, 5, 13 }, because under A125256, 4 -> 4^2+1 = 17 (= its smallest odd prime factor), 17 -> smallest odd prime factor(17^2+1 = 290 = 2*5*29) = 5, 5 -> 13, 13 -> 5 etc. %o A294656 (PARI) A294656(n,f=A125256,S=[n])={while(#S<#S=setunion(S,[n=f(n)]),); #S} \\ Does not assume the terminating cycle is (5, 13): also works correctly in case there are other terminating cycles. %Y A294656 Cf. A125256, A294657: largest number in the orbit, A294658: number of steps to reach the cycle (5, 13). %K A294656 nonn %O A294656 2,1 %A A294656 _M. F. Hasler_, Nov 06 2017