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 A004019 M3611 #105 Jan 16 2025 11:30:20 %S A004019 0,1,4,25,676,458329,210066388900,44127887745906175987801, %T A004019 1947270476915296449559703445493848930452791204, %U A004019 3791862310265926082868235028027893277370233152247388584761734150717768254410341175325352025 %N A004019 a(0) = 0; for n > 0, a(n) = (a(n-1) + 1)^2. %C A004019 Take the standard rooted binary tree of depth n, with 2^(n+1) - 1 labeled nodes. Here is a picture of the tree of depth 3: %C A004019 R %C A004019 / \ %C A004019 / \ %C A004019 / \ %C A004019 / \ %C A004019 / \ %C A004019 o o %C A004019 / \ / \ %C A004019 / \ / \ %C A004019 o o o o %C A004019 / \ / \ / \ / \ %C A004019 o o o o o o o o %C A004019 Let the number of rooted subtrees be s(n). For example, for n = 1 the s(2) = 4 subtrees are: %C A004019 R R R R %C A004019 / \ / \ %C A004019 o o o o %C A004019 Then s(n+1) = 1 + 2*s(n) + s(n)^2 = (1+s(n))^2 and so s(n) = a(n+1). %D A004019 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %D A004019 Mordechai Ben-Ari, Mathematical Logic for Computer Science, Third edition, 173-203. %H A004019 Reinhard Zumkeller, <a href="/A004019/b004019.txt">Table of n, a(n) for n = 0..11</a> (shortened by _N. J. A. Sloane_, Jan 13 2019) %H A004019 Geir Agnarsson, Elie Alhajjar, and Aleyah Dawkins, <a href="https://arxiv.org/abs/2312.11379">On locally finite ordered rooted trees and their rooted subtrees</a>, arXiv:2312.11379 [math.CO], 2023. %H A004019 A. V. Aho and N. J. A. Sloane, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/11-4/aho-a.pdf">Some doubly exponential sequences</a>, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437. %H A004019 A. V. Aho and N. J. A. Sloane, <a href="/A000058/a000058.pdf">Some doubly exponential sequences</a>, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437 (original plus references that F.Q. forgot to include - see last page!) %H A004019 Andressa Paola Cordeiro, Alexandre Tavares Baraviera, and Alex Jenaro Becker, <a href="https://arxiv.org/abs/2307.05850">Entropy for k-trees defined by k transition matrices</a>, arXiv:2307.05850 [math.DS], 2023. See p. 15. %H A004019 F. Disanto and N. A. Rosenberg, <a href="https://doi.org/10.1089/cmb.2016.0159">Enumeration of ancestral configurations for matching gene trees and species trees</a>, J. Comput. Biol. 24 (2017), 831-850. %H A004019 E. Lappo and N. A. Rosenberg, <a href="https://doi.org/10.1016/j.dam.2023.09.033">A lattice structure for ancestral configurations arising from the relationship between gene trees and species trees</a>, Adv. Appl. Math. 343 (2024), 65-81. %H A004019 R. P. Stanley, <a href="/A003277/a003277.pdf">Letter to N. J. A. Sloane, c. 1991</a> %H A004019 Elmar Teufl and Stephan Wagner, <a href="http://dx.doi.org/10.1016/j.jcta.2007.01.007">Enumeration problems for classes of self-similar graphs</a>, Journal of Combinatorial Theory, Series A, Volume 114, Issue 7, October 2007, Pages 1254-1277. %H A004019 Wikipedia, <a href="https://en.wikipedia.org/wiki/Herbrand_structure">Herbrand Structure</a> %H A004019 Damiano Zanardini, <a href="http://costa.fdi.ucm.es/~damiano/teaching/emcl/cl_08_09/slides/12lprog.pdf">Computational Logic</a>, UPM European Master in Computational Logic (EMCL) School of Computer Science Technical University of Madrid. %H A004019 <a href="/index/Aa#AHSL">Index entries for sequences of form a(n+1)=a(n)^2 + ...</a> %H A004019 <a href="/index/Ro#rooted">Index entries for sequences related to rooted trees</a> %F A004019 a(n) = A003095(n)^2 = A003095(n+1) - 1 = A056207(n+1) + 1. %F A004019 It follows from Aho and Sloane that there is a constant c such that a(n) is the nearest integer to c^(2^n). In fact a(n+1) = nearest integer to b^(2^n) - 1 where b = 2.25851845058946539883779624006373187243427469718511465966.... - _Henry Bottomley_, Aug 30 2005 %F A004019 a(n) is the number of root ancestral configurations for fully symmetric matching gene trees and species trees with 2^n leaves, a(n) = A355108(2^n). - _Noah A Rosenberg_, Jun 22 2022 %t A004019 Table[Nest[(1 + #)^2 &, 0, n], {n, 0, 12}] (* _Vladimir Joseph Stephan Orlovsky_, Jul 20 2011 *) %t A004019 NestList[(#+1)^2&,0,10] (* _Harvey P. Dale_, Oct 08 2011 *) %o A004019 (Haskell) %o A004019 a004019 n = a004019_list !! n %o A004019 a004019_list = iterate (a000290 . (+ 1)) 0 %o A004019 -- _Reinhard Zumkeller_, Feb 01 2013 %o A004019 (Magma) [n le 1 select 0 else (Self(n-1)+1)^2: n in [1..15]]; // _Vincenzo Librandi_, Oct 05 2015 %o A004019 (PARI) a(n) = if(n==0, 0, (a(n-1) + 1)^2); %o A004019 vector(20, n, a(n-1)) \\ _Altug Alkan_, Oct 06 2015 %Y A004019 Cf. A001699, A056207. %Y A004019 Cf. A000290. %Y A004019 Cf. A003095, A091980, A355108. %K A004019 nonn,easy,nice %O A004019 0,3 %A A004019 _N. J. A. Sloane_ %E A004019 One more term from _Henry Bottomley_, Jul 24 2000 %E A004019 Additional comments from _Max Alekseyev_, Aug 30 2005