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.

A085068 Number of steps >= 1 for iteration of map x -> (4/3)*ceiling(x) to reach an integer when started at n, or -1 if no such integer is ever reached.

This page as a plain text file.
%I A085068 #26 Aug 28 2025 11:04:41
%S A085068 1,3,2,1,2,9,1,8,3,1,7,2,1,2,6,1,3,4,1,5,2,1,2,3,1,6,4,1,3,2,1,2,4,1,
%T A085068 5,3,1,4,2,1,2,4,1,3,8,1,4,2,1,2,3,1,4,7,1,3,2,1,2,7,1,4,3,1,9,2,1,2,
%U A085068 6,1,3,6,1,5,2,1,2,3,1,6,5,1,3,2,1,2,8,1,5,3,1,5,2,1,2,5,1,3,4,1,6
%N A085068 Number of steps >= 1 for iteration of map x -> (4/3)*ceiling(x) to reach an integer when started at n, or -1 if no such integer is ever reached.
%C A085068 It is conjectured that an integer is always reached.
%H A085068 J. C. Lagarias and N. J. A. Sloane, Approximate squaring (<a href="http://neilsloane.com/doc/apsq.pdf">pdf</a>, <a href="http://neilsloane.com/doc/apsq.ps">ps</a>), Experimental Math., 13 (2004), 113-128.
%p A085068 f := x->(4/3)*ceil(x); g := proc(n) local t1,c; global f; t1 := f(n); c := 1; while not type(t1, 'integer') do c := c+1; t1 := f(t1); od; RETURN([c,t1]); end;
%p A085068 # second Maple program:
%p A085068 a:= proc(n) local i; n; for i do 4/3*ceil(%);
%p A085068       if %::integer then return i fi od
%p A085068     end:
%p A085068 seq(a(n), n=0..100);  # _Alois P. Heinz_, Mar 01 2021
%t A085068 f[n_] := Block[{c = 1, k = 4 n/3}, While[ ! IntegerQ@k, c++; k = 4 Ceiling@k/3]; c]; Table[f@n, {n, 0, 104}] (* _Robert G. Wilson v_ *)
%o A085068 (Python)
%o A085068 from fractions import Fraction
%o A085068 def A085068(n):
%o A085068     c, x, m = 1, Fraction(4*n,3), Fraction(4,3)
%o A085068     while x.denominator > 1:
%o A085068         x = m*x.__ceil__()
%o A085068         c += 1
%o A085068     return c # _Chai Wah Wu_, Mar 01 2021
%Y A085068 Cf. A085058, A085071, A085328, A085330, A083514.
%K A085068 nonn,changed
%O A085068 0,2
%A A085068 _N. J. A. Sloane_, Aug 11 2003