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-3 of 3 results.

A007482 a(n) is the number of subsequences of [ 1, ..., 2n ] in which each odd number has an even neighbor.

Original entry on oeis.org

1, 3, 11, 39, 139, 495, 1763, 6279, 22363, 79647, 283667, 1010295, 3598219, 12815247, 45642179, 162557031, 578955451, 2061980415, 7343852147, 26155517271, 93154256107, 331773802863, 1181629920803, 4208437368135
Offset: 0

Views

Author

Keywords

Comments

The even neighbor must differ from the odd number by exactly one.
If we defined this sequence by the recurrence (a(n) = 3*a(n-1) + 2*a(n-2)) that it satisfies, we could prefix it with an initial 0.
a(n) equals term (1,2) in M^n, M = the 3 X 3 matrix [1,1,2; 1,0,1; 2,1,1]. - Gary W. Adamson, Mar 12 2009
a(n) equals term (2,2) in M^n, M = the 3 X 3 matrix [0,1,0; 1,3,1; 0,1,0]. - Paul Barry, Sep 18 2009
From Gary W. Adamson, Aug 06 2010: (Start)
Starting with "1" = INVERT transform of A002605: (1, 2, 6, 16, 44, ...).
Example: a(3) = 39 = (16, 6, 2, 1) dot (1, 1, 3, 11) = (16 + 6 + 6 + 11). (End)
Pisano periods: 1, 1, 4, 1, 24, 4, 48, 2, 12, 24, 30, 4, 12, 48, 24, 4,272, 12, 18, 24, ... . - R. J. Mathar, Aug 10 2012
A007482 is also the number of ways of tiling a 3 X n rectangle with 1 X 1 squares, 2 X 2 squares and 2 X 1 (vertical) dominoes. - R. K. Guy, May 20 2015
With offset 1 (a(0) = 0, a(1) = 1) this is a divisibility sequence. - Michael Somos, Jun 03 2015
Number of elements of size 2^(-n) in a fractal generated by the second-order reversible cellular automaton, rule 150R (see the reference and the link). - Yuriy Sibirmovsky, Oct 04 2016
a(n) is the number of compositions (ordered partitions) of n into parts 1 (of three kinds) and 2 (of two kinds). - Joerg Arndt, Oct 05 2016
a(n) equals the number of words of length n over {0,1,2,3,4} in which 0 and 1 avoid runs of odd lengths. - Milan Janjic, Jan 08 2017
Start with a single cell at coordinates (0, 0), then iteratively subdivide the grid into 2 X 2 cells and remove the cells that have two '1's in their modulo 3 coordinates. a(n) is the number of cells after n iterations. Cell configuration converges to a fractal with approximate dimension 1.833. - Peter Karpov, Apr 20 2017
This is the Lucas sequence U(P=3,Q=-2), and hence for n>=0, a(n+2)/a(n+1) equals the continued fraction 3 + 2/(3 + 2/(3 + 2/(3 + ... + 2/3))) with n 2's. - Greg Dresden, Oct 06 2019

Examples

			G.f. = 1 + 3*x + 11*x^2 + 39*x^3 + 139*x^4 + 495*x^5 + 1763*x^6 + ...
