cp's OEIS Frontend

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.

Showing 1-10 of 12 results. Next

A001541 a(0) = 1, a(1) = 3; for n > 1, a(n) = 6*a(n-1) - a(n-2).

Original entry on oeis.org

1, 3, 17, 99, 577, 3363, 19601, 114243, 665857, 3880899, 22619537, 131836323, 768398401, 4478554083, 26102926097, 152139002499, 886731088897, 5168247530883, 30122754096401, 175568277047523, 1023286908188737, 5964153172084899, 34761632124320657
Offset: 0

Views

Author

Keywords

Comments

Chebyshev polynomials of the first kind evaluated at 3.
This sequence gives the values of x in solutions of the Diophantine equation x^2 - 8*y^2 = 1, the corresponding values of y are in A001109. For n > 0, the ratios a(n)/A001090(n) may be obtained as convergents to sqrt(8): either successive convergents of [3; -6] or odd convergents of [2; 1, 4]. - Lekraj Beedassy, Sep 09 2003 [edited by Jon E. Schoenfield, May 04 2014]
Also gives solutions to the equation x^2 - 1 = floor(x*r*floor(x/r)) where r = sqrt(8). - Benoit Cloitre, Feb 14 2004
Appears to give all solutions greater than 1 to the equation: x^2 = ceiling(x*r*floor(x/r)) where r = sqrt(2). - Benoit Cloitre, Feb 24 2004
This sequence give numbers n such that (n-1)*(n+1)/2 is a perfect square. Remark: (i-1)*(i+1)/2 = (i^2-1)/2 = -1 = i^2 with i = sqrt(-1) so i is also in the sequence. - Pierre CAMI, Apr 20 2005
a(n) is prime for n = {1, 2, 4, 8}. Prime a(n) are {3, 17, 577, 665857}, which belong to A001601(n). a(2k-1) is divisible by a(1) = 3. a(4k-2) is divisible by a(2) = 17. a(8k-4) is divisible by a(4) = 577. a(16k-8) is divisible by a(8) = 665857. - Alexander Adamchuk, Nov 24 2006
The upper principal convergents to 2^(1/2), beginning with 3/2, 17/12, 99/70, 577/408, comprise a strictly decreasing sequence; essentially, numerators=A001541 and denominators=A001542. - Clark Kimberling, Aug 26 2008
Also index of sequence A082532 for which A082532(n) = 1. - Carmine Suriano, Sep 07 2010
Numbers n such that sigma(n-1) and sigma(n+1) are both odd numbers. - Juri-Stepan Gerasimov, Mar 28 2011
Also, numbers such that floor(a(n)^2/2) is a square: base 2 analog of A031149, A204502, A204514, A204516, A204518, A204520, A004275, A001075. - M. F. Hasler, Jan 15 2012
Numbers such that 2n^2 - 2 is a square. Also integer square roots of the expression 2*n^2 + 1, at values of n given by A001542. Also see A228405 regarding 2n^2 -+ 2^k generally for k >= 0. - Richard R. Forberg, Aug 20 2013
Values of x (or y) in the solutions to x^2 - 6xy + y^2 + 8 = 0. - Colin Barker, Feb 04 2014
Panda and Ray call the numbers in this sequence the Lucas-balancing numbers C_n (see references and links).
Partial sums of X or X+1 of Pythagorean triples (X,X+1,Z). - Peter M. Chema, Feb 03 2017
a(n)/A001542(n) is the closest rational approximation to sqrt(2) with a numerator not larger than a(n), and 2*A001542(n)/a(n) is the closest rational approximation to sqrt(2) with a denominator not larger than a(n). These rational approximations together with those obtained from the sequences A001653 and A002315 give a complete set of closest rational approximations to sqrt(2) with restricted numerator or denominator. a(n)/A001542(n) > sqrt(2) > 2*A001542(n)/a(n). - A.H.M. Smeets, May 28 2017
x = a(n), y = A001542(n) are solutions of the Diophantine equation x^2 - 2y^2 = 1 (Pell equation). x = 2*A001542(n), y = a(n) are solutions of the Diophantine equation x^2 - 2y^2 = -2. Both together give the set of fractional approximations for sqrt(2) obtained from limited fractions obtained from continued fraction representation to sqrt(2). - A.H.M. Smeets, Jun 22 2017
a(n) is the radius of the n-th circle among the sequence of circles generated as follows: Starting with a unit circle centered at the origin, every subsequent circle touches the previous circle as well as the two limbs of hyperbola x^2 - y^2 = 1, and lies in the region y > 0. - Kaushal Agrawal, Nov 10 2018
All of the positive integer solutions of a*b+1=x^2, a*c+1=y^2, b*c+1=z^2, x+z=2*y, 0A001542(n), b=A005319(n), c=A001542(n+1), x=A001541(n), y=A001653(n+1), z=A002315(n) with 0Michael Somos, Jun 26 2022

Examples

			99^2 + 99^2 = 140^2 + 2. - _Carmine Suriano_, Jan 05 2015
G.f. = 1 + 3*x + 17*x^2 + 99*x^3 + 577*x^4 + 3363*x^5 + 19601*x^6 + 114243*x^7 + ...
		

References

  • Julio R. Bastida, Quadratic properties of a linearly recurrent sequence. Proceedings of the Tenth Southeastern Conference on Combinatorics, Graph Theory and Computing (Florida Atlantic Univ., Boca Raton, Fla., 1979), pp. 163--166, Congress. Numer., XXIII-XXIV, Utilitas Math., Winnipeg, Man., 1979. MR0561042 (81e:10009)
  • J. W. L. Glaisher, On Eulerian numbers (formulas, residues, end-figures), with the values of the first twenty-seven, Quarterly Journal of Mathematics, vol. 45, 1914, pp. 1-51.
  • G. K. Panda, Some fascinating properties of balancing numbers, In Proc. of Eleventh Internat. Conference on Fibonacci Numbers and Their Applications, Cong. Numerantium 194 (2009), 185-189.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 257-258.
  • P.-F. Teilhet, Query 2376, L'Intermédiaire des Mathématiciens, 11 (1904), 138-139. - N. J. A. Sloane, Mar 08 2022

Crossrefs

Bisection of A001333. A003499(n) = 2a(n).
Cf. A055997 = numbers n such that n(n-1)/2 is a square.
Row 1 of array A188645.
Cf. A055792 (terms squared), A132592.

Programs

  • Haskell
    a001541 n = a001541_list !! (n-1)
    a001541_list =
    1 : 3 : zipWith (-) (map (* 6) $ tail a001541_list) a001541_list
    -- Reinhard Zumkeller, Oct 06 2011
    (Scheme, with memoization-macro definec)
    (definec (A001541 n) (cond ((zero? n) 1) ((= 1 n) 3) (else (- (* 6 (A001541 (- n 1))) (A001541 (- n 2))))))
    ;; Antti Karttunen, Oct 04 2016
  • Magma
    [n: n in [1..10000000] |IsSquare(8*(n^2-1))]; // Vincenzo Librandi, Nov 18 2010
    
  • Maple
    a[0]:=1: a[1]:=3: for n from 2 to 26 do a[n]:=6*a[n-1]-a[n-2] od: seq(a[n], n=0..20); # Zerinvary Lajos, Jul 26 2006
    A001541:=-(-1+3*z)/(1-6*z+z**2); # Simon Plouffe in his 1992 dissertation
  • Mathematica
    Table[Simplify[(1/2) (3 + 2 Sqrt[2])^n + (1/2) (3 - 2 Sqrt[2])^n], {n, 0, 20}] (* Artur Jasinski, Feb 10 2010 *)
    a[ n_] := If[n == 0, 1, With[{m = Abs @ n}, m Sum[4^i Binomial[m + i, 2 i]/(m + i), {i, 0, m}]]]; (* Michael Somos, Jul 11 2011 *)
    a[ n_] := ChebyshevT[ n, 3]; (* Michael Somos, Jul 11 2011 *)
    LinearRecurrence[{6, -1}, {1, 3}, 50] (* Vladimir Joseph Stephan Orlovsky, Feb 12 2012 *)
  • PARI
    {a(n) = real((3 + quadgen(32))^n)}; /* Michael Somos, Apr 07 2003 */
    
  • PARI
    {a(n) = subst( poltchebi( abs(n)), x, 3)}; /* Michael Somos, Apr 07 2003 */
    
  • PARI
    {a(n) = if( n<0, a(-n), polsym(1 - 6*x + x^2, n) [n+1] / 2)}; /* Michael Somos, Apr 07 2003 */
    
  • PARI
    {a(n) = polchebyshev( n, 1, 3)}; /* Michael Somos, Jul 11 2011 */
    
  • PARI
    a(n)=([1,2,2;2,1,2;2,2,3]^n)[3,3] \\ Vim Wenders, Mar 28 2007
    

