OFFSET
1,1
COMMENTS
If the initial value is n + 1/2 we get A001511.
S(n)=sum(k=1, n, a(k)) seems to be asymptotic to 3*n. S(n)=3n for in A074069.
The sign of 3n-S(n) seems to change often: 3n-S(n) gives A074077. Is 3n-S(n) bounded? - Benoit Cloitre, Sep 05 2002
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 1 if n == 3 (mod 4); a(n) = 2 if n == 5, 6, 12, 13 (mod 16); a(n) = 3 if n == 1, 2, 4, 17, 26, 30, 33, 36, 48, 49, 56, 62 (mod 64);...
MATHEMATICA
ce[n_] := Length[NestWhileList[#*Ceiling[#] &, n + 1/4, ! IntegerQ[#] &]] - 1; ce /@ Range[104] (* Jayanta Basu, Jul 29 2013 *)
PROG
(PARI) a(n)=if(n<0, 0, s=n+1/4; c=0; while(frac(s)>0, s=s*ceil(s); c++); c)
(Haskell)
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
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Aug 30 2002
EXTENSIONS
Corrected by Diego Torres (torresvillarroel(AT)hotmail.com), Aug 31 2002
STATUS
approved