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.
%I A244160 #26 Aug 23 2021 18:42:39 %S A244160 0,1,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, %T A244160 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, %U A244160 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,6 %N A244160 a(0)=0, and for n >= 1, a(n) = the largest k such that k-th Catalan number <= n. %C A244160 Apart from 0, each n occurs A000245(n) times. %C A244160 For n >= 1, a(n) gives the largest k such that C(k) <= n, where C(k) stands for the k-th Catalan number, A000108(k). %H A244160 Michael De Vlieger, <a href="/A244160/b244160.txt">Table of n, a(n) for n = 0..4861</a> %F A244160 a(0) = 0, and for n>=1, a(n) = A081288(n)-1. %F A244160 For all n>=1, A000108(a(n)) = A081290(n). %e A244160 For n=1, the largest k such that C(k) <= 1 is 1, thus a(1) = 1. %e A244160 For n=2, the largest k such that C(k) <= 2 is 2, thus a(2) = 2. %e A244160 For n=3, the largest k such that C(k) <= 3 is 2, thus a(3) = 2. %e A244160 For n=4, the largest k such that C(k) <= 4 is 2, thus a(4) = 2. %e A244160 For n=5, the largest k such that C(k) <= 5 is 3, thus a(5) = 3. %t A244160 MapIndexed[ConstantArray[First@ #2 - 1, #1] &, Differences@ Array[CatalanNumber, 8, 0]] /. {} -> {0} // Flatten (* _Michael De Vlieger_, Jun 08 2017 *) %t A244160 Join[{0},Table[PadRight[{},CatalanNumber[n+1]-CatalanNumber[n],n],{n,6}]// Flatten] (* _Harvey P. Dale_, Aug 23 2021 *) %o A244160 (Scheme) (define (A244160 n) (if (zero? n) n (- (A081288 n) 1))) %o A244160 (Python) %o A244160 from sympy import catalan %o A244160 def a(n): %o A244160 if n==0: return 0 %o A244160 i=1 %o A244160 while True: %o A244160 if catalan(i)>n: break %o A244160 else: i+=1 %o A244160 return i - 1 %o A244160 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 08 2017 %Y A244160 After zero, one less than A081288. %Y A244160 Cf. A000108, A000245, A081290, A014418, A239903, A244215, A244159, A236859, A126307. %K A244160 nonn %O A244160 0,3 %A A244160 _Antti Karttunen_, Jun 23 2014