Formula

G.f.: (1-3*x)/(1-6*x+x^2). - Barry E. Williams and Wolfdieter Lang, May 05 2000
E.g.f.: exp(3*x)*cosh(2*sqrt(2)*x). Binomial transform of A084128. - Paul Barry, May 16 2003
From N. J. A. Sloane, May 16 2003: (Start)
a(n) = sqrt(8*((A001109(n))^2) + 1).
a(n) = T(n, 3), with Chebyshev's T-polynomials A053120. (End)
a(n) = ((3+2*sqrt(2))^n + (3-2*sqrt(2))^n)/2.
a(n) = cosh(2*n*arcsinh(1)). - Herbert Kociemba, Apr 24 2008
a(n) ~ (1/2)*(sqrt(2) + 1)^(2*n). - Joe Keane (jgk(AT)jgk.org), May 15 2002
For all elements x of the sequence, 2*x^2 - 2 is a square. Limit_{n -> infinity} a(n)/a(n-1) = 3 + 2*sqrt(2). - Gregory V. Richardson, Oct 10 2002 [corrected by Peter Pein, Mar 09 2009]
a(n) = 3*A001109(n) - A001109(n-1), n >= 1. - Barry E. Williams and Wolfdieter Lang, May 05 2000
For n >= 1, a(n) = A001652(n) - A001652(n-1). - Charlie Marion, Jul 01 2003
From Paul Barry, Sep 18 2003: (Start)
a(n) = ((-1+sqrt(2))^n + (1+sqrt(2))^n + (1-sqrt(2))^n + (-1-sqrt(2))^n)/4 (with interpolated zeros).
E.g.f.: cosh(x)*cosh(sqrt(2)x) (with interpolated zeros). (End)
For n > 0, a(n)^2 + 1 = 2*A001653(n-1)*A001653(n). - Charlie Marion, Dec 21 2003
a(n)^2 + a(n+1)^2 = 2*(A001653(2*n+1) - A001652(2*n)). - Charlie Marion, Mar 17 2003
a(n) = Sum_{k >= 0} binomial(2*n, 2*k)*2^k = Sum_{k >= 0} A086645(n, k)*2^k. - Philippe Deléham, Feb 29 2004
a(n)*A002315(n+k) = A001652(2*n+k) + A001652(k) + 1; for k > 0, a(n+k)*A002315(n) = A001652(2*n+k) - A001652(k-1). - Charlie Marion, Mar 17 2003
For n > k, a(n)*A001653(k) = A011900(n+k) + A053141(n-k-1). For n <= k, a(n)*A001653(k) = A011900(n+k) + A053141(k-n). - Charlie Marion, Oct 18 2004
A053141(n+1) + A055997(n+1) = a(n+1) + A001109(n+1). - Creighton Dement, Sep 16 2004
a(n+1) - A001542(n+1) = A090390(n+1) - A046729(n) = A001653(n); a(n+1) - 4*A079291(n+1) = (-1)^(n+1). Formula generated by the floretion - .5'i + .5'j - .5i' + .5j' - 'ii' + 'jj' - 2'kk' + 'ij' + .5'ik' + 'ji' + .5'jk' + .5'ki' + .5'kj' + e. - Creighton Dement, Nov 16 2004
a(n) = sqrt( A055997(2*n) ). - Alexander Adamchuk, Nov 24 2006
a(2n) = A056771(n). a(2*n+1) = 3*A077420(n). - Alexander Adamchuk, Feb 01 2007
a(n) = (A000129(n)^2)*4 + (-1)^n. - Vim Wenders, Mar 28 2007
2*a(k)*A001653(n)*A001653(n+k) = A001653(n)^2 + A001653(n+k)^2 + A001542(k)^2. - Charlie Marion, Oct 12 2007
a(n) = A001333(2*n). - Ctibor O. Zizka, Aug 13 2008
A028982(a(n)-1) + 2 = A028982(a(n)+1). - Juri-Stepan Gerasimov, Mar 28 2011
a(n) = 2*A001108(n) + 1. - Paul Weisenhorn, Dec 17 2011
a(n) = sqrt(2*x^2 + 1) with x being A001542(n). - Zak Seidov, Jan 30 2013
a(2n) = 2*a(n)^2 - 1 = a(n)^2 + 2*A001542(n)^2. a(2*n+1) = 1 + 2*A002315(n)^2. - Steven J. Haker, Dec 04 2013
a(n) = 3*a(n-1) + 4*A001542(n-1); e.g., a(4) = 99 = 3*17 + 4*12. - Zak Seidov, Dec 19 2013
a(n) = cos(n * arccos(3)) = cosh(n * log(3 + 2*sqrt(2))). - Daniel Suteu, Jul 28 2016
From Ilya Gutkovskiy, Jul 28 2016: (Start)
Inverse binomial transform of A084130.
Exponential convolution of A000079 and A084058.
Sum_{n>=0} (-1)^n*a(n)/n! = cosh(2*sqrt(2))/exp(3) = 0.4226407909842764637... (End)
a(2*n+1) = 2*a(n)*a(n+1) - 3. - Timothy L. Tiffin, Oct 12 2016
a(n) = a(-n) for all n in Z. - Michael Somos, Jan 20 2017
a(2^n) = A001601(n+1). - A.H.M. Smeets, May 28 2017
a(A298210(n)) = A002350(2*n^2). - A.H.M. Smeets, Jan 25 2018
a(n) = S(n, 6) - 3*S(n-1, 6), for n >= 0, with S(n, 6) = A001109(n+1), (Chebyshev S of A049310). See the first comment and the formula a(n) = T(n, 3). - Wolfdieter Lang, Nov 22 2020
From Peter Bala, Dec 31 2021: (Start)
a(n) = [x^n] (3*x + sqrt(1 + 8*x^2))^n.
The Gauss congruences a(n*p^k) == a(n*p^(k-1)) hold for all prime p and positive integers n and k.
O.g.f. A(x) = 1 + x*d/dx(log(B(x))), where B(x) = 1/sqrt(1 - 6*x + x^2) is the o.g.f. of A001850. (End)
From Peter Bala, Aug 17 2022: (Start)
Sum_{n >= 1} 1/(a(n) - 2/a(n)) = 1/2.
Sum_{n >= 1} (-1)^(n+1)/(a(n) + 1/a(n)) = 1/4.
Sum_{n >= 1} 1/(a(n)^2 - 2) = 1/2 - 1/sqrt(8). (End)
From Peter Bala, Jun 23 2025: (Start)
Product_{n >= 0} (1 + 1/a(2^n)) = sqrt(2).
Product_{n >= 0} (1 - 1/(2*a(2^n))) = (4/7)*sqrt(2). See A002812. (End)

A029744 Numbers of the form 2^n or 3*2^n.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072, 196608, 262144, 393216, 524288, 786432, 1048576, 1572864, 2097152, 3145728, 4194304
Offset: 1

Views

Author

Keywords

Comments

This entry is a list, and so has offset 1. WARNING: However, in this entry several comments, formulas and programs seem to refer to the original version of this sequence which had offset 0. - M. F. Hasler, Oct 06 2014
Number of necklaces with n-1 beads and two colors that are the same when turned over and hence have reflection symmetry. [edited by Herbert Kociemba, Nov 24 2016]
The subset {a(1),...,a(2k)} contains all proper divisors of 3*2^k. - Ralf Stephan, Jun 02 2003
Let k = any nonnegative integer and j = 0 or 1. Then n+1 = 2k + 3j and a(n) = 2^k*3^j. - Andras Erszegi (erszegi.andras(AT)chello.hu), Jul 30 2005
Smallest number having no fewer prime factors than any predecessor, a(0)=1; A110654(n) = A001222(a(n)); complement of A116451. - Reinhard Zumkeller, Feb 16 2006
A093873(a(n)) = 1. - Reinhard Zumkeller, Oct 13 2006
a(n) = a(n-1) + a(n-2) - gcd(a(n-1), a(n-2)), n >= 3, a(1)=2, a(2)=3. - Ctibor O. Zizka, Jun 06 2009
Where records occur in A048985: A193652(n) = A048985(a(n)) and A193652(n) < A048985(m) for m < a(n). - Reinhard Zumkeller, Aug 08 2011
A002348(a(n)) = A000079(n-3) for n > 2. - Reinhard Zumkeller, Mar 18 2012
Without initial 1, third row in array A228405. - Richard R. Forberg, Sep 06 2013
Also positions of records in A048673. A246360 gives the record values. - Antti Karttunen, Sep 23 2014
Known in numerical mathematics as "Bulirsch sequence", used in various extrapolation methods for step size control. - Peter Luschny, Oct 30 2019
For n > 1, squares of the terms can be expressed as the sum of two powers of two: 2^x + 2^y. - Karl-Heinz Hofmann, Sep 08 2022

