%I M2276 #37 Aug 27 2023 19:44:37
%S 1,3,3,4,7,7,7,9,9,10,13,13,13,15,15,19,19,19,19,21,21,22,27,27,27,27,
%T 27,28,31,31,31,39,39,39,39,39,39,39,39,40,43,43,43,45,45,46,55,55,55,
%U 55,55,55,55,55,55,57,57,58,63,63,63,63,63,64,67,67,67,79,79,79,79
%N Knuth's sequence (or Knuth numbers): a(n+1) = 1 + min( 2*a(floor(n/2)), 3*a(floor(n/3)) ).
%C Record values and where they occur: a(A002977(n-1)) = A002977(n) and a(m) < A002977(n) for m < A002977(n-1). - _Reinhard Zumkeller_, Jul 13 2010
%C A003817 and A179526 are subsequences. - _Reinhard Zumkeller_, Jul 18 2010
%D R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 78.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H T. D. Noe, <a href="/A007448/b007448.txt">Table of n, a(n) for n = 0..1000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/KnuthNumber.html">Knuth Number</a>.
%t a[1] = 1; a[n_] := a[n] = 1 + Min[ 2a[Ceiling[(n - 1)/2]], 3a[Ceiling[(n - 1)/3]]]; Table[ a[n], {n, 72}] (* _Robert G. Wilson v_, Jan 29 2005 *)
%o (Haskell)
%o a007448 n = a007448_list !! n
%o a007448_list = f [0] [0] where
%o f (x:xs) (y:ys) = z : f (xs ++ [2*z,2*z]) (ys ++ [3*z,3*z,3*z])
%o where z = 1 + min x y
%o -- _Reinhard Zumkeller_, Sep 20 2011
%o (Python)
%o def aupton(nn):
%o alst = [1]
%o [alst.append(1 + min(2*alst[n//2], 3*alst[n//3])) for n in range(nn)]
%o return alst
%o print(aupton(70)) # _Michael S. Branicky_, Mar 28 2022
%Y Cf. A002977.
%K easy,nonn,nice
%O 0,2
%A _N. J. A. Sloane_