From _M. F. Hasler_, Jun 16 2019: (Start)
For n = 0, (1, ..., 2n) = () is the empty sequence, which is equal to its only subsequence, which satisfies the condition voidly, whence a(0) = 1.
For n = 1, (1, ..., 2n) = (1, 2); among the four subsequences {(), (1), (2), (1,2)} only (1) does not satisfy the condition, whence a(1) = 3.
For n = 2, (1, ..., 2n) = (1, 2, 3, 4); among the sixteen subsequences {(), ..., (1,2,3,4)}, the 5 subsequences (1), (3), (1,3), (2,3,4) and (1,2,3,4) do not satisfy the condition, whence a(2) = 16 - 5 = 11.
(End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002, p. 439.

Crossrefs

Row sums of triangle A073387.
Cf. A000045, A000129, A001045, A007455, A007481, A007483, A007484, A015518, A201000 (prime subsequence), A052913 (binomial transform), A026597 (inverse binomial transform).
Cf. A206776.

Programs

  • Haskell
    a007482 n = a007482_list !! (n-1)
    a007482_list = 1 : 3 : zipWith (+)
                   (map (* 3) $ tail a007482_list) (map (* 2) a007482_list)
    -- Reinhard Zumkeller, Oct 21 2015
    
  • Magma
    I:=[1,3]; [n le 2 select I[n] else 3*Self(n-1) + 2*Self(n-2): n in [1..30]]; // G. C. Greubel, Jan 16 2018
  • Maple
    a := n -> `if`(n=0, 1, 3^n*hypergeom([(1-n)/2,-n/2], [-n], -8/9)):
    seq(simplify(a(n)), n = 0..23); # Peter Luschny, Jun 28 2017
  • Mathematica
    a[n_]:=(MatrixPower[{{1,4},{1,2}},n].{{1},{1}})[[2,1]]; Table[a[n],{n,0,40}] (* Vladimir Joseph Stephan Orlovsky, Feb 19 2010 *)
    LinearRecurrence[{3,2},{1,3},30] (* Harvey P. Dale, May 25 2013 *)
    a[ n_] := Module[ {m = n + 1, s = 1}, If[ m < 0, {m, s} = -{m, (-2)^m}]; s SeriesCoefficient[ x / (1 - 3 x - 2 x^2), {x, 0, m}]]; (* Michael Somos, Jun 03 2015 *)
    a[ n_] := With[{m = n + 1}, If[ m < 0, (-2)^m a[ -m], Expand[((3 + Sqrt[17])/2)^m - ((3 - Sqrt[17])/2)^m ] / Sqrt[17]]]; (* Michael Somos, Oct 13 2016 *)
  • Maxima
    a(n) := if n=0 then 1 elseif n=1 then 3 else 3*a(n-1)+2*a(n-2);
    makelist(a(n),n,0,12); /* Emanuele Munarini, Jun 28 2017 */
    
  • PARI
    {a(n) = 2*imag(( (3 + quadgen(68)) / 2)^(n+1))}; /* Michael Somos, Jun 03 2015 */
    
  • Sage
    [lucas_number1(n,3,-2) for n in range(1, 25)] # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: 1/(1-3*x-2*x^2).
a(n) = 3*a(n-1) + 2*a(n-2).
a(n) = (ap^(n+1)-am^(n+1))/(ap-am), where ap = (3+sqrt(17))/2 and am = (3-sqrt(17))/2.
Let b(0) = 1, b(k) = floor(b(k-1)) + 2/b(k-1); then, for n>0, b(n) = a(n)/a(n-1). - Benoit Cloitre, Sep 09 2002
The Hankel transform of this sequence is [1,2,0,0,0,0,0,0,0,...]. - Philippe Deléham, Nov 21 2007
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)2^k*3^(n-2k). - Paul Barry, Apr 23 2005
a(n) = Sum_{k=0..n} A112906(n,k). - Philippe Deléham, Nov 21 2007
a(n) = - a(-2-n) * (-2)^(n+1) for all n in Z. - Michael Somos, Jun 03 2015
If c = (3 + sqrt(17))/2, then c^n = (A206776(n) + sqrt(17)*a(n-1)) / 2. - Michael Somos, Oct 13 2016
a(n) = 3^n*hypergeom([(1-n)/2,-n/2], [-n], -8/9) for n>=1. - Peter Luschny, Jun 28 2017
a(n) = round(((sqrt(17) + 3)/2)^(n+1)/sqrt(17)). The distance of the argument from the nearest integer is about 1/2^(n+3). - M. F. Hasler, Jun 16 2019
E.g.f.: (1/17)*exp(3*x/2)*(17*cosh(sqrt(17)*x/2) + 3*sqrt(17)*sinh(sqrt(17)*x/2)). - Stefano Spezia, Oct 07 2019
a(n) = (sqrt(2)*i)^n * ChebyshevU(n, -3*i/(2*sqrt(2))). - G. C. Greubel, Dec 24 2021
G.f.: 1/(1 - 3*x - 2*x^2) = Sum_{n >= 0} x^n * Product_{k = 1..n} (k + 2*x + 2)/(1 + k*x) (a telescoping series). Cf. A015518. - Peter Bala, May 08 2024

A007484 a(n) = 3*a(n-1) + 2*a(n-2), with a(0)=2, a(1)=7.

Original entry on oeis.org

2, 7, 25, 89, 317, 1129, 4021, 14321, 51005, 181657, 646981, 2304257, 8206733, 29228713, 104099605, 370756241, 1320467933, 4702916281, 16749684709, 59654886689, 212464029485, 756701861833, 2695033644469, 9598504657073, 34185581260157, 121753753094617, 433632421804165
Offset: 0

Views

Author

Keywords

Comments

Number of subsequences of [1,...,2n+1] in which each even number has an odd neighbor.
Same as Pisot sequence E(2,7) (see A008776).
8*a(n) = A007482(n+2) + A007483(n+1) (conjectured, see A104934 for related formula). - Creighton Dement, Apr 15 2005
Conjecture verified using generating functions. - Robert Israel, Jul 12 2018
a(n) = sum of the elements of the matrix M^n, where M = {{1, 2}, {2, 2}}. - Griffin N. Macris, Mar 25 2016
a(3) = 25 is the only composite among the first 8 terms, but then the density of primes decreases, dropping below 50% at the 27th term. - M. F. Hasler, Jul 12 2018
a(n) is also the number of dominating sets in the (2n+1)-triangular snake graph for n > 0. - Eric W. Weisstein, Jun 09 2019

Examples

			G.f. = 2 + 7*x + 25*x^2 + 89*x^3 + 317*x^4 + 1129*x^5 + ... - _Michael Somos_, Jul 19 2021
		

References

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

Crossrefs

See A008776 for definitions of Pisot sequences.

