# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a011784 Showing 1-1 of 1 %I A011784 #109 Apr 25 2024 10:41:29 %S A011784 1,2,2,3,4,7,14,42,213,2837,175450,139759600,6837625106787, %T A011784 266437144916648607844,508009471379488821444261986503540, %U A011784 37745517525533091954736701257541238885239740313139682,5347426383812697233786139576220450142250373277499130252554080838158299886992660750432 %N A011784 Levine's sequence. First construct a triangle as follows. Row 1 is {1,1}; if row n is {r_1, ..., r_k} then row n+1 consists of {r_k 1's, r_{k-1} 2's, r_{k-2} 3's, etc.}; sequence consists of the final elements in each row. %D A011784 Richard K. Guy, Unsolved Problems in Number Theory, Section E25. %D A011784 R. K. Guy, What's left?, in The Edge of the Universe: Celebrating Ten Years of Math Horizons, Deanna Haunsperger, Stephen Kennedy (editors), 2006, p. 81. %H A011784 Johan Claes, Table of n, a(n) for n = 1..19 %H A011784 Johnson Ihyeh Agbinya, Computer Board Games of Africa, (2004), see pages 113-114. %H A011784 R. K. Guy, What's left?, Math Horizons, Vol. 5, No. 4 (April 1998), pp. 5-7. %H A011784 Roland Miyamoto, Polynomial parametrisation of the canonical iterates to the solution of -gamma*g' = g^(-1), arXiv:2402.06618 [math.CO], 2024. See pp. 16-17. %H A011784 N. J. A. Sloane, My favorite integer sequences, in Sequences and their Applications (Proceedings of SETA '98). %H A011784 N. J. A. Sloane and Brady Haran, The Levine Sequence, Numberphile video (2021) %H A011784 N. J. A. Sloane, Colin Mallows, and Bjorn Poonen, Discussion of A011784. [Scans of pages 150-155 and 164 of my notebook "Lattices 77", from June-July 1997.] %F A011784 Additional remarks: The sequence is generated by this array, the final term in each row forming the sequence: %F A011784 1 1 %F A011784 1 2 %F A011784 1 1 2 %F A011784 1 1 2 3 %F A011784 1 1 1 2 2 3 4 %F A011784 1 1 1 1 2 2 2 3 3 4 4 5 6 7 %F A011784 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 7 7 7 8 8 9 9 10 10 11 12 13 14 %F A011784 ... %F A011784 where we start with the first row {1 1} and produce the rest of the array recursively as follows: %F A011784 Suppose line n is {a_1, ..., a_k}; then line n+1 contains a_k 1's, a_{k-1} 2's, etc. %F A011784 So the fifth line contains three 1's, two 2's, one 3 and one 4. %F A011784 The sequence is 1,2,2,3,4,7,14,42,213,2837,175450,..., %F A011784 where the n-th term a(n) is the sum of the elements in row n-2 %F A011784 = the number of elements in row n-1 %F A011784 = the last element in row n %F A011784 = the number of 1's in row n+1 %F A011784 = ... %F A011784 If the n-th row is r_{n,i} then %F A011784 Sum_{i=1..f(n+1)} (a(n+1) - i + 1)*r_{n,i} ) = a(n+3) %F A011784 Let {a( )} be the sequence; s(i,j) = j-th partial sum of the i-th row, %F A011784 L(i) is the length of that row and S(i) = its sum. Then %F A011784 L(i+1) = a(i+2) = S(i) = s(i,a(i+1)); %F A011784 L(i+2) = SUM(s(i,j)); %F A011784 L(i+3) = SUM(s(i,j)*(1+s(i,j))/2) (_Allan Wilks_). %F A011784 Eric Rains and Bjorn Poonen have shown (June 1997) that the log of the n-th term is asymptotic to constant times phi^n, where phi = golden number. %F A011784 This follows from the inequalities S(n) <= a(n)L(n) and S(n+1) >= ([L(n+1)/a(n)]+1) choose 2)*a(n). See N. J. A. Sloane et al., Scans of Notebook pages. %F A011784 The n-th term is approximately exp(a*phi^n)/I, where phi = golden number, a = .05427 (last digit perhaps 6 or 8), I = .277 (last digit perhaps 6 or 8) (Colin Mallows). %F A011784 a(n+2) = n-th row sum of A012257; e.g., 5th row of A012257 is {1, 1, 1, 2, 2, 3, 4} and the sum of elements is 1+1+1+2+2+3+4=14=a(7) - _Benoit Cloitre_, Aug 06 2003 %F A011784 a(n) = A012257(n,a(n+1)). - _Reinhard Zumkeller_, Aug 11 2014 %e A011784 {1,1}, {1,2}, {1,1,2}, {1,1,2,3}, {1,1,1,2,2,3,4}, {1,1,1,1,2,2,2,3,3,4,4,5,6,7}. %t A011784 (* This script is not suitable for computing more than 11 terms *) nmax = 11; ro = {{2, 1}}; a[1]=1; For[n=2, n <= nmax, n++, ro = Transpose[{Table[#[[2]], {#[[1]]}]& /@ Reverse[ro] // Flatten, Range[Total[ro[[All, 1]]]]}]; Print["a(", n, ") = ", a[n] = ro // Last // Last]]; Array[a, nmax] (* _Jean-François Alcover_, Feb 25 2016 *) %t A011784 NestList[Flatten@ MapIndexed[ConstantArray[First@ #2, #1] &, Reverse@ #] &, {1, 1}, 10][[All, -1]] (* _Michael De Vlieger_, Jul 12 2017, same limitations as above *) %o A011784 (Haskell) %o A011784 a011784 = last . a012257_row -- _Reinhard Zumkeller_, Aug 11 2014 %o A011784 (R) %o A011784 # This works, as with the others, up to 11. %o A011784 lev2 <- function(x = 10, levprev= NULL){ %o A011784 x <- floor(x[1]) %o A011784 # levlen is the RLE values %o A011784 levterm <-rep(1,x) %o A011784 levlen[[1]] <- 2 %o A011784 for ( jl in 2:x) { %o A011784 rk <- length(levlen[[jl-1]]) %o A011784 for (jrk in 1: rk) { %o A011784 levlen[[jl]] <- c(levlen[[jl]], rep(jrk, times = levlen[[jl-1]][rk+1-jrk])) } %o A011784 levterm[jl] <- length(levlen[[jl]]) } %o A011784 return(invisible(list(levlen=levlen, levterm = levterm) ) ) } %o A011784 # _Carl Witthoft_, Apr 01 2021 %Y A011784 Cf. A012257, A014621, A014622. %K A011784 nonn,nice %O A011784 1,2 %A A011784 Lionel Levine (levine(AT)ultranet.com) %E A011784 a(12) from _Colin Mallows_, a(13) from _N. J. A. Sloane_, a(14) and a(15) from _Allan Wilks_ %E A011784 a(16) from _Johan Claes_, Jun 09 2004 %E A011784 a(17) (an 85-digit number) from _Johan Claes_, Jun 18 2004 %E A011784 Edited by _N. J. A. Sloane_, Mar 08 2006 %E A011784 a(18) (a 137-digit number) from _Johan Claes_, Aug 19 2008 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE