OFFSET
0,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 0..10000
EXAMPLE
a(7) = 6 because 6! = 720 > 2^7 = 128, but 5! = 120 < 128.
MATHEMATICA
a[n_] := Block[{v=2^n, k=1}, While[++k! <= v]; k]; Array[a, 93, 0] (* Giovanni Resta, Jul 11 2016 *)
Module[{nn=30, f}, f=Table[{k, k!}, {k, nn}]; Table[SelectFirst[f, #[[2]]>2^n&], {n, 0, 100}]][[;; , 1]] (* Harvey P. Dale, Feb 19 2024 *)
PROG
(Python)
def a269225():
...k = 1
...f = 1
...p = 1
...n = 0
...while True:
......while f<=p:
.........k += 1
.........f *= k
......yield k
......p *= 2
......n += 1
(PARI) a(n)=localprec(19); my(t=log(2)*n, x=ceil(solve(k=1, n/2+5, lngamma(k+1)-t))); while(x!<=2^n, x++); x \\ Charles R Greathouse IV, Jul 12 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Christian Perfect, Jul 11 2016
STATUS
approved