A079438 a(0) = a(1) = 1, a(n) = 2*(floor((n+1)/3) + (if n >= 14) (floor((n-10)/4) + floor((n-14)/8))).
1, 1, 2, 2, 2, 4, 4, 4, 6, 6, 6, 8, 8, 8, 12, 12, 12, 14, 16, 16, 18, 18, 22, 24, 24, 24, 28, 28, 28, 30, 34, 34, 36, 36, 38, 40, 40, 40, 46, 46, 46, 48, 50, 50, 52, 52, 56, 58, 58, 58, 62, 62, 62, 64, 68, 68, 70, 70, 72, 74, 74, 74, 80, 80, 80, 82, 84, 84, 86, 86, 90, 92, 92, 92
Offset: 0
Keywords
References
- D. E. Knuth, The Art of Computer Programming, Volume 4, Fascicle 4: Generating All Trees--History of Combinatorial Generation, vi+120pp. ISBN 0-321-33570-8 Addison-Wesley Professional; 1ST edition (Feb 06, 2006).
Links
- G. C. Greubel, Table of n, a(n) for n = 0..10000
- R. Donaghey, Automorphisms on Catalan trees and bracketing, J. Combin. Theory, Series B, 29 (1980), 75-90.
- A. Karttunen, C-program for counting the initial terms of this sequence (empirically)
- A. Karttunen, Illustration of initial terms for trees of sizes n=2..18
- A. Karttunen, On the fixed points of A071661 (Notes in OEIS Wiki)
- D. E. Knuth, Pre-Fascicle 4a: Generating All Trees, Exercise 17, 7.2.1.6.
Crossrefs
Programs
-
Maple
A079438 := n -> `if`((n<2),1,2*(floor((n+1)/3) + `if`((n>=14),floor((n-10)/4)+floor((n-14)/8),0)));
-
Mathematica
a[0]:= 1; a[1]:= 1; a[n_]:= a[n] = 2*Floor[(n+1)/3] +2*If[ n >= 14, (Floor[(n-10)/4] +Floor[(n-14)/8]), 0]; Table[a[n], {n, 0, 100}] (* G. C. Greubel, Jan 18 2019 *)
-
PARI
{a(n) = if(n==0, 1, if(n==1, 1, 2*floor((n+1)/3) + 2*if(n >= 14, floor( (n-10)/4) + floor((n-14)/8), 0)))}; \\ G. C. Greubel, Jan 18 2019
Formula
a(0) = a(1) = 1, a(n) = 2*(floor((n+1)/3) + (if n >= 14) (floor((n-10)/4) + floor((n-14)/8))).
Extensions
Entry edited (the definition replaced by a formula, the old definition moved to the comments) - Antti Karttunen, Dec 13 2017
Comments