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.

A090529 a(n) is the smallest positive m such that n <= m!.

Original entry on oeis.org

1, 1, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
Offset: 0

Views

Author

Amarnath Murthy, Dec 07 2003

Keywords

Comments

Define f(n,k) = floor[n/k]. Let f(n,2)= n_2, f(n_2,3) = n_3, ..., f(n_r, r+1) = n_(r+1). a(n) = least value of r such that n_r = 0. E.g., a(10) = 4, 10 -> 10/1 -> 10 -> 10/2 -> 5 -> 5/3 -> 1 -> 1/4 -> 0 in four steps.

Examples

			a(4)=3 because 2! < 4 <= 3!;
a(24)=4 because 3! < 24 <= 4!.
		

Crossrefs

Programs

  • Haskell
    a090529 n = a090529_list !! n
    a090529_list = f 1 1 0 where
      f w v u = if u <= w then v : f w v (u+1) else v' : f (w*v') v' (u+1)
                where v' = v + 1
    -- Reinhard Zumkeller, Jan 05 2014
  • Maple
    A090529 := proc(n)
        local a;
        for a from 1 do
            if a! >= n then
                return a;
            end if;
        end do:
    end proc:
    seq(A090529(n),n=0..100) ; # R. J. Mathar, Apr 06 2022
  • Mathematica
    Array[Block[{m = 1}, While[# > m!, m++]; m] &, 105, 0] (* Michael De Vlieger, Nov 18 2017 *)
    With[{f=Table[{m,m!},{m,10}]},Table[Select[f,#[[2]]>=n&][[1]],{n,0,110}]][[All,1]] (* Harvey P. Dale, Jan 01 2020 *)
  • PARI
    a(n)=if(n<0,0,p=1;while(p!
    				
  • PARI
    A090529(n)=for(m=1,n,m!M. F. Hasler, Jan 16 2013
    

Formula

a(n+1) = A084558(n) + 1. - Reinhard Zumkeller, Jan 05 2014

Extensions

Better description and more terms from Zhang Wenpeng (wpzhang(AT)nwu.edu.cn), Mar 29 2004