Crossrefs

Cf. A056493, A038754, A063759. Union of A000079 and A007283.
First differences are in A016116(n-1).
Row sums of the triangle in sequence A119963. - John P. McSorley, Aug 31 2010
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent. There may be minor differences from (s(n)) at the start, and a shift of indices. A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A060482 (s(n)-3); A136252 (s(n)-3); A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A354785 (3*s(n)), A061776 (3*s(n)-6); A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Haskell
    a029744 n = a029744_list !! (n-1)
    a029744_list = 1 : iterate
       (\x -> if x `mod` 3 == 0 then 4 * x `div` 3 else 3 * x `div` 2) 2
    -- Reinhard Zumkeller, Mar 18 2012
    
  • Maple
    1,seq(op([2^i,3*2^(i-1)]),i=1..100); # Robert Israel, Sep 23 2014
  • Mathematica
    CoefficientList[Series[(-x^2 - 2*x - 1)/(2*x^2 - 1), {x, 0, 200}], x] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
    Function[w, DeleteCases[Union@ Flatten@ w, k_ /; k > Max@ First@ w]]@ TensorProduct[{1, 3}, 2^Range[0, 22]] (* Michael De Vlieger, Nov 24 2016 *)
    LinearRecurrence[{0,2},{1,2,3},50] (* Harvey P. Dale, Jul 04 2017 *)
  • PARI
    a(n)=if(n%2,3/2,2)<<((n-1)\2)\1
    
  • Python
    def A029744(n):
        if n == 1: return 1
        elif n % 2 == 0: return 2**(n//2)
        else: return 3 * 2**((n-3)//2) # Karl-Heinz Hofmann, Sep 08 2022
  • Scheme
    (define (A029744 n) (cond ((<= n 1) n) ((even? n) (expt 2 (/ n 2))) (else (* 3 (expt 2 (/ (- n 3) 2)))))) ;; Antti Karttunen, Sep 23 2014
    

Formula

a(n) = 2*A000029(n) - A000031(n).
For n > 2, a(n) = 2*a(n - 2); for n > 3, a(n) = a(n - 1)*a(n - 2)/a(n - 3). G.f.: (1 + x)^2/(1 - 2*x^2). - Henry Bottomley, Jul 15 2001, corrected May 04 2007
a(0)=1, a(1)=1 and a(n) = a(n-2) * ( floor(a(n-1)/a(n-2)) + 1 ). - Benoit Cloitre, Aug 13 2002
(3/4 + sqrt(1/2))*sqrt(2)^n + (3/4 - sqrt(1/2))*(-sqrt(2))^n. a(0)=1, a(2n) = a(n-1)*a(n), a(2n+1) = a(n) + 2^floor((n-1)/2). - Ralf Stephan, Apr 16 2003 [Seems to refer to the original version with offset=0. - M. F. Hasler, Oct 06 2014]
Binomial transform is A048739. - Paul Barry, Apr 23 2004
E.g.f.: (cosh(x/sqrt(2)) + sqrt(2)sinh(x/sqrt(2)))^2.
a(1) = 1; a(n+1) = a(n) + A000010(a(n)). - Stefan Steinerberger, Dec 20 2007
u(2)=1, v(2)=1, u(n)=2*v(n-1), v(n)=u(n-1), a(n)=u(n)+v(n). - Jaume Oliver Lafont, May 21 2008
For n => 3, a(n) = sqrt(2*a(n-1)^2 + (-2)^(n-3)). - Richard R. Forberg, Aug 20 2013
a(n) = A064216(A246360(n)). - Antti Karttunen, Sep 23 2014
a(n) = sqrt((17 - (-1)^n)*2^(n-4)) for n >= 2. - Anton Zakharov, Jul 24 2016
Sum_{n>=1} 1/a(n) = 8/3. - Amiram Eldar, Nov 12 2020
a(n) = 2^(n/2) if n is even. a(n) = 3 * 2^((n-3)/2) if n is odd and for n>1. - Karl-Heinz Hofmann, Sep 08 2022

Extensions

Corrected and extended by Joe Keane (jgk(AT)jgk.org), Feb 20 2000

A007052 Number of order-consecutive partitions of n.

Original entry on oeis.org

1, 3, 10, 34, 116, 396, 1352, 4616, 15760, 53808, 183712, 627232, 2141504, 7311552, 24963200, 85229696, 290992384, 993510144, 3392055808, 11581202944, 39540700160, 135000394752, 460920178688, 1573679925248, 5372879343616, 18344157523968, 62630871408640, 213835170586624
Offset: 0

Views

Author

Colin Mallows, N. J. A. Sloane, and Simon Plouffe

Keywords

Comments

After initial terms, first differs from A291292 at a(6) = 1352, A291292(8) = 1353.
Joe Keane (jgk(AT)jgk.org) observes that this sequence (beginning at 3) is "size of raises in pot-limit poker, one blind, maximum raising".
It appears that this sequence is the BinomialMean transform of A001653 (see A075271). - John W. Layman, Oct 03 2002
Number of (s(0), s(1), ..., s(2n+1)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n+1, s(0) = 3, s(2n+1) = 4. - Herbert Kociemba, Jun 12 2004
Equals the INVERT transform of (1, 2, 5, 13, 34, 89, ...). - Gary W. Adamson, May 01 2009
a(n) is the number of compositions of n when there are 3 types of ones. - Milan Janjic, Aug 13 2010
a(n)/a(n-1) tends to (4 + sqrt(8))/2 = 3.414213.... Gary W. Adamson, Jul 30 2013
a(n) is the first subdiagonal of array A228405. - Richard R. Forberg, Sep 02 2013
Number of words of length n over {0,1,2,3,4} in which binary subwords appear in the form 10...0. - Milan Janjic, Jan 25 2017
From Gus Wiseman, Mar 05 2020: (Start)
Also the number of unimodal sequences of length n + 1 covering an initial interval of positive integers, where a sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence. For example, the a(0) = 1 through a(2) = 10 sequences are:
(1) (1,1) (1,1,1)
(1,2) (1,1,2)
(2,1) (1,2,1)
(1,2,2)
(1,2,3)
(1,3,2)
(2,1,1)
(2,2,1)
(2,3,1)
(3,2,1)
Missing are: (2,1,2), (2,1,3), (3,1,2).
Conjecture: Also the number of ordered set partitions of {1..n + 1} where no element of any block is greater than any element of a non-adjacent consecutive block. For example, the a(0) = 1 through a(2) = 10 ordered set partitions are:
{{1}} {{1,2}} {{1,2,3}}
{{1},{2}} {{1},{2,3}}
{{2},{1}} {{1,2},{3}}
{{1,3},{2}}
{{2},{1,3}}
{{2,3},{1}}
{{3},{1,2}}
{{1},{2},{3}}
{{1},{3},{2}}
{{2},{1},{3}}
a(n-1) is the number of hexagonal directed-column convex polyominoes having area n (see Baril et al. at page 4). - Stefano Spezia, Oct 14 2023

Examples

			G.f. = 1 + 3*x + 10*x^2 + 34*x^3 + 116*x^4 + 396*x^5 + 1352*x^6 + 4616*x^7 + ...
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [Floor((2+Sqrt(2))^n*(1/2+Sqrt(2)/4)+(2-Sqrt(2))^n*(1/2-Sqrt(2)/4)): n in [0..30] ] ; // Vincenzo Librandi, Aug 20 2011
  • Mathematica
    a[n_]:=(MatrixPower[{{3,1},{1,1}},n].{{2},{1}})[[2,1]]; Table[a[n],{n,0,40}] (* Vladimir Joseph Stephan Orlovsky, Feb 20 2010 *)
    a[ n_] := ((2 + Sqrt[2])^(n + 1) + (2 - Sqrt[2])^(n + 1)) / 4 // Simplify; (* Michael Somos, Jan 25 2017 *)
    LinearRecurrence[{4, -2}, {1, 3}, 24] (* Jean-François Alcover, Jan 07 2019 *)
    unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]];
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Union@@Permutations/@allnorm[n],unimodQ]],{n,6}] (* Gus Wiseman, Mar 06 2020 *)
  • PARI
    {a(n) = real((2 + quadgen(8))^(n+1)) / 2}; /* Michael Somos, Mar 06 2003 */
    

Formula

