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.

A249160 Smallest number of iterations k such that A068527^(k)(n)=A068527^(k+1)(n).

This page as a plain text file.
%I A249160 #11 Nov 18 2014 03:26:29
%S A249160 1,0,2,1,2,3,1,2,1,4,3,2,3,1,2,1,3,2,4,3,2,3,1,2,1,5,2,3,2,4,3,2,3,1,
%T A249160 2,1,3,4,5,2,3,2,4,3,2,3,1,2,1,2,4,3,4,5,2,3,2,4,3,2,3,1,2,1,2,3,2,4,
%U A249160 3,4,5,2,3,2,4,3,2,3,1,2,1,3,4,2,3,2,4,3,4,5,2,3,2,4,3,2,3,1,2,1
%N A249160 Smallest number of iterations k such that A068527^(k)(n)=A068527^(k+1)(n).
%C A249160 Given a number n, denote its distance from next perfect square >= n as R(n), sequence A068527. The function R(n) has two fixed points, 0 and 2, and for all n>=3, R(n)<n. Thus for any n>=0, there exists a k>=0 such that R^(k)(n)=R^(k+1)(n)=0 or 2. This sequence gives the number of iterations needed to reach the fixed point starting at n.
%C A249160 This sequence is unbounded, but grows very slowly, reaching records of 1, 2, 3, 4, 6 etc at n=1, 3, 6, 10, 26, 170, 7226, etc.
%e A249160 R(10) = 6, R(6) = 3, R(3) = 1, R(1) = 0, R(0) = 0. Thus a(10) = 4.
%p A249160 A249160 := proc(n)
%p A249160     local k,prev,this;
%p A249160     prev := n ;
%p A249160     for k from 1 do
%p A249160         this := A068527(prev) ;
%p A249160         if this = prev then
%p A249160             return k-1;
%p A249160         end if;
%p A249160         prev := this ;
%p A249160     end do:
%p A249160 end proc:
%p A249160 seq(A249160(n),n=1..80) ; # _R. J. Mathar_, Nov 17 2014
%t A249160 r[n_]:=Ceiling[Sqrt[n]]^2-n;Table[Length[FixedPointList[r,n]]-2,{n,1,100}]
%o A249160 (PARI) r(n)=if(issquare(n),0,(sqrtint(n)+1)^2-n);
%o A249160 le(n)=b=0;while(n!=0&&n!=2,b=b+1;n=r(n));return(b);
%o A249160 range(n) = c=List(); for(a = 1, n, listput(c,a)); return(c);
%o A249160 apply(le, range(100))
%Y A249160 Cf. A068527.
%K A249160 nonn,easy
%O A249160 1,3
%A A249160 _Valtteri Raiko_, Oct 22 2014