Programs

  • Haskell
    a007484 n = a007484_list !! n
    a007484_list = 2 : 7 : zipWith (+)
                   (map (* 3) $ tail a007484_list) (map (* 2) a007484_list)
    -- Reinhard Zumkeller, Nov 02 2015
    
  • Magma
    A007484:=[2, 7]; [n le 2 select A007484[n] else 3*Self(n-1)+2*Self(n-2): n in [1..40]]; // Wesley Ivan Hurt, Jan 24 2017
    
  • Maple
    A007484 := proc(n) option remember; if n=0 then 2; elif n=1 then 7; else 3*A007484(n-1)+2*A007484(n-2); fi; end;
  • Mathematica
    LinearRecurrence[{3, 2}, {2, 7}, 40] (* Harvey P. Dale, Apr 24 2012 *)
    Table[(2^-n ((3 - Sqrt[17])^n (-4 + Sqrt[17]) + (3 + Sqrt[17])^n (4 + Sqrt[17])))/Sqrt[17], {n, 0, 20}] // Expand (* Eric W. Weisstein, Jun 09 2019 *)
    CoefficientList[Series[(2+x)/(1 -3x -2x^2), {x, 0, 20}], x] (* Eric W. Weisstein, Jun 09 2019 *)
    a[ n_] := MatrixPower[{{1, 2}, {2, 2}}, n]//Flatten//Total; (* Michael Somos, Jul 19 2021 *)
  • PARI
    a(n)=([0,1; 2,3]^n*[2;7])[1,1] \\ Charles R Greathouse IV, Mar 25 2016
    
  • PARI
    A007484_vec(N)=Vec((2+x)/(1-3*x-2*x^2)+O(x^n)) \\ M. F. Hasler, Jul 12 2018
    
  • Sage
    [(i*sqrt(2))^(n-1)*( i*2*sqrt(2)*chebyshev_U(n, -3*i/(2*sqrt(2))) + chebyshev_U(n-1, -3*i/(2*sqrt(2))) ) for n in (0..30)] # G. C. Greubel, Jul 18 2021

Formula

a(n) = nearest integer to (and converges rapidly to) (1+4/sqrt(17))*((3+sqrt(17))/2)^n. - N. J. A. Sloane, Jul 30 2016
If p[i] = Fibonacci(i+2) 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
G.f.: (2 + x)/(1 - 3*x - 2*x^2). - M. F. Hasler, Jul 12 2018
From G. C. Greubel, Jul 18 2021: (Start)
a(n) = (i*sqrt(2))^(n-1)*( i*2*sqrt(2)*ChebyshevU(n, -3*i/(2*sqrt(2))) + ChebyshevU(n-1, -3*i/(2*sqrt(2))) ).
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*((7*n-8*k)/(n-k))*2^k*3^(n-2*k-1) with a(0) = 2. (End)
If we extend the definition of A007483(m) to negative m by using the recurrence, then a(n) = A007483(-3-n)*(-2)^n holds for all n in Z. - Michael Somos, Jul 19 2021
E.g.f.: 2*exp(3*x/2)*(17*cosh(sqrt(17)*x/2) + 4*sqrt(17)*sinh(sqrt(17)*x/2))/17. - Stefano Spezia, May 24 2024

Extensions

Definition edited by N. J. A. Sloane, Jul 30 2016

A007481 Number of subsequences of [ 1,...,n ] in which each even number has an odd neighbor.

Original entry on oeis.org

1, 2, 3, 7, 11, 25, 39, 89, 139, 317, 495, 1129, 1763, 4021, 6279, 14321, 22363, 51005, 79647, 181657, 283667, 646981, 1010295, 2304257, 3598219, 8206733, 12815247, 29228713, 45642179, 104099605, 162557031, 370756241, 578955451, 1320467933
Offset: 0

Views

Author

Keywords

Comments

A055099(n) = a(2*n+1) - a(2*n) = a(2*(n+1)) - a(2*n+1). - Reinhard Zumkeller, Oct 25 2015

Examples

			For n=2, there are the following three subsequences of [1,2] with the desired property: empty, [1], [1,2].
For n=3, there are the following seven subsequences of [1,2,3] with the desired property: empty, [1], [3], [1,2], [2,3], [1,3], [1,2,3].
		

References

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

Crossrefs

Programs

  • Haskell
    a007481 n = a007481_list !! n
    a007481_list = 1 : 2 : 3 : 7 : zipWith (+)
                   (map (* 3) $ drop 2 a007481_list) (map (* 2) a007481_list)
    -- Reinhard Zumkeller, Oct 25 2015
    
  • Mathematica
    LinearRecurrence[{0,3,0,2},{1,2,3,7},40] (* Harvey P. Dale, Feb 29 2012 *)
  • PARI
    a(n)=([0,1,0,0; 0,0,1,0; 0,0,0,1; 2,0,3,0]^n*[1;2;3;7])[1,1] \\ Charles R Greathouse IV, Mar 02 2016

Formula

a(n) = 3*a(n-2) + 2*a(n-4).
G.f.: (x^3+2*x+1)/(-2*x^4-3*x^2+1). - Harvey P. Dale, Feb 29 2012

Extensions

More terms from James Sellers, Dec 24 1999
Showing 1-3 of 3 results.