login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A249160 Smallest number of iterations k such that A068527^(k)(n)=A068527^(k+1)(n). 1
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

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.

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.

LINKS

Table of n, a(n) for n=1..100.

EXAMPLE

R(10) = 6, R(6) = 3, R(3) = 1, R(1) = 0, R(0) = 0. Thus a(10) = 4.

MAPLE

A249160 := proc(n)

    local k, prev, this;

    prev := n ;

    for k from 1 do

        this := A068527(prev) ;

        if this = prev then

            return k-1;

        end if;

        prev := this ;

    end do:

end proc:

seq(A249160(n), n=1..80) ; # R. J. Mathar, Nov 17 2014

MATHEMATICA

r[n_]:=Ceiling[Sqrt[n]]^2-n; Table[Length[FixedPointList[r, n]]-2, {n, 1, 100}]

PROG

(PARI) r(n)=if(issquare(n), 0, (sqrtint(n)+1)^2-n);

le(n)=b=0; while(n!=0&&n!=2, b=b+1; n=r(n)); return(b);

range(n) = c=List(); for(a = 1, n, listput(c, a)); return(c);

apply(le, range(100))

CROSSREFS

Cf. A068527.

Sequence in context: A082691 A280052 A183198 * A269970 A252230 A036043

Adjacent sequences:  A249157 A249158 A249159 * A249161 A249162 A249163

KEYWORD

nonn,easy

AUTHOR

Valtteri Raiko, Oct 22 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 3 04:21 EDT 2020. Contains 333195 sequences. (Running on oeis4.)