OFFSET
0,3
COMMENTS
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..1000
FORMULA
PROG
(Scheme, with memoizing definec-macro from Antti Karttunen's IntSeq-library)
;; Version based on direct recurrence:
(definec (A244161 n) (if (zero? n) n (+ (expt 4 (- (A244160 n) 1)) (A244161 (- n (A000108 (A244160 n)))))))
(Python)
from sympy import catalan
def a244160(n):
if n==0: return 0
i=1
while True:
if catalan(i)>n: break
else: i+=1
return i - 1
def a(n):
if n==0: return 0
x=a244160(n)
return 4**(x - 1) + a(n - catalan(x))
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 08 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 23 2014
STATUS
approved