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-7 of 7 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

A104934 Expansion of (1-x)/(1 - 3*x - 2*x^2).

Original entry on oeis.org

1, 2, 8, 28, 100, 356, 1268, 4516, 16084, 57284, 204020, 726628, 2587924, 9217028, 32826932, 116914852, 416398420, 1483024964, 5281871732, 18811665124, 66998738836, 238619546756, 849856117940, 3026807447332, 10780134577876, 38394018628292, 136742325040628, 487015012378468, 1734529687216660
Offset: 0

Views

Author

Creighton Dement, Mar 29 2005

Keywords

Comments

A floretion-generated sequence relating A007482, A007483, A007484. Inverse is A046717. Inverse of Fibonacci(3n+1), A033887. Binomial transform is A052984. Inverse binomial transform is A006131. Note: the conjectured relation 2*a(n) = A007482(n) + A007483(n-1) is a result of the FAMP identity dia[I] + dia[J] + dia[K] = jes + fam
Floretion Algebra Multiplication Program, FAMP Code: 1dia[I]tesseq[A*B] with A = - .25'i + .25'j + .25'k - .25i' + .25j' + .25k' - .25'ii' + .25'jj' + .25'kk' + .25'ij' + .25'ik' + .25'ji' + .25'jk' + .25'ki' + .25'kj' - .25e and B = + 'i + i' + 'ji' + 'ki' + e
a(n) is also the number of ways to build a (2 x 2 x n)-tower using (2 X 1 X 1)-bricks (see Exercise 3.15 in Aigner's book). - Vania Mascioni (vmascioni(AT)bsu.edu), Mar 09 2009
a(n) is the number of compositions of n when there are 2 types of 1 and 4 types of other natural numbers. - Milan Janjic, Aug 13 2010
Pisano period lengths: 1, 1, 4, 1, 24, 4, 48, 1, 12, 24, 30, 4, 12, 48, 24, 1,272, 12, 18, 24, ... - R. J. Mathar, Aug 10 2012

References

  • M. Aigner, A Course in Enumeration, Springer, 2007, p.103.

Crossrefs

Programs

  • Julia
    # Following the Pari implementation.
    function a(n)
       F = BigInt[0 1; 2 3]
       Fn = F^n * [1; 2]
       Fn[1, 1]
    end # Peter Luschny, Jan 06 2019
    
  • Magma
    m:=35; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(1 - x)/(1 - 3*x - 2*x^2)); // Vincenzo Librandi, Jul 13 2018
    
  • Maple
    a := proc(n) option remember; `if`(n < 2, [1, 2][n+1], (3*a(n-1) + 2*a(n-2))) end:
    seq(a(n), n=0..28); # Peter Luschny, Jan 06 2019
  • Mathematica
    LinearRecurrence[{3, 2}, {1, 2}, 40] (* Vincenzo Librandi, Jul 13 2018 *)
    CoefficientList[Series[(1-x)/(1-3x-2x^2),{x,0,40}],x] (* Harvey P. Dale, May 02 2019 *)
  • PARI
    a(n)=([0,1; 2,3]^n*[1;2])[1,1] \\ Charles R Greathouse IV, Jun 20 2015
    
  • SageMath
    [(i*sqrt(2))^(n-1)*(i*sqrt(2)*chebyshev_U(n, -3*i/(2*sqrt(2))) - chebyshev_U(n-1, -3*i/(2*sqrt(2))) ) for n in (0..40)] # G. C. Greubel, Jun 27 2021

Formula

Define A007483(-1) = 1. Then 2*a(n) = A007482(n) + A007483(n-1) (conjecture);
a(n+2) = 4*A007484(n) (thus 8*A007484(n) = A007482(n+2) + A007483(n+1));
a(n+1) = 2*A055099(n);
a(n+2) - a(n+1) - a(n) = A007484(n+1) - A007484(n).
a(0)=1, a(1)=2, a(n) = 3*a(n-1) + 2*a(n-2) for n > 1. - Philippe Deléham, Sep 19 2006
a(n) = Sum_{k=0..n} 2^k*A122542(n,k). - Philippe Deléham, Oct 08 2006
a(n) = ((17+sqrt(17))/34)*((3+sqrt(17))/2)^n + ((17-sqrt(17))/34)*((3-sqrt(17))/2)^n. - Richard Choulet, Nov 19 2008
a(n) = 2*a(n-1) + 4*Sum_{k=0..n-2} a(k) for n > 0. - Vania Mascioni (vmascioni(AT)bsu.edu), Mar 09 2009
G.f.: (1-x)/(1-3*x-2*x^2). - M. F. Hasler, Jul 12 2018
a(n) = (i*sqrt(2))^(n-1)*( i*sqrt(2)*ChebyshevU(n, -3*i/(2*sqrt(2))) - ChebyshevU(n-1, -3*i/(2*sqrt(2))) ). - G. C. Greubel, Jun 27 2021
E.g.f.: exp(3*x/2)*(sqrt(17)*cosh(sqrt(17)*x/2) + sinh(sqrt(17)*x/2))/sqrt(17). - Stefano Spezia, May 24 2024

