1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 7, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1
Offset: 1
A068119
Number of steps to reach an integer starting with n + 1/4 and iterating the map x -> x*ceiling(x).
Original entry on oeis.org
3, 3, 1, 3, 2, 2, 1, 7, 4, 4, 1, 2, 2, 4, 1, 6, 3, 5, 1, 5, 2, 2, 1, 4, 6, 3, 1, 2, 2, 3, 1, 7, 3, 4, 1, 3, 2, 2, 1, 7, 4, 7, 1, 2, 2, 5, 1, 3, 3, 10, 1, 4, 2, 2, 1, 3, 5, 11, 1, 2, 2, 3, 1, 5, 3, 3, 1, 3, 2, 2, 1, 4, 4, 6, 1, 2, 2, 4, 1, 4, 3, 6, 1, 6, 2, 2, 1, 6, 7, 3, 1, 2, 2, 3, 1, 4, 3, 5, 1, 3, 2, 2, 1, 4
Offset: 1
-
import Data.Ratio ((%), denominator)
a068119 n = fst $ until ((== 1) . denominator . snd)
(\(i, x) -> (i + 1, f x)) (0, fromInteger n + 1%4)
where f x = x * fromIntegral (ceiling x)
-- Reinhard Zumkeller, May 26 2013
-
ce[n_] := Length[NestWhileList[#*Ceiling[#] &, n + 1/4, ! IntegerQ[#] &]] - 1; ce /@ Range[104] (* Jayanta Basu, Jul 29 2013 *)
-
a(n)=if(n<0,0,s=n+1/4; c=0; while(frac(s)>0,s=s*ceil(s); c++); c)
Corrected by Diego Torres (torresvillarroel(AT)hotmail.com), Aug 31 2002
A072340
Number of steps to reach an integer starting with n/3 and iterating the map x -> x*ceiling(x), or -1 if no integer is ever reached.
Original entry on oeis.org
0, 2, 6, 0, 1, 1, 0, 5, 2, 0, 3, 2, 0, 1, 1, 0, 2, 4, 0, 3, 4, 0, 1, 1, 0, 22, 7, 0, 2, 5, 0, 1, 1, 0, 7, 2, 0, 4, 2, 0, 1, 1, 0, 2, 5, 0, 13, 9, 0, 1, 1, 0, 3, 3, 0, 2, 3, 0, 1, 1, 0, 3, 2, 0, 5, 2, 0, 1, 1, 0, 2, 3, 0, 8, 3, 0, 1, 1, 0, 5, 4, 0, 2, 4, 0, 1, 1, 0, 14, 2, 0, 3, 2, 0, 1, 1, 0, 2, 9, 0, 3, 9, 0, 1, 1
Offset: 3
- N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.
-
g := proc(x) local M,t1,t2,t3; M := 3^100; t1 := ceil(x) mod M; t2 := x*t1; t3 := numer(t2) mod M; t3/denom(t2); end;
f := proc(n) local t1,c; global g; if type(n, 'integer') then RETURN(0); fi; t1 := g(n); c := 1; while not type(t1, 'integer') do c := c+1; t1 := g(t1); od; RETURN(c); end;
[seq(f(n/3),n=3..120)]; # this gives the correct answer as long as the answer is < 99.
-
a[n_] := Module[{x = n/3, s = 0}, While[!IntegerQ[x], x *= Ceiling[x]; s++]; s]; Table[a[n], {n, 3, 107}] (* Jean-François Alcover, Jan 27 2019, from PARI *)
-
A072340(n)={ local(x,s) ; x=n/3 ; s=0 ; while( type(x)!="t_INT", x *= ceil(x) ; s++ ; ) ; return(s) ; } { for(n=3,10000, print(n," ",A072340(n)) ; ) ; } \\ R. J. Mathar, Nov 25 2006
A073341
Number of steps to reach an integer starting with (2n+1)/4 and iterating the map x -> x*ceiling(x).
Original entry on oeis.org
3, 2, 3, 8, 1, 1, 3, 2, 2, 3, 2, 2, 1, 1, 7, 4, 4, 2, 4, 3, 1, 1, 2, 4, 2, 8, 4, 3, 1, 1, 6, 4, 3, 2, 5, 4, 1, 1, 5, 2, 2, 3, 2, 2, 1, 1, 4, 5, 6, 2, 3, 5, 1, 1, 2, 3, 2, 4, 3, 6, 1, 1, 7, 8, 3, 2, 4, 5, 1, 1, 3, 2, 2, 3, 2, 2, 1, 1, 7, 3, 4, 2, 7, 6, 1, 1, 2, 5, 2, 5, 5, 3, 1, 1, 3, 3, 3, 2, 10, 3, 1, 1, 4, 2, 2
Offset: 2
-
g := proc(x) local M,t1,t2,t3; M := 4^100; t1 := ceil(x) mod M; t2 := x*t1; t3 := numer(t2) mod M; t3/denom(t2); end;
a := []; for n from 2 to 150 do t1 := (2*n+1)/4; for i from 1 to 100 do t1 := g(t1); if type(t1,`integer`) then break; fi; od: a := [op(a),i]; od: a;
-
a[n_] := Length @ NestWhileList[# Ceiling[#]&, (2n+1)/4, !IntegerQ[#]&] - 1;
Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Jan 31 2023 *)
-
a(n)=if(n<1,0,s=n/2+1/4; c=0; while(frac(s)>0,s=s*ceil(s); c++); c) \\ Benoit Cloitre, Sep 05 2002
A081849
Consider recurrence b(0) = (2n+1)/2, b(n) = b(0)*ceiling(b(n-1)); sequence gives first integer reached.
Original entry on oeis.org
3, 20, 14, 468, 33, 299, 60, 47328, 95, 1218, 138, 25475, 189, 3161, 248, 20830128, 315, 6512, 390, 181138, 473, 11655, 564, 9015167, 663, 18974, 770, 671745, 885, 28853, 1008, 38906570560, 1139, 41676, 1278, 1799888, 1425, 57827, 1580, 110341278, 1743, 77690
Offset: 1
-
Digits := 100: c := ceil; A081849 := proc(a) local i,t0,t; t0 := a; t := 0; for i from 1 to 100 do if whattype(t0) <> integer then t0 := a*c(t0); t := t+1; else RETURN(t0); fi; od; RETURN('FAIL'); end;
-
a[n_]:=Module[{b=b0=(2n+1)/2},While[!IntegerQ[b],b=b0*Ceiling[b]]; b]; Array[a,42] (* Stefano Spezia, Jun 26 2024 *)
-
a(n) = if(n==1,3, my(t=2*n+1, k=1+valuation(n,2)); n*t^(k+1) >>k \ (t-2)); \\ Kevin Ryde, Jun 30 2024
-
from math import ceil
from fractions import Fraction
def a(n):
b0 = b = Fraction((2*n+1), 2)
while b.denominator != 1: b = b0*ceil(b)
return b.numerator
print([a(n) for n in range(1, 43)]) # Michael S. Branicky, Mar 20 2021
A075102
Number of steps to reach the first integer starting with 2^n/n and iterating the map x->x*ceiling(x), or -1 if no integer is ever reached.
Original entry on oeis.org
0, 0, 1, 0, 2, 5, 5, 0, 2, 4, 1, 1, 13, 12, 3, 0, 19, 3, 4, 8, 10, 11, 20, 1, 7, 1, 3, 8, 12, 1, 2, 0, 20, 6, 4, 7, 8, 23, 39, 1, 21, 8, 13, 16, 4, 1, 9, 7, 1, 6, 23, 30, 73, 6, 3, 14, 7, 7, 20, 12, 228, 16, 3, 0, 10, 5, 96, 3, 4, 13, 28, 3, 72, 57, 7, 9, 6, 6
Offset: 1
a(5)=2 since (2^5)/5 = 32/5 -> 224/5 -> 2016 = A075103(5).
- J. C. Lagarias and N. J. A. Sloane, Approximate squaring (pdf, ps), Experimental Math., 13 (2004), 113-128.
A081853
Consider recurrence b(0) = (2n+1)/2, b(n) = b(n-1)*ceiling(b(n-1)); sequence gives first integer reached.
Original entry on oeis.org
3, 60, 14, 268065, 33, 2093, 60, 1204154941925628, 95, 13398, 138, 701600900, 189, 47415, 248, 1489788110004539889867929328515560588293, 315, 123728, 390, 34427225343, 473, 268065, 564, 19873182780430314444725, 663, 512298, 770, 467193780498, 885, 894443, 1008
Offset: 1
- J. C. Lagarias and N. J. A. Sloane, Approximate squaring (pdf, ps), Experimental Math., 13 (2004), 113-128.
-
a[n_]:=Module[{b=(2n+1)/2},While[!IntegerQ[b],b*=Ceiling[b]]; b]; Array[a,31] (* Stefano Spezia, Jun 26 2024 *)
A081850
Consider recurrence b(0) = (2n+1)/4, b(n) = b(0)*ceiling(b(n-1)); sequence gives number of steps to reach an integer (or -1 if no integer is ever reached).
Original entry on oeis.org
3, 2, 3, 13, 1, 1, 4, 2, 2, 9, 2, 2, 1, 1, 7, 3, 7, 3, 4, 3, 1, 1, 2, 4, 5, 10, 5, 13, 1, 1, 14, 8, 5, 2, 10, 11, 1, 1, 6, 2, 2, 17, 2, 2, 1, 1, 3, 6, 16, 5, 3, 4, 1, 1, 2, 4, 7, 9, 4, 3, 1, 1, 15, 9, 4, 2, 7, 5, 1, 1, 3, 2, 2, 3, 2, 2, 1, 1, 5, 5, 6, 5, 6, 4, 1, 1, 2, 4, 4, 3, 3, 11, 1, 1, 3, 3, 7, 2, 4
Offset: 2
-
Digits := 100: c := ceil; A081850 := proc(a) local i,t0,t; t0 := a; t := 0; for i from 1 to 100 do if whattype(t0) <> integer then t0 := a*c(t0); t := t+1; else RETURN(t); fi; od; RETURN('FAIL'); end;
Comments