a(n+1) = 4*a(n) - 2*a(n-1).
G.f.: (1-x)/(1-4*x+2*x^2).
Binomial transform of Pell numbers 1, 2, 5, 12, ... (A000129).
a(n) = A006012(n+1)/2 = A056236(n+1)/4. - Michael Somos, Mar 06 2003
a(n) = (A035344(n)+1)/2; a(n) = (2+sqrt(2))^n(1/2+sqrt(2)/4)+(2-sqrt(2))^n(1/2-sqrt(2)/4). - Paul Barry, Jul 16 2003
Second binomial transform of (1, 1, 2, 2, 4, 4, ...). a(n) = Sum_{k=1..floor(n/2)}, C(n, 2k)*2^(n-k-1). - Paul Barry, Nov 22 2003
a(n) = ( (2-sqrt(2))^(n+1) + (2+sqrt(2))^(n+1) )/4. - Herbert Kociemba, Jun 12 2004
a(n) = both left and right terms in M^n * [1 1 1], where M = the 3 X 3 matrix [1 1 1 / 1 2 1 / 1 1 1]. M^n * [1 1 1] = [a(n) A007070(n) a(n)]. E.g., a(3) = 34. M^3 * [1 1 1] = [34 48 34] (center term is A007070(3)). - Gary W. Adamson, Dec 18 2004
The i-th term of the sequence is the entry (2, 2) in the i-th power of the 2 X 2 matrix M = ((1, 1), (1, 3)). - Simone Severini, Oct 15 2005
E.g.f.: exp(2*x)*(cosh(sqrt(2)*x)+sinh(sqrt(2)*x)/sqrt(2)). - Paul Barry, Nov 20 2003
a(n) = A007068(2*n), n>0. - R. J. Mathar, Aug 17 2009
If p[i]=Fibonacci(2i-1) and if A is the Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)= det A. - Milan Janjic, May 08 2010
a(n-1) = Sum_{k=-floor(n/4)..floor(n/4)} (-1)^k*binomial(2*n,n+4*k)/2. - Mircea Merca, Jan 28 2012
G.f.: G(0)*(1-x)/(2*x) + 1 - 1/x, where G(k) = 1 + 1/(1 - x*(2*k-1)/(x*(2*k+1) - (1-x)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 26 2013
a(n) = 3*a(n-1) + a(n-2) + a(n-3) + a(n-4) + ... + a(0). - Gary W. Adamson, Aug 12 2013
a(n) = a(-2-n) * 2^(n+1) for all n in Z. - Michael Somos, Jan 25 2017

A007070 a(n) = 4*a(n-1) - 2*a(n-2) with a(0) = 1, a(1) = 4.

Original entry on oeis.org

1, 4, 14, 48, 164, 560, 1912, 6528, 22288, 76096, 259808, 887040, 3028544, 10340096, 35303296, 120532992, 411525376, 1405035520, 4797091328, 16378294272, 55918994432, 190919389184, 651839567872, 2225519493120, 7598398836736, 25942556360704, 88573427769344, 302408598355968
Offset: 0

Views

Author

Keywords

Comments

Joe Keane (jgk(AT)jgk.org) observes that this sequence (beginning at 4) is "size of raises in pot-limit poker, one blind, maximum raising."
It appears that this sequence is the BinomialMean transform of A002315 - see A075271. - John W. Layman, Oct 02 2002
Number of (s(0), s(1), ..., s(2n+3)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n+3, s(0) = 1, s(2n+3) = 4. - Herbert Kociemba, Jun 11 2004
a(n) = number of distinct matrix products in (A+B+C+D)^n where commutators [A,B]=[C,D]=0 but neither A nor B commutes with C or D. - Paul D. Hanna and Joshua Zucker, Feb 01 2006
The n-th term of the sequence is the entry (1,2) in the n-th power of the matrix M=[1,-1;-1,3]. - Simone Severini, Feb 15 2006
Hankel transform of this sequence is [1,-2,0,0,0,0,0,0,0,0,0,...]. - Philippe Deléham, Nov 21 2007
A204089 convolved with A000225, e.g., a(4) = 164 = (1*31 + 1*15 + 4*7 + 14*3 + 48*1) = (31 + 15 + 28 + 42 + 48). - Gary W. Adamson, Dec 23 2008
Equals INVERT transform of A000225: (1, 3, 7, 15, 31, ...). - Gary W. Adamson, May 03 2009
For n>=1, a(n-1) is the number of generalized compositions of n when there are 2^i-1 different types of the part i, (i=1,2,...). - Milan Janjic, Sep 24 2010
Binomial transform of A078057. - R. J. Mathar, Mar 28 2011
Pisano period lengths: 1, 1, 8, 1, 24, 8, 6, 1, 24, 24, 120, 8, 168, 6, 24, 1, 8, 24, 360, 24, ... . - R. J. Mathar, Aug 10 2012
a(n) is the diagonal of array A228405. - Richard R. Forberg, Sep 02 2013
From Wolfdieter Lang, Oct 01 2013: (Start)
a(n) appears together with A106731, both interspersed with zeros, in the representation of nonnegative powers of the algebraic number rho(8) = 2*cos(Pi/8) = A179260 of degree 4, which is the length ratio of the smallest diagonal and the side in the regular octagon.
The minimal polynomial for rho(8) is C(8,x) = x^4 - 4*x^2 + 2, hence rho(8)^n = A(n+1)*1 + A(n)*rho(8) + B(n+1)*rho(8)^2 + B(n)*rho(8)^3, n >= 0, with A(2*k) = 0, k >= 0, A(1) = 1, A(2*k+1) = A106731(k-1), k >= 1, and B(2*k) = 0, k >= 0, B(1) = 0, B(2*k+1) = a(k-1), k >= 1. See also the P. Steinbach reference given under A049310. (End)
The ratio a(n)/A006012(n) converges to 1+sqrt(2). - Karl V. Keller, Jr., May 16 2015
From Tom Copeland, Dec 04 2015: (Start)
An aerated version of this sequence is given by the o.g.f. = 1 / (1 - 4 x^2 + 2 x^4) = 1 / [x^4 a_4(1/x)] = 1 / determinant(I - x M) = exp[-log(1 -4 x + 2 x^4)], where M is the adjacency matrix for the simple Lie algebra B_4 given in A265185 with the characteristic polynomial a_4(x) = x^4 - 4 x^2 + 2 = 2 T_4(x/2) = A127672(4,x), where T denotes a Chebyshev polynomial of the first kind.
A133314 relates a(n) to the reciprocal of the e.g.f. 1 - 4 x + 4 x^2/2!. (End)
a(n) is the number of vertices of the Minkowski sum of n simplices with vertices e_(2*i+1), e_(2*i+2), e_(2*i+3), e_(2*i+4) for i=0,...,n-1, where e_i is a standard basis vector. - Alejandro H. Morales, Oct 03 2022

Examples

			a(3) = 48 = 3 * 4 + 4 + 1 + 1 = 3*a(2) + a(1) + a(0) + 1.
Example for the octagon rho(8) powers: rho(8)^4  = 2 + sqrt(2) = -2*1 + 4*rho(8)^2  = A(5)*1 + A(4)*rho(8) + B(5)*rho(8)^2 + B(4)*rho(8)^3, with a(5) = A106731(1) = -2, B(5) = a(1) = 4, A(4) = 0, B(4) = 0. - _Wolfdieter Lang_, Oct 01 2013
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row sums of A059474. - David W. Wilson, Aug 14 2006
Equals 2 * A003480, n>0.
Row sums of A140071.

Programs

  • Haskell
    a007070 n = a007070_list !! n
    a007070_list = 1 : 4 : (map (* 2) $ zipWith (-)
       (tail $ map (* 2) a007070_list) a007070_list)
    -- Reinhard Zumkeller, Jan 16 2012
  • Magma
    Z:=PolynomialRing(Integers()); N:=NumberField(x^2-8); S:=[ ((4+r)^(1+n)-(4-r)^(1+n))/((2^(1+n))*r): n in [0..20] ]; [ Integers()!S[j]: j in [1..#S] ]; // Vincenzo Librandi, Mar 27 2011
    
  • Magma
    [n le 2 select 3*n-2 else 4*Self(n-1)-2*Self(n-2): n in [1..23]];  // Bruno Berselli, Mar 28 2011
    
  • Maple
    A007070 :=proc(n) option remember; if n=0 then 1 elif n=1 then 4 else 4*procname(n-1)-2*procname(n-2); fi; end:
    seq(A007070(n), n=0..30); # Wesley Ivan Hurt, Dec 06 2015
  • Mathematica
    LinearRecurrence[{4,-2}, {1,4}, 30] (* Harvey P. Dale, Sep 16 2014 *)
  • PARI
    a(n)=polcoeff(1/(1-4*x+2*x^2)+x*O(x^n),n)
    
  • PARI
    a(n)=if(n<1,1,ceil((2+sqrt(2))*a(n-1)))
    
  • Sage
    [lucas_number1(n,4,2) for n in range(1, 24)]# Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: 1/(1 - 4*x + 2*x^2).
Preceded by 0, this is the binomial transform of the Pell numbers A000129. Its e.g.f. is then exp(2*x)*sinh(sqrt(2)*x)/sqrt(2). - Paul Barry, May 09 2003
a(n) = ((2+sqrt(2))^(n+1) - (2-sqrt(2))^(n+1))/sqrt(8). - Al Hakanson (hawkuu(AT)gmail.com), Dec 27 2008, corrected Mar 28 2011
a(n) = (2 - sqrt(2))^n*(1/2 - sqrt(2)/2) + (2 + sqrt(2))^n*(1/2 + sqrt(2)/2). - Paul Barry, May 09 2003
a(n) = ceiling((2 + sqrt(2))*a(n-1)). - Benoit Cloitre, Aug 15 2003
a(n) = U(n, sqrt(2))*sqrt(2)^n. - Paul Barry, Nov 19 2003
a(n) = (1/4)*Sum_{r=1..7} sin(r*Pi/8)*sin(r*Pi/2)*(2*cos(r*Pi/8))^(2*n+3). - Herbert Kociemba, Jun 11 2004
a(n) = center term in M^n * [1 1 1], where M = the 3 X 3 matrix [1 1 1 / 1 2 1 / 1 1 1]. M^n * [1 1 1] = [A007052(n) a(n) A007052(n)]. E.g., a(3) = 48 since M^3 * [1 1 1] = [34 48 34], where 34 = A007052(3). - Gary W. Adamson, Dec 18 2004
This is the binomial mean transform of A002307. See Spivey and Steil (2006). - Michael Z. Spivey (mspivey(AT)ups.edu), Feb 26 2006
a(2n) = Sum_{r=0..n} 2^(2n-1-r)*(4*binomial(2n-1,2r) + 3*binomial(2n-1,2r+1)) a(2n-1) = Sum_{r=0..n} 2^(2n-2-r)*(4*binomial(2n-2,2r) + 3*binomial(2n-2,2r+1)). - Jeffrey Liese, Oct 12 2006
a(n) = 3*a(n - 1) + a(n - 2) + a(n - 3) + ... + a(0) + 1. - Gary W. Adamson, Feb 18 2011
G.f.: 1/(1 - 4*x + 2*x^2) = 1/( x*(1 + U(0)) ) - 1/x where U(k)= 1 - 2^k/(1 - x/(x - 2^k/U(k+1) )); (continued fraction 3rd kind, 3-step). - Sergei N. Gladkovskii, Dec 05 2012
G.f.: A(x) = G(0)/(1-2*x) where G(k) = 1 + 2*x/(1 - 2*x - x*(1-2*x)/(x + (1-2*x)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Jan 04 2013
G.f.: G(0)/(2*x) - 1/x, where G(k) = 1 + 1/(1 - x*(2*k-1)/(x*(2*k+1) - (1-x)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 26 2013
a(n-1) = Sum_{k=0..n} binomial(2*n, n+k)*(k|8) where (k|8) is the Kronecker symbol. - Greg Dresden, Oct 11 2022
E.g.f.: exp(2*x)*(cosh(sqrt(2)*x) + sqrt(2)*sinh(sqrt(2)*x)). - Stefano Spezia, May 20 2024

A006012 a(0) = 1, a(1) = 2, a(n) = 4*a(n-1) - 2*a(n-2), n >= 2.

Original entry on oeis.org

1, 2, 6, 20, 68, 232, 792, 2704, 9232, 31520, 107616, 367424, 1254464, 4283008, 14623104, 49926400, 170459392, 581984768, 1987020288, 6784111616, 23162405888, 79081400320, 270000789504, 921840357376, 3147359850496
Offset: 0

Views

Author

Keywords

Comments

Number of (s(0), s(1), ..., s(2n)) such that 0 < s(i) < 8 and |s(i) - s(i-1)| = 1 for i = 1,2,...,2n, s(0) = 4, s(2n) = 4. - Herbert Kociemba, Jun 12 2004
a(n-1) counts permutations pi on [n] for which the pairs {i, pi(i)} with i < pi(i), considered as closed intervals [i+1,pi(i)], do not overlap; equivalently, for each i in [n] there is at most one j <= i with pi(j) > i. Counting these permutations by the position of n yields the recurrence relation. - David Callan, Sep 02 2003
a(n) is the sum of (n+1)-th row terms of triangle A140070. - Gary W. Adamson, May 04 2008
The binomial transform is in A083878, the Catalan transform in A084868. - R. J. Mathar, Nov 23 2008
Equals row sums of triangle A152252. - Gary W. Adamson, Nov 30 2008
Counts all paths of length (2*n), n >= 0, starting at the initial node on the path graph P_7, see the second Maple program. - Johannes W. Meijer, May 29 2010
From L. Edson Jeffery, Apr 04 2011: (Start)
Let U_1 and U_3 be the unit-primitive matrices (see [Jeffery])
U_1 = U_(8,1) = [(0,1,0,0); (1,0,1,0); (0,1,0,1); (0,0,2,0)] and
U_3 = U_(8,3) = [(0,0,0,1); (0,0,2,0); (0,2,0,1); (2,0,2,0)]. Then a(n) = (1/4) * Trace(U_1^(2*n)) = (1/2^(n+2)) * Trace(U_3^(2*n)). (See also A084130, A001333.) (End)
Pisano period lengths: 1, 1, 8, 1, 24, 8, 6, 1, 24, 24, 120, 8, 168, 6, 24, 1, 8, 24, 360, 24, ... - R. J. Mathar, Aug 10 2012
a(n) is the first superdiagonal of array A228405. - Richard R. Forberg, Sep 02 2013
Conjecture: With offset 1, a(n) is the number of permutations on [n] with no subsequence abcd such that (i) bc are adjacent in position and (ii) max(a,c) < min(b,d). For example, the 4 permutations of [4] not counted by a(4) are 1324, 1423, 2314, 2413. - David Callan, Aug 27 2014
The conjecture of David Callan above is correct - with offset 1, a(n) is the number of permutations on [n] with no subsequence abcd such that (i) bc are adjacent in position and (ii) max(a,c) < min(b,d). - Yonah Biers-Ariel, Jun 27 2017
From Gary W. Adamson, Jul 22 2016: (Start)
A production matrix for the sequence is M =
1, 1, 0, 0, 0, 0, ...
1, 0, 3, 0, 0, 0, ...
1, 0, 0, 3, 0, 0, ...
1, 0, 0, 0, 3, 0, ...
1, 0, 0, 0, 0, 3, ...
...
Take powers of M, extracting the upper left terms; getting the sequence starting: (1, 1, 2, 6, 20, 68, ...). (End)
From Gary W. Adamson, Jul 24 2016: (Start)
The sequence is the INVERT transform of the powers of 3 prefaced with a "1": (1, 1, 3, 9, 27, ...) and is N=3 in an infinite of analogous sequences starting:
N=1 (A000079): 1, 2, 4, 8, 16, 32, ...
N=2 (A001519): 1, 2, 5, 13, 34, 89, ...
N=3 (A006012): 1, 2, 6, 20, 68, 232, ...
N=4 (A052961): 1, 2, 7, 29, 124, 533, ...
N=5 (A154626): 1, 2, 8, 40, 208, 1088, ...
N=6: 1, 2, 9, 53, 326, 2017, ...
... (End)
Number of permutations of length n > 0 avoiding the partially ordered pattern (POP) {1>2, 1>3, 4>2, 4>3} of length 4. That is, number of length n permutations having no subsequences of length 4 in which the first and fourth elements are larger than the second and third elements. - Sergey Kitaev, Dec 08 2020
a(n-1) is the number of permutations of [n] that can be obtained by placing n points on an X-shape (two crossing lines with slopes 1 and -1), labeling them 1,2,...,n by increasing y-coordinate, and then reading the labels by increasing x-coordinate. - Sergi Elizalde, Sep 27 2021
Consider a stack of pancakes of height n, where the only allowed operation is reversing the top portion of the stack. First, perform a series of reversals of decreasing sizes, followed by a series of reversals of increasing sizes. The number of distinct permutations of the initial stack that can be reached through these operations is a(n). - Thomas Baruchel, May 12 2025
Number of permutations of [n] that are correctly sorted after performing one left-to-right pass and one right-to-left pass of the cocktail sort. - Thomas Baruchel, May 16 2025

References

  • D. H. Greene and D. E. Knuth, Mathematics for the Analysis of Algorithms. Birkhäuser, Boston, 3rd edition, 1990, p. 86.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, Sect 5.4.8 Answer to Exer. 8.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006012 n = a006012_list !! n
    a006012_list = 1 : 2 : zipWith (-) (tail $ map (* 4) a006012_list)
    (map (* 2) a006012_list)
    -- Reinhard Zumkeller, Oct 03 2011
    
  • Magma
    [n le 2 select n else 4*Self(n-1)- 2*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Apr 05 2011
    
  • Maple
    A006012:=-(-1+2*z)/(1-4*z+2*z**2); # Simon Plouffe in his 1992 dissertation
    with(GraphTheory): G:=PathGraph(7): A:= AdjacencyMatrix(G): nmax:=24; n2:=2*nmax: for n from 0 to n2 do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..7); od: seq(a(2*n),n=0..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    LinearRecurrence[{4,-2},{1,2},50] (* or *) With[{c=Sqrt[2]}, Simplify[ Table[((2+c)^n+(3+2c)(2-c)^n)/(2(2+c)),{n,50}]]] (* Harvey P. Dale, Aug 29 2011 *)
  • PARI
    {a(n) = real(((2 + quadgen(8))^n))}; /* Michael Somos, Feb 12 2004 */
    
  • PARI
    {a(n) = if( n<0, 2^n, 1) * polsym(x^2 - 4*x + 2, abs(n))[abs(n)+1] / 2}; /* Michael Somos, Feb 12 2004 */
    
  • PARI
    Vec((1-2*x)/(1-4*x+2*x^2) + O(x^100)) \\ Altug Alkan, Dec 05 2015
    
  • Python
    l = [1, 2]
    for n in range(2, 101): l.append(4 * l[n - 1] - 2 * l[n - 2])
    print(l)  # Indranil Ghosh, Jul 02 2017
    
  • SageMath
    A006012=BinaryRecurrenceSequence(4,-2,1,2)
    print([A006012(n) for n in range(41)]) # G. C. Greubel, Aug 27 2025

Formula

G.f.: (1-2*x)/(1 - 4*x + 2*x^2).
a(n) = 2*A007052(n-1) = A056236(n)/2.
Limit_{n -> oo} a(n)/a(n-1) = 2 + sqrt(2). - Zak Seidov, Oct 12 2002
From Paul Barry, May 08 2003: (Start)
Binomial transform of A001333.
E.g.f.: exp(2*x)*cosh(sqrt(2)*x). (End)
a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2k)*2^(n-k) = Sum_{k=0..n} binomial(n, k)*2^(n-k/2)(1+(-1)^k)/2. - Paul Barry, Nov 22 2003 (typo corrected by Manfred Scheucher, Jan 17 2023)
a(n) = ((2+sqrt(2))^n + (2-sqrt(2))^n)/2.
a(n) = Sum_{k=0..n} 2^k*A098158(n,k). - Philippe Deléham, Dec 04 2006
a(n) = A007070(n) - 2*A007070(n-1). - R. J. Mathar, Nov 16 2007
a(n) = Sum_{k=0..n} A147703(n,k). - Philippe Deléham, Nov 29 2008
a(n) = Sum_{k=0..n} A201730(n,k). - Philippe Deléham, Dec 05 2011
G.f.: G(0) where G(k)= 1 + 2*x/((1-2*x) - 2*x*(1-2*x)/(2*x + (1-2*x)*2/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Dec 10 2012
G.f.: G(0)*(1-2*x)/2, where G(k) = 1 + 1/(1 - 2*x*(4*k+2-x)/( 2*x*(4*k+4-x) + 1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 27 2014
a(-n) = a(n) / 2^n for all n in Z. - Michael Somos, Aug 24 2014
a(n) = A265185(n) / 4, connecting this sequence to the simple Lie algebra B_4. - Tom Copeland, Dec 04 2015
From G. C. Greubel, Aug 27 2025: (Start)
a(n) = 2^((n-2)/2)*( (n+1 mod 2)*A002203(n) + 2*sqrt(2)*(n mod 2)*A000129(n) ).
a(n) = 2^(n/2)*ChebyshevT(n, sqrt(2)). (End)

A003480 a(0) = 1, a(1) = 2, for n > 1, a(n) = 4*a(n-1) - 2*a(n-2).

Original entry on oeis.org

1, 2, 7, 24, 82, 280, 956, 3264, 11144, 38048, 129904, 443520, 1514272, 5170048, 17651648, 60266496, 205762688, 702517760, 2398545664, 8189147136, 27959497216, 95459694592, 325919783936, 1112759746560, 3799199418368, 12971278180352, 44286713884672, 151204299177984
Offset: 0

Views

Author

Keywords

Comments

Gives the number of L-convex polyominoes with n cells, that is convex polyominoes where any two cells can be connected by a path internal to the polyomino and which has at most 1 change of direction (i.e., one of the four orientation of the L). - Simone Rinaldi (rinaldi(AT)unisi.it), Feb 19 2007
Joe Keane (jgk(AT)jgk.org) observes that this sequence (beginning at 2) is "size of raises in pot-limit poker, one blind, maximum raising".
Dimensions of the graded components of the Hopf algebra of noncommutative multi-symmetric functions of level 2. For level r, the sequence would be the INVERT transform of binomial(n+r-1,n). - Jean-Yves Thibon (jyt(AT)univ-mlv.fr), Jun 26 2008
The sum of the numbers in the n-th row of the summatory Pascal triangle (A059576). - Ron R. King, Jan 22 2009
(1 + 2x + 7x^2 + 24x^3 + ...) = 1 / (1 - 2x - 3x^2 - 4x^3 - ...). - Gary W. Adamson, Jul 27 2009
Let M be a triangle with the odd-indexed Fibonacci numbers (1, 2, 5, 13, ...) in every column, with the leftmost column shifted upwards one row. A003480 = lim_{n->oo} M^n, the left-shifted vector considered as a sequence. The analogous operation using the even-indexed Fibonacci numbers generates A001835 starting with offset 1. - Gary W. Adamson, Jul 27 2010
a(n) is the number of generalized compositions of n when there are i+1 different types of the part i, (i=1,2,...). - Milan Janjic, Sep 24 2010
Let h(t) = (1-t)^2/(2*(1-t)^2-1) = 1/(1-(2*t + 3*t^2 + 4*t^3 + ...)),
an o.g.f. for A003480, then
A001003(n) = (1/n!)*((h(t)*d/dt)^n) t, evaluated at t=0, with initial n=1. - Tom Copeland, Sep 06 2011
Excluding the initial 1, a(n) is the 2nd subdiagonal of A228405. - Richard R. Forberg, Sep 02 2013

References

  • G. Castiglione and A. Restivo, L-convex polyominoes: a survey, Chapter 2 of K. G. Subranian et al., eds., Formal Models, Languages and Applications, World Scientific, 2015.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row sums of A059576 and of A181289. Second differences of A007070.
Column k=2 of A261780.

Programs

  • Haskell
    a003480 n = a003480_list !! n
    a003480_list = 1 : 2 : 7 : (tail $ zipWith (-)
       (tail $ map (* 4) a003480_list) (map (* 2) a003480_list))
    -- Reinhard Zumkeller, Jan 16 2012, Oct 03 2011
  • Maple
    INVERT([seq(n+1,n=1..20)]); # Jean-Yves Thibon (jyt(AT)univ-mlv.fr), Jun 26 2008
  • Mathematica
    a[0]=1; a[1]=2; a[2]=7; a[n_]:=a[n]=4*a[n-1] - 2*a[n-2]; Table[a[n],{n,0,24}] (* Jean-François Alcover, Mar 22 2011 *)
    Join[{1},LinearRecurrence[{4,-2},{2,7},40]] (* Harvey P. Dale, Oct 23 2011 *)
  • PARI
    a(n)=polcoeff((1-x)^2/(1-4*x+2*x^2)+x*O(x^n),n)
    
  • PARI
    a(n)=local(x); if(n<1,n==0,x=(2+quadgen(8))^n; imag(x)+real(x)/2)
    

Formula

a(n) = (n+1)*a(0) + n*a(1) + ... + 3*a(n-2) + 2*a(n-1). - Amarnath Murthy, Aug 17 2002
G.f.: (1-x)^2/(1-4*x+2*x^2). - Simon Plouffe in his 1992 dissertation
a(n) = A007070(n)/2, n > 0.
G.f.: 1/( 1 - Sum_{k>=1} (k+1)*x^k ).
a(n+1)*a(n+1) - a(n+2)*a(n) = 2^n, n > 0. - D. G. Rogers, Jul 12 2004
For n > 0, a(n) = ((2+sqrt(2))^(n+1) - (2-sqrt(2))^(n+1))/(4*sqrt(2)). - Rolf Pleisch, Aug 03 2009
If the leading 1 is removed, 2, 7, 24, ... is the binomial transform of 2, 5, 12, 29, ..., which is A000129 without its first 2 terms, and the second binomial transform of 2, 3, 4, 6, ..., which is A029744, again without its leading 1. - Al Hakanson (hawkuu(AT)gmail.com), Aug 08 2009
a(n) = Sum((1+p_1)*(1+p_2)*...*(1+p_m)), summation being over all compositions (p_1, p_2, ..., p_m) of n. Example: a(3)=24; indeed, the compositions of 3 are (1,1,1), (1,2), (2,1), (3) and we have 2*2*2 + 2*3 + 3*2 + 4 = 24. - Emeric Deutsch, Oct 17 2010
a(n) = Sum_{k>=0} binomial(n+2*k-1,n) / 2^(k+1). - Vaclav Kotesovec, Dec 31 2013
E.g.f.: (1 + exp(2*x)*(cosh(sqrt(2)*x) + sqrt(2)*sinh(sqrt(2)*x)))/2. - Stefano Spezia, May 20 2024

A070875 Binary expansion is 1x100...0 where x = 0 or 1.

Original entry on oeis.org

5, 7, 10, 14, 20, 28, 40, 56, 80, 112, 160, 224, 320, 448, 640, 896, 1280, 1792, 2560, 3584, 5120, 7168, 10240, 14336, 20480, 28672, 40960, 57344, 81920, 114688, 163840, 229376, 327680, 458752, 655360, 917504, 1310720, 1835008, 2621440
Offset: 0

Views

Author

N. J. A. Sloane, May 19 2002

Keywords

Comments

A 2-automatic sequence. - Charles R Greathouse IV, Sep 24 2012
Third row in array A228405. - Richard R. Forberg, Sep 06 2013
Conjecture: a(n) = -1 + positions of the ones in A309019(n+2) - A002487(n+2). - George Beck, Mar 26 2022
Consecutive integers for which the number of its proper nondivisors of the form 2^k (k > 0) is 2; proper nondivisors are defined in A173540 (5 has two such nondivisors: 2 and 4, 7 has 2 and 4, 10 has 4 and 8, 14 has 4 and 8, 20 has 8 and 16,...). - Lechoslaw Ratajczak, Dec 17 2024

Crossrefs

Programs

  • Magma
    [n le 2 select 2*n+3 else 2*Self(n-2): n in [1..39]]; // Bruno Berselli, Mar 01 2011
    
  • Mathematica
    Flatten@ NestList[ 2# &, {5, 7}, 19] (* Or *)
    CoefficientList[ Series[(5 + 7 x)/(1 - 2 x^2), {x, 0, 38}], x] (* Robert G. Wilson v, May 20 2002 *)
  • PARI
    a(n)=if(n%2,7,5)<<(n\2) \\ Charles R Greathouse IV, Sep 24 2012

Formula

A093873(a(n)) = 2. - Reinhard Zumkeller, Oct 13 2006
For n>1, a(n+1) = a(n) + A000010(a(n)). - Stefan Steinerberger, Dec 20 2007
From Bruno Berselli, Mar 01 2011: (Start)
G.f.: (5+7*x)/(1-2*x^2).
a(n) = (6-(-1)^n)*2^((2*n+(-1)^n-1)/4). Therefore: a(n) = 5*2^(n/2) for n even, otherwise a(n) = 7*2^((n-1)/2).
a(n) = 2*a(n-2) for n>1. (End)
a(n+1) = A063757(n) + 6. - Philippe Deléham, Apr 13 2013
a(n) = sqrt(2*a(n-1) - (-2)^(n-1)). - Richard R. Forberg, Sep 06 2013
a(n+3) = a(n+2)*a(n+1)/a(n). - Richard R. Forberg, Sep 06 2013
For n>1, a(n) = 2*phi(a(n)) + phi(phi(a(n))). - Ivan Neretin, Feb 28 2016
a(2n) = A020714(n), a(2n+1) = A005009(n); for n>0. - Yosu Yurramendi, Jun 01 2016
From Ilya Gutkovskiy, Jun 02 2016: (Start)
E.g.f.: 7*sinh(sqrt(2)*x)/sqrt(2) + 5*cosh(sqrt(2)*x).
a(n) = 2^((n-3)/2)*(5*sqrt(2)*(1 + (-1)^n) + 7*(1 - (-1)^n)). (End)
Sum_{n>=0} 1/a(n) = 24/35. - Amiram Eldar, Mar 28 2022

Extensions

Extended by Robert G. Wilson v, May 20 2002

A227418 Array A(n,k) with all numbers m such that 3*m^2 +- 3^k is a square and their corresponding square roots, read by downward antidiagonals.

Original entry on oeis.org

0, 1, 1, 0, 2, 4, 3, 3, 7, 15, 0, 6, 12, 26, 56, 9, 9, 21, 45, 97, 209, 0, 18, 36, 78, 168, 362, 780, 27, 27, 63, 135, 291, 627, 1351, 2911, 0, 54, 108, 234, 504, 1086, 2340, 5042, 10864, 81, 81, 189, 405, 873, 1881, 4053, 8733, 18817, 40545
Offset: 0

Views

Author

Richard R. Forberg, Sep 02 2013

Keywords

Comments

Array is analogous to A228405 in goal and structure, with key differences.
Left column is A001353. Top row (not in OEIS) interleaves 0 with the powers of 3, as: 0, 1, 0, 3, 0, 9, 0, 27, 0, 81.
Either or both may be used as initializing values. See Formula section.
The left column is the second binomial transform of the top row. The intermediate transform sequence is A002605, not present in this array.
The columns of the array hold all values, in sequential order, of numbers m such that 3*m^2 + 3^k or 3*m^2 - 3^k are squares, and their corresponding square roots in the next column, which then form the "next round" of m values for column k+1.
For example: A(n,0) are numbers such that 3*m^2 + 1 are squares, the integer square roots of each are in A(n,1), which are then numbers m such that 3*m^2 - 3 are squares, with those square roots in A(n,2), etc. The sign alternates for each increment of k, etc. No integer square roots exist for the opposite sign in a given column, regardless of n.
Also, A(n,1) are values of m such that floor(m^2/3) is square, with the corresponding square roots given by A(n,0).
A(n,k)/A(n,k-2) = 3; A(n,k)/A(n,k-1) converges to sqrt(3) for large n.
A(n,k)/A(n-1,k) converges to 2 + sqrt(3) for large n.
Several ways of combining the first few columns give OEIS sequences:
A(n,0) + A(n,1) = A001835; A(n,1) + A(n,2)= A001834; A(n,2) + A(n,3) = A082841;
A(n,0)*A(n,1)/2 = A007655(n); A(n+2,0)*A(n+1,1) = A001922(n);
A(n,0)*A(n+1,1) = A001921(n); A(n,0)^2 + A(n,1)^2 = A103974(n);
A(n,1)^2 - A(n,0)^2 = A011922(n); (A(n+2,0)^2 + A(n+1,1)^2)/2 = A122770(n) = 2*A011916(n).
The main diagonal (without initial 0) = 2*A090018. The first subdiagonal = abs(A099842). First superdiagonal = A141041.
A001353 (in left column) are the only initializing set of numbers where the recursive square root equation (see below) produces exclusively integer values, for all iterations of k. For any other initial values only even iterations (at k = 2, 4, ...) produce integers.

Examples

			The array, A(n, k), begins as:
    0,    1,    0,    3,    0,     9,     0,    27, ... see A000244;
    1,    2,    3,    6,    9,    18,    27,    54, ... A038754;
    4,    7,   12,   21,   36,    63,   108,   189, ... A228879;
   15,   26,   45,   78,  135,   234,   405,   702, ...
   56,   97,  168,  291,  504,   873,  1512,  2619, ...
  209,  362,  627, 1086, 1881,  3258,  5643,  9774, ...
  780, 1351, 2340, 4053, 7020, 12159, 21060, 36477, ...
Antidiagonal triangle, T(n, k), begins as:
   0;
   1,  1;
   0,  2,   4;
   3,  3,   7,  15;
   0,  6,  12,  26,  56;
   9,  9,  21,  45,  97,  209;
   0, 18,  36,  78, 168,  362,  780;
  27, 27,  63, 135, 291,  627, 1351, 2911;
   0, 54, 108, 234, 504, 1086, 2340, 5042, 10864;
  81, 81, 189, 405, 873, 1881, 4053, 8733, 18817, 40545;
		

Crossrefs

Programs

  • Magma
    function A(n,k)
      if k lt 0 then return 0;
      elif n eq 0 then return Round((1/2)*(1-(-1)^k)*3^((k-1)/2));
      elif k eq 0 then return Evaluate(ChebyshevSecond(n), 2);
      else return 2*A(n, k-1) - A(n-1, k-1);
      end if; return A;
    end function;
    A227418:= func< n,k | A(k, n-k) >;
    [A227418(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Oct 09 2022
    
  • Mathematica
    A[n_, k_]:= If[k<0, 0, If[k==0, ChebyshevU[n-1, 2], 2*A[n, k-1] - A[n-1, k-1]]];
    T[n_, k_]:= A[k, n-k];
    Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Oct 09 2022 *)
  • SageMath
    def A(n,k):
        if (k<0): return 0
        elif (k==0): return chebyshev_U(n-1,2)
        else: return 2*A(n, k-1) - A(n-1, k-1)
    def A227418(n, k): return A(k, n-k)
    flatten([[A227418(n,k) for k in range(n+1)] for n in range(15)]) # G. C. Greubel, Oct 09 2022

Formula

If using the left column and top row to initialize, then: A(n,k) = 2*A(n, k-1) - A(n-1, k-1).
If using only the top row to initialize, then: A(n,k) = 4*A(n-1,k) - A(n-2,k).
If using the left column to initialize, then: A(n,k) = sqrt(3*A(n,k-1) + (-3)^(k-1)), for all n, k > 0.
Other internal relationships that apply are: A(2*n-1, 2*k) = A(n,k)^2 - A(n-1,k)^2;
A(n+1,k) * A(n,k+1) - A(n+1, k+1) * A(n,k) = (-3)^k, for all n, k > 0.
A(n, 0) = A001353(n).
A(n, 1) = A001075(n).
A(n, 2) = A005320(n).
A(n, 3) = A151961(n).
A(1, k) = A038754(k).
A(n, n) = 2*A090018(n), for n > 0 (main diagonal).
A(n, n+1) = A141041(n-1) (superdiagonal).
A(n+1, n) = abs(A099842(n)) (subdiagonal).
From G. C. Greubel, Oct 09 2022: (Start)
T(n, 0) = (1/2)*(1-(-1)^n)*3^((n-1)/2).
T(n, 1) = A038754(n-1).
T(n, 2) = A228879(n-2).
T(2*n-1, n-1) = A141041(n-1).
T(2*n, n) = 2*A090018(n-1), n > 0.
T(n, n-4) = 3*A005320(n-4).
T(n, n-3) = 3*A001075(n-3).
T(n, n-2) = 3*A001353(n-2).
T(n, n-1) = A001075(n-1).
T(n, n) = A001353(n).
Sum_{k=0..n-1} T(n, k) = A084156(n).
Sum_{k=0..n} T(n, k) = A084156(n) + A001353(n). (End)

Extensions

Offset corrected by G. C. Greubel, Oct 09 2022

A010914 Pisot sequence E(5,17), a(n) = floor(a(n-1)^2 / a(n-2) + 1/2).

Original entry on oeis.org

5, 17, 58, 198, 676, 2308, 7880, 26904, 91856, 313616, 1070752, 3655776, 12481600, 42614848, 145496192, 496755072, 1696027904, 5790601472, 19770350080, 67500197376, 230460089344, 786839962624, 2686439671808, 9172078761984, 31315435704320, 106917585293312
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{4, -2}, {5, 17}, 26] (* Jean-François Alcover, Jan 09 2019 *)
  • PARI
    {a(n) = if( n<0, 0, real( (10 + 7 * quadgen(8)) / 2 * (2 + quadgen(8))^n ))} /* Michael Somos, Sep 03 2013 */
    
  • PARI
    {a(n) = if( n<0, 0, n += 3 ; 2^ceil((n - 4)/2) * polcoeff( (1 + x - 3*x^2 - x^3) / (1 - 6*x^2 + x^4) + x * O(x^n), n))} /* Michael Somos, Sep 03 2013 */
    
  • PARI
    Vec((5-3*x)/(1-4*x+2*x^2) + O(x^30)) \\ Colin Barker, Dec 06 2015

Formula

From Max Alekseyev, Sep 03 2013: (Start)
It is not hard to show that this sequence satisfies the following simple linear recurrence relation: a(n) = 4*a(n-1) - 2*a(n-2).
Proof: Let a(n) = A010914(n) be the sequence defined by the recurrence a(n) = floor( a(n-1)^2/a(n-2) + 1/2 ) and initial terms a(0)=5 and a(1)=17. Define a sequence b(n) by the recurrence b(n) = 4*b(n-1) - 2*b(n-2) and the same initial terms b(0)=a(0)=5 and b(1)=a(1)=17. We want to prove that a(n)=b(n) for all n.
The main trick is that instead of proving that the sequence a() satisfies the recurrence for the sequence b(), we will do it the other way around: prove that b() satisfies the recurrence for a(). This will imply that these two sequences coincide.
To prove that b() satisfies the recurrence for a(), it is enough to show that abs( b(n-1)^2 - b(n)*b(n-2) ) < b(n-2)/2. To do this, we will use the explicit formula for b(n) that
b(n) = (10+7*sqrt(2))/4 * (2+sqrt(2))^n + (10-7*sqrt(2))/4 * (2-sqrt(2))^n.
Computing abs( b(n-1)^2 - b(n)*b(n-2) ), one finds that it equals 2^n times a constant. At the same time, b(n) grows as (2+sqrt(2))^n (up to a constant) which allows one to easily prove (e.g., by induction on n) that abs( b(n-1)^2 - b(n)*b(n-2) ) < b(n-2)/2. (End)
For positive n, a(n) equals [1,1;1,3]^n.[1,2].[1.2], which means calculate the n-th power of the specific 2 X 2 matrix, multiply from the right by the column vector [1,2], and finally take the dot product of this column vector with the vector [1,2]. - John M. Campbell, Jul 09 2011
a(n) is the 3rd subdiagonal of array A228405. - Richard R. Forberg, Sep 02 2013
a(n) = A079496(n+3) * A016116(n). - Michael Somos, Sep 03 2013
a(n) - a(n-1)^2 / a(n-2) = 2^floor(n/2) / A143609(n+1) < 1/2 if n>1. - Michael Somos, Sep 03 2013
G.f.: (5-3*x) / (1-4*x+2*x^2). - Colin Barker, Dec 06 2015

A292466 Triangle read by rows: T(n,k) = 4*T(n-1,k-1) + T(n,k-1) with T(2*m,0) = 0 and T(2*m+1,0) = 5^m.

Original entry on oeis.org

0, 1, 1, 0, 4, 8, 5, 5, 21, 53, 0, 20, 40, 124, 336, 25, 25, 105, 265, 761, 2105, 0, 100, 200, 620, 1680, 4724, 13144, 125, 125, 525, 1325, 3805, 10525, 29421, 81997, 0, 500, 1000, 3100, 8400, 23620, 65720, 183404, 511392, 625, 625, 2625, 6625, 19025, 52625
Offset: 0

Views

Author

Seiichi Manyama, Sep 22 2017

Keywords

Examples

			First few rows are:
    0;
    1,   1;
    0,   4,   8;
    5,   5,  21,   53;
    0,  20,  40,  124,  336;
   25,  25, 105,  265,  761,  2105;
    0, 100, 200,  620, 1680,  4724, 13144;
  125, 125, 525, 1325, 3805, 10525, 29421, 81997.
--------------------------------------------------------------
The diagonal is      {0, 1,  8,  53, 336, 2105, ...} and
the next diagonal is {1, 4, 21, 124, 761, 4724, ...}.
Two sequences have the following property:
     1^2 - 5*   0^2 = 1      (= 11^0),
     4^2 - 5*   1^2 = 11     (= 11^1),
    21^2 - 5*   8^2 = 121    (= 11^2),
   124^2 - 5*  53^2 = 1331   (= 11^3),
   761^2 - 5* 336^2 = 14641  (= 11^4),
  4724^2 - 5*2105^2 = 161051 (= 11^5),
  ...
		

Crossrefs

The diagonal of the triangle is A091870.
The next diagonal of the triangle is A108404.
T(n,k) = b*T(n-1,k-1) + T(n,k-1): A292789 (b=-3), A292495 (b=-2), A117918 and A228405 (b=1), A227418 (b=2), this sequence (b=4).

Formula

T(n+1,n)^2 - 5*T(n,n)^2 = 11^n.
Showing 1-10 of 12 results. Next