A275183 T(n,k)=Number of nXk 0..2 arrays with no element equal to any value at offset (-2,-1) (-1,0) or (-1,1) and new values introduced in order 0..2.

Original entry on oeis.org

1, 2, 1, 5, 4, 2, 14, 16, 7, 4, 41, 64, 25, 12, 8, 122, 256, 89, 41, 21, 16, 365, 1024, 317, 141, 85, 37, 32, 1094, 4096, 1129, 482, 353, 181, 65, 64, 3281, 16384, 4021, 1651, 1465, 914, 389, 114, 128, 9842, 65536, 14321, 5653, 6081, 4603, 2386, 834, 200, 256, 29525
Offset: 1

Views

Author

R. H. Hardin, Jul 19 2016

Keywords

Comments

Table starts
...1...2....5....14.....41.....122......365......1094.......3281........9842
...1...4...16....64....256....1024.....4096.....16384......65536......262144
...2...7...25....89....317....1129.....4021.....14321......51005......181657
...4..12...41...141....482....1651.....5653.....19356......66277......226937
...8..21...85...353...1465....6081....25241....104769.....434873.....1805057
..16..37..181...914...4603...23313...117916....596625....3018913....15274618
..32..65..389..2386..14643...90793...561044...3472521...21488129...132962186
..64.114..834..6228..46799..355258..2688402..20397794..154665843..1172975241
.128.200.1781.16249.149772.1392050.12931103.120384453.1120217646.10428404709
.256.351.3799.42451.479722.5466938.62408531.713359905.8156812360.93298660085

Examples

			Some solutions for n=4 k=4
..0..0..1..2. .0..1..1..2. .0..0..1..1. .0..0..1..2. .0..0..0..1
..2..2..0..1. .2..0..0..1. .2..2..0..0. .2..2..0..1. .1..2..2..0
..0..1..2..0. .1..2..2..2. .0..1..1..2. .1..1..2..2. .0..1..1..2
..2..0..1..2. .0..0..1..1. .2..0..0..1. .0..0..0..1. .2..2..0..0
		

Crossrefs

Column 1 is A000079(n-2).
Column 2 is A005251(n+3).
Row 1 is A007051(n-1).
Row 2 is A000302(n-1).
Row 3 is A007484(n-1).

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) for n>2
k=2: a(n) = 2*a(n-1) -a(n-2) +a(n-3)
k=3: a(n) = 4*a(n-1) -6*a(n-2) +5*a(n-3) -a(n-4) -a(n-5) for n>8
k=4: [order 9] for n>12
k=5: [order 16] for n>21
k=6: [order 34] for n>39
k=7: [order 67] for n>73
Empirical for row n:
n=1: a(n) = 4*a(n-1) -3*a(n-2)
n=2: a(n) = 4*a(n-1)
n=3: a(n) = 3*a(n-1) +2*a(n-2)
n=4: a(n) = 2*a(n-1) +4*a(n-2) +3*a(n-3) for n>4
n=5: a(n) = 2*a(n-1) +7*a(n-2) +8*a(n-3) for n>5
n=6: a(n) = 2*a(n-1) +12*a(n-2) +19*a(n-3) -4*a(n-4) -12*a(n-5) -16*a(n-6) for n>7
n=7: [order 9] for n>10

A184761 T(n,k)=Half the number of nXk binary arrays with no 1 having an adjacent 1 both above and to its left.

Original entry on oeis.org

1, 2, 2, 4, 7, 4, 8, 25, 25, 8, 16, 89, 163, 89, 16, 32, 317, 1056, 1056, 317, 32, 64, 1129, 6847, 12397, 6847, 1129, 64, 128, 4021, 44391, 145778, 145778, 44391, 4021, 128, 256, 14321, 287802, 1713803, 3110914, 1713803, 287802, 14321, 256, 512, 51005, 1865917
Offset: 1

Views

Author

R. H. Hardin Jan 21 2011

Keywords

Comments

