A367433 Number of successive Patcail predecessors of n-th binary tree.
0, 1, 2, 5, 3, 6, 4
Offset: 0
Keywords
Examples
a(3)=5, since the 3rd binary tree is [[0,0],0] and its 5 successive Patcail predecessors are [[0,0],[0,0]], [0,[0,[0,0]]], [0,[0,0]], [0,0], and 0: Index n 3 6 4 2 1 0 A014486(n) 12 50 42 10 2 0 A063171(n) 1100 110010 101010 1010 10 0 Tree [[0,0],0] [[0,0],[0,0]] [0,[0,[0,0]]] [0,[0,0]] [0,0] 0 A367433(n) 5 4 3 2 1 0
Links
Programs
-
Haskell
data T = N | C T T deriving (Eq,Show) a014486 = [0..] >>= at where at 0 = [N] at n = [C s t | (ns,s) <- to$n-1, t <- at$n-1-ns] to n = (0,N):[(1+ns+nt,C s t)|n>0,(ns,s)<-to$n-1,(nt,t)<-to$n-1-ns] predT (C N t) = t predT (C s t) = go u where u = [predT s) t go v = if v==t then u else case v of N -> N C s t -> [go s) (go t) a367433 = map nPred a014486 where nPred N = 0 nPred t = 1 + nPred (predT t)
Comments