Table starts
...1......2........4...........8.............16...............32
...2......7.......25..........89............317.............1129
...4.....25......163........1056...........6847............44391
...8.....89.....1056.......12397.........145778..........1713803
..16....317.....6847......145778........3110914.........66363023
..32...1129....44391.....1713803.......66363023.......2568513843
..64...4021...287802....20148584.....1415755252......99419347147
.128..14321..1865917...236878817....30202770902....3848174315295
.256..51005.12097367..2784890782...644326291402..148949599913987
.512.181657.78431296.32740859687.13745636657969.5765325542821919

Examples

			Some solutions for 4X3
..1..1..0....1..0..0....0..1..1....0..0..0....0..0..1....1..0..0....0..0..0
..0..0..0....0..0..1....0..0..1....0..0..1....1..0..0....0..1..0....1..0..1
..1..1..0....1..0..1....1..1..0....0..0..1....1..1..0....0..0..1....1..0..1
..0..0..0....0..0..0....0..0..1....1..1..0....0..1..0....1..0..0....0..1..0
		

Crossrefs

Column 2 is A007484(n-1) and 1/2 A055099 and 1/4 A104934(n+1)

A208269 T(n,k)=Number of nXk 0..1 arrays with new values 0..1 introduced in row major order and no element equal to more than two of its immediate leftward or upward or left-upward diagonal neighbors.

Original entry on oeis.org

1, 2, 2, 4, 7, 4, 8, 25, 25, 8, 16, 89, 161, 89, 16, 32, 317, 1033, 1033, 317, 32, 64, 1129, 6631, 11929, 6631, 1129, 64, 128, 4021, 42563, 137845, 137845, 42563, 4021, 128, 256, 14321, 273205, 1592731, 2867739, 1592731, 273205, 14321, 256, 512, 51005, 1753657
Offset: 1

Views

Author

R. H. Hardin Feb 24 2012

Keywords

Comments

Table starts
...1.....2.......4.........8..........16............32..............64
...2.....7......25........89.........317..........1129............4021
...4....25.....161......1033........6631.........42563..........273205
...8....89....1033.....11929......137845.......1592731........18403423
..16...317....6631....137845.....2867739......59655167......1240971177
..32..1129...42563...1592731....59655167....2234126207.....83670667271
..64..4021..273205..18403423..1240971177...83670667271...5641457245533
.128.14321.1753657.212644499.25815151595.3133560234217.380372051615157

Examples

			Some solutions for n=4 k=3
..0..1..0....0..0..1....0..0..0....0..1..0....0..0..0....0..0..0....0..0..0
..0..0..0....0..1..0....0..1..1....1..0..1....0..1..1....1..0..1....1..0..1
..1..1..1....1..1..1....1..0..1....0..0..0....1..0..1....0..1..1....1..0..1
..1..0..0....0..0..0....0..1..0....1..1..0....0..1..1....0..0..1....1..0..1
		

Crossrefs

Column 2 is A007484(n-1)

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

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

Original entry on oeis.org

1, 1, 3, 5, 11, 17, 39, 61, 139, 217, 495, 773, 1763, 2753, 6279, 9805, 22363, 34921, 79647, 124373, 283667, 442961, 1010295, 1577629, 3598219, 5618809, 12815247, 20011685, 45642179, 71272673, 162557031, 253841389, 578955451, 904069513
Offset: 0

Views

Author

Keywords

References

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

Crossrefs

Programs

  • Haskell
    a007455_list = 1 : 1 : 3 : 5 : zipWith (+)
       (map (* 2) a007455_list) (map (* 3) $ drop 2 a007455_list)
    a007455 n = a007455_list !! n
    -- Reinhard Zumkeller, Jul 16 2012
    
  • Mathematica
    CoefficientList[Series[(-1-x-2 x^3)/(-1+3 x^2+2 x^4),{x,0,40}],x]  (* Harvey P. Dale, Feb 18 2011 *)
    LinearRecurrence[{0,3,0,2},{1,1,3,5},40] (* Harvey P. Dale, Feb 10 2015 *)
  • PARI
    A007455(n)=[n%2*2+3,1]*([3,1;2,0]^(n\2-1))[,1] \\ M. F. Hasler, Jun 19 2019

Formula

a(n) = 3*a(n-2) + 2*a(n-4).
G.f. = (1 + x + 2 x^3)/(1 - 3 x^2 - 2 x^4). - Harvey P. Dale, Feb 18 2011, edited by M. F. Hasler, Jun 19 2019
Showing 1-7 of 7 results.