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 19 results. Next

A126473 Number of strings over a 5 symbol alphabet with adjacent symbols differing by three or less.

Original entry on oeis.org

1, 5, 23, 107, 497, 2309, 10727, 49835, 231521, 1075589, 4996919, 23214443, 107848529, 501037445, 2327695367, 10813893803, 50238661313, 233396326661, 1084301290583, 5037394142315, 23402480441009, 108722104190981, 505095858086951, 2346549744920747
Offset: 0

Views

Author

R. H. Hardin, Dec 27 2006

Keywords

Comments

[Empirical] a(base,n) = a(base-1,n) + 7^(n-1) for base >= 3n-2; a(base,n) = a(base-1,n) + 7^(n-1)-2 when base = 3n-3.
From Johannes W. Meijer, Aug 01 2010: (Start)
The a(n) represent the number of n-move routes of a fairy chess piece starting in a given side square (m = 2, 4, 6 or 8) on a 3 X 3 chessboard. This fairy chess piece behaves like a king on the eight side and corner squares but on the central square the king goes crazy and turns into a red king, see A179596.
For the side squares the 512 red kings lead to 47 different red king sequences, see the cross-references for some examples.
The sequence above corresponds to four A[5] vectors with the decimal [binary] values 367 [1,0,1,1,0,1,1,1,1], 463 [1,1,1,0,0,1,1,1,1], 487 [1,1,1,1,0,0,1,1,1] and 493 [1,1,1,1,0,1,1,0,1]. These vectors lead for the corner squares to A179596 and for the central square to A179597.
This sequence belongs to a family of sequences with g.f. (1+x)/(1-4*x-k*x^2). Red king sequences that are members of this family are A003947 (k=0), A015448 (k=1), A123347 (k=2), A126473 (k=3; this sequence) and A086347 (k=4). Other members of this family are A000351 (k=5), A001834 (k=-1), A111567 (k=-2), A048473 (k=-3) and A053220 (k=-4)
Inverse binomial transform of A154244. (End)
Equals the INVERT transform of A055099: (1, 4, 14, 50, 178, ...). - Gary W. Adamson, Aug 14 2010
Number of one-sided n-step walks taking steps from {E, W, N, NE, NW}. - Shanzhen Gao, May 10 2011
For n>=1, a(n) equals the numbers of words of length n-1 on alphabet {0,1,2,3,4} containing no subwords 00 and 11. - Milan Janjic, Jan 31 2015

Crossrefs

Cf. 5 symbol differing by two or less A126392, one or less A057960.
Cf. Red king sequences side squares [numerical value A[5]]: A086347 [495], A179598 [239], A126473 [367], A123347 [335], A179602 [95], A154964 [31], A015448 [327], A152187 [27], A003947 [325], A108981 [11], A007483 [2]. - Johannes W. Meijer, Aug 01 2010
Cf. A055099.

Programs

  • Maple
    with(LinearAlgebra): nmax:=19; m:=2; A[5]:= [1,0,1,1,0,1,1,1,1]: A:=Matrix([[0,1,0,1,1,0,0,0,0],[1,0,1,1,1,1,0,0,0],[0,1,0,0,1,1,0,0,0],[1,1,0,0,1,0,1,1,0],A[5],[0,1,1,0,1,0,0,1,1],[0,0,0,1,1,0,0,1,0],[0,0,0,1,1,1,1,0,1],[0,0,0,0,1,1,0,1,0]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax); # Johannes W. Meijer, Aug 01 2010
    # second Maple program:
    a:= n-> (M-> M[1,2]+M[2,2])(<<0|1>, <3|4>>^n):
    seq(a(n), n=0..24);  # Alois P. Heinz, Jun 28 2021
  • Mathematica
    LinearRecurrence[{4, 3}, {1, 5}, 24] (* Jean-François Alcover, Dec 10 2024 *)
  • PARI
    a(n)=([0,1; 3,4]^n*[1;5])[1,1] \\ Charles R Greathouse IV, May 10 2016

Formula

From Johannes W. Meijer, Aug 01 2010: (Start)
G.f.: (1+x)/(1-4*x-3*x^2).
a(n) = 4*a(n-1) + 3*a(n-2) with a(0) = 1 and a(1) = 5.
a(n) = ((1+3/sqrt(7))/2)*(A)^(-n) + ((1-3/sqrt(7))/2)*(B)^(-n) with A = (-2 + sqrt(7))/3 and B = (-2-sqrt(7))/3.
Lim_{k->oo} a(n+k)/a(k) = (-1)^(n+1)*A000244(n)/(A015530(n)*sqrt(7)-A108851(n))
(End)
a(n) = A015330(n)+A015330(n+1). - R. J. Mathar, May 09 2023

Extensions

Edited by Johannes W. Meijer, Aug 10 2010

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

A151821 Powers of 2, omitting 2 itself.

Original entry on oeis.org

1, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592
Offset: 1

Views

Author

N. J. A. Sloane, Jul 08 2009

Keywords

Comments

Different from A046055.
An elephant sequence, see A175655. For the central square just one A[5] vector, with decimal value 170, leads to this sequence. For the corner squares this vector leads to the companion sequence A095121. - Johannes W. Meijer, Aug 15 2010
This is a subsequence of A055744, numbers n such that n and phi(n) have same prime factors. - Michel Marcus, Mar 20 2015
INVERTi transform of A007483: (1, 5, 17, 61, 217, 773, ...). - Gary W. Adamson, Aug 06 2016
Nonprimes that are also powers of 2. Intersection of A000079 and A018252. - Omar E. Pol, Jan 27 2017
Also the chromatic number of the n-Keller graph. - Eric W. Weisstein, Nov 17 2017

Crossrefs

Partial sums are given by 2*A000225(n)-1, which is not the same as A000918.

Programs

Formula

G.f.: x*(1+2*x)/(1-2*x). - Philippe Deléham, Sep 17 2009
a(1) = 1 and a(n) = 3 + Sum_{k=1..n-1} a(k) for n>=2. - Joerg Arndt, Aug 15 2012
E.g.f.: exp(2*x) - x - 1. - Stefano Spezia, Jan 31 2023

A122542 Triangle T(n,k), 0 <= k <= n, read by rows, given by [0, 2, -1, 0, 0, 0, 0, 0, ...] DELTA [1, 0, 0, 0, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 2, 4, 1, 0, 2, 8, 6, 1, 0, 2, 12, 18, 8, 1, 0, 2, 16, 38, 32, 10, 1, 0, 2, 20, 66, 88, 50, 12, 1, 0, 2, 24, 102, 192, 170, 72, 14, 1, 0, 2, 28, 146, 360, 450, 292, 98, 16, 1, 0, 2, 32, 198, 608, 1002, 912, 462, 128, 18, 1
Offset: 0

Views

Author

Philippe Deléham, Sep 19 2006, May 28 2007

Keywords

Comments

Riordan array (1, x*(1+x)/(1-x)). Rising and falling diagonals are the tribonacci numbers A000213, A001590.

Examples

			Triangle begins:
  1;
  0, 1;
  0, 2,  1;
  0, 2,  4,   1;
  0, 2,  8,   6,   1;
  0, 2, 12,  18,   8,    1;
  0, 2, 16,  38,  32,   10,   1;
  0, 2, 20,  66,  88,   50,  12,   1;
  0, 2, 24, 102, 192,  170,  72,  14,   1;
  0, 2, 28, 146, 360,  450, 292,  98,  16,  1;
  0, 2, 32, 198, 608, 1002, 912, 462, 128, 18, 1;
		

Crossrefs

Other versions: A035607, A113413, A119800, A266213.
Sums include: A000007, A001333 (row), A001590 (diagonal), A007483, A057077 (signed row), A078016 (signed diagonal), A086901, A091928, A104934, A122558, A122690.

Programs

  • Haskell
    a122542 n k = a122542_tabl !! n !! k
    a122542_row n = a122542_tabl !! n
    a122542_tabl = map fst $ iterate
       (\(us, vs) -> (vs, zipWith (+) ([0] ++ us ++ [0]) $
                          zipWith (+) ([0] ++ vs) (vs ++ [0]))) ([1], [0, 1])
    -- Reinhard Zumkeller, Jul 20 2013, Apr 17 2013
    
  • Magma
    function T(n, k) // T = A122542
      if k eq 0 then return 0^n;
      elif k eq n then return 1;
      else return T(n-1,k) + T(n-1,k-1) + T(n-2,k-1);
      end if;
    end function;
    [T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Oct 27 2024
  • Mathematica
    CoefficientList[#, y]& /@ CoefficientList[(1-x)/(1 - (1+y)x - y x^2) + O[x]^11, x] // Flatten (* Jean-François Alcover, Sep 09 2018 *)
    (* Second program *)
    T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==0, 0, T[n-1,k-1] +T[n-1,k] +T[n-2,k- 1] ]]; (* T = A122542 *)
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Oct 27 2024 *)
  • Sage
    def A122542_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return 1
            if k==0: return 0
            return prec(n-1,k-1)+2*sum(prec(n-i,k-1) for i in (2..n-k+1))
        return [prec(n, k) for k in (0..n)]
    for n in (0..10): print(A122542_row(n)) # Peter Luschny, Mar 16 2016
    

Formula

Sum_{k=0..n} x^k*T(n,k) = A000007(n), A001333(n), A104934(n), A122558(n), A122690(n), A091928(n) for x = 0, 1, 2, 3, 4, 5. - Philippe Deléham, Jan 25 2012
Sum_{k=0..n} 3^(n-k)*T(n,k) = A086901(n).
Sum_{k=0..n} 2^(n-k)*T(n,k) = A007483(n-1), n >= 1. - Philippe Deléham, Oct 08 2006
T(2*n, n) = A123164(n).
T(n, k) = T(n-1,k) + T(n-1,k-1) + T(n-2,k-1), n > 1. - Philippe Deléham, Jan 25 2012
G.f.: (1-x)/(1-(1+y)*x-y*x^2). - Philippe Deléham, Mar 02 2012
From G. C. Greubel, Oct 27 2024: (Start)
Sum_{k=0..n} (-1)^k*T(n, k) = A057077(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A001590(n+1).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = A078016(n). (End)

A072272 Number of active cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 614", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 5, 5, 17, 5, 25, 17, 61, 5, 25, 25, 85, 17, 85, 61, 217, 5, 25, 25, 85, 25, 125, 85, 305, 17, 85, 85, 289, 61, 305, 217, 773, 5, 25, 25, 85, 25, 125, 85, 305, 25, 125, 125, 425, 85, 425, 305, 1085, 17, 85, 85, 289, 85, 425, 289, 1037, 61, 305, 305, 1037, 217, 1085, 773, 2753
Offset: 0

Views

Author

Miklos Kristof, Jul 09 2002

Keywords

Comments

Consider only the four nearest (N,S,E,W) neighbors of a cell together with the cell itself. In the next state, the state of a cell will change if an odd number of these five cells is ON. [Comment corrected by N. J. A. Sloane, Aug 25 2014]
Equivalently, a(n) is the number of ON cells at generation n of 2-D CA defined as follows: the neighborhood of a cell consists of the cell itself and the four adjacent E, W, N, S cells. A cell is ON iff an odd number of these cells was ON at the previous generation. - N. J. A. Sloane, Aug 20 2014. This is the odd-rule cellular automaton defined by OddRule 057 (see Ekhad-Sloane-Zeilberger "Odd-Rule Cellular Automata on the Square Grid" link).
This is the Run Length Transform of A007483. - N. J. A. Sloane, Aug 25 2014
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g., 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product). - N. J. A. Sloane, Aug 25 2014
The partial sums are in A253908, in which the structure looks like an irregular stepped pyramid. - Omar E. Pol, Jan 29 2015
Rules 518, 550 and 582 also generate this sequence. - Robert Price, Mar 01 2016

Examples

			To illustrate a(0) = 1, a(1) = 5, a(2) = 5, a(3) = 17:
  ......................0
  .............0.......000
  .......0............0...0
  .0....000..0.0.0...00.0.00
  .......0............0...0
  .............0.......000
  ......................0
From _Omar E. Pol_, Jan 29 2015: (Start)
May be arranged into blocks of sizes A011782:
  1;
  5;
  5,17;
  5,25,17,61;
  5,25,25,85,17,85,61,217;
  5,25,25,85,25,125,85,305,17,85,85,289,61,305,217,773;
  5,25,25,85,25,125,85,305,25,125,125,425,85,425,305,1085,17,85,85,289,85,425,289,1037,
    61,305,305,1037,217,1085,773,2753;
So the right border gives A007483.
(End)
From _Omar E. Pol_, Mar 19 2015: (Start)
Also, the sequence can be written as an irregular tetrahedron T(s,r,k) as shown below:
     1;
  .....
     5;
  .....
     5;
    17;
  ...........
     5,   25;
    17;
    61;
  ......................
     5,   25,  25,   85;
    17,   85;
    61;
   217;
  ...........................................
     5,   25,  25,   85,  25, 125,  85,  305;
    17,   85,  85,  289;
    61,  305;
   217;
   773;
  ..................................................................................
     5,   25,  25,   85,  25, 125,  85,  305, 25, 125, 125, 425, 85, 425, 305, 1085;
    17,   85,  85,  289,  85, 425, 289, 1037;
    61,  305, 305, 1037;
   217, 1085;
   773;
  2753;
  ...
Apart from the initial 1, we have that T(s,r,k) = T(s+1,r,k).
It appears that the configuration of ON cells of T(s,r,k) is of the same kind as the configuration of ON cells of T(s+1,r,k).
(End)
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; pp. 170-179.

Crossrefs

Cf. A048883, A170878 (first differences), A253908 (partial sums).
See A253090 for 9-celled neighborhood version.

Programs

  • Maple
    C:=f->subs({x=1,y=1},f);
    # Find number of ON cells in CA for generations 0 thru M defined by rule
    # that cell is ON iff number of ON cells in nbd at time n-1 was odd
    # where nbd is defined by a polynomial or Laurent series f(x,y).
    OddCA:=proc(f,M) global C; local n,a,i,f2,g,p;
    f2:=simplify(expand(f)) mod 2;
    a:=[]; p:=1; g:=f2;
    for n from 0 to M do a:=[op(a),C(p)]; p:=expand(p*f2) mod 2; od:
    lprint([seq(a[i],i=1..nops(a))]);
    end;
    f:=1+1/x+x+1/y+y;
    OddCA(f,100);
    # N. J. A. Sloane, Aug 20 2014
  • Mathematica
    Map[Function[Apply[Plus,Flatten[ #1]]], CellularAutomaton[{ 614, {2,{{0,2,0},{2,1,2},{0,2,0}}},{1,1}},{{{1}},0},100]] (* N. J. A. Sloane, Apr 17 2010 *)
    ArrayPlot /@ CellularAutomaton[{ 614, {2,{{0,2,0},{2,1,2},{0,2,0}}},{1,1}},{{{1}},0},6] (* N. J. A. Sloane, Aug 25 2014 *)

Formula

a(0)=1; thereafter a(2t)=a(t), a(4t+1)=5*a(t), a(4t+3)=3*a(2t+1)+2*a(t). - N. J. A. Sloane, Jan 26 2015

Extensions

Extended and edited by John W. Layman, Jul 17 2002
Minor edits by N. J. A. Sloane, Jan 07 2010
More terms from N. J. A. Sloane, Apr 17 2010

A179597 Eight white kings and one red king on a 3 X 3 chessboard. G.f.: (1 + 5*x + 2*x^2)/(1 - 2*x - 11*x^2 - 6*x^3).

Original entry on oeis.org

1, 7, 27, 137, 613, 2895, 13355, 62233, 288741, 1342175, 6233899, 28964169, 134554277, 625117807, 2904117675, 13491856889, 62679715045, 291194561919, 1352817130667, 6284852732713, 29197861274277, 135646005392399
Offset: 0

Views

Author

Johannes W. Meijer, Jul 28 2010, Aug 10 2010

Keywords

Comments

The a(n) represent the number of n-move routes of a fairy chess piece starting in the central square (m = 5) on a 3 X 3 chessboard. This fairy chess piece behaves like a king on the eight side and corner squares but on the central square the king goes crazy and turns into a red king, see A179596.
For the central square the 512 red kings lead to 47 different red king sequences, see the cross-references for some examples.
The sequence above corresponds to four A[5] vectors with decimal [binary] values 367 [1,0,1,1,0,1,1,1,1], 463 [1,1,1,0,0,1,1,1,1], 487 [1,1,1,1,0,0,1,1,1] and 493 [1,1,1,1,0,1,1,0,1]. These vectors lead for the corner squares to A179596 and for the side squares to A126473.
This sequence belongs to a family of sequences with g.f. (1 + (k+2)*x + (2*k-4)*x^2)/(1 - 2*x - (k+8)*x^2 - (2*k)*x^3). Red king sequences that are members of this family are A179607 (k=0), A179605 (k=1), A179601 (k=2), A179597 (k=3; this sequence) and A086348 (k=4). Another member of this family is A179609 (k = -4).

Crossrefs

Red king sequences central square [numerical value A[5]]: A086348 [495], A179599 [239], A179597 [367], A179601 [335], A179603 [95], A154964 [31], A179605 [327], A179606 [27], A179611 [15], A179607 [325], A015521 [11], A007483 [2], A000012 [16], A000007 [0].

Programs

  • Maple
    with(LinearAlgebra): nmax:=21; m:=5; A[1]:= [0,1,0,1,1,0,0,0,0]: A[2]:= [1,0,1,1,1,1,0,0,0]: A[3]:= [0,1,0,0,1,1,0,0,0]: A[4]:=[1,1,0,0,1,0,1,1,0]: A[5]:= [1,0,1,1,0,1,1,1,1]: A[6]:= [0,1,1,0,1,0,0,1,1]: A[7]:= [0,0,0,1,1,0,0,1,0]: A[8]:= [0,0,0,1,1,1,1,0,1]: A[9]:= [0,0,0,0,1,1,0,1,0]: A:=Matrix([A[1],A[2],A[3],A[4],A[5], A[6],A[7],A[8],A[9]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    LinearRecurrence[{2,11,6},{1,7,27},30] (* Harvey P. Dale, Mar 01 2015 *)

Formula

G.f.: (1 + 5*x + 2*x^2)/(1 - 2*x - 11*x^2 - 6*x^3).
a(n) = 2*a(n-1) + 11*a(n-2) + 6*a(n-3) with a(0) = 1, a(1) = 7 and a(2) = 27.
a(n) = 8*(-1/2)^(-n+1)/9 + ((7+11*sqrt(7))*A^(-n-1) + (7-11*sqrt(7))*B^(-n-1))/126 with A = (-2+sqrt(7))/3 and B = (-2-sqrt(7))/3.
Lim_{k->infinity} a(n+k)/a(k) = (-1)^(n+1)*(A000244(n)/(A015530(n)*sqrt(7) - A108851(n))).

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

A179606 Eight white kings and one red king on a 3 X 3 chessboard. G.f.: (1 + x)/(1 - 3*x - 5*x^2).

Original entry on oeis.org

1, 4, 17, 71, 298, 1249, 5237, 21956, 92053, 385939, 1618082, 6783941, 28442233, 119246404, 499950377, 2096083151, 8788001338, 36844419769, 154473265997, 647641896836, 2715292020493, 11384085545659, 47728716739442
Offset: 0

Views

Author

Johannes W. Meijer, Jul 28 2010

Keywords

Comments

a(n) represents the number of n-move routes of a fairy chess piece starting in the central square (m = 5) on a 3 X 3 chessboard. This fairy chess piece behaves like a king on the eight side and corner squares but on the central square the king goes crazy and turns into a red king, see A179596.
The sequence above corresponds to 24 red king vectors, i.e., A[5] vectors, with decimal values 27, 30, 51, 54, 57, 60, 90, 114, 120, 147, 150, 153, 156, 177, 180, 210, 216, 240, 282, 306, 312, 402, 408 and 432. These vectors lead for the corner squares to A015523 and for the side squares to A152187.
This sequence belongs to a family of sequences with g.f. (1 + (k-4)*x)/(1 - 3*x - k*x^2). Red king sequences that are members of this family are A007483 (k= 2), A015521 (k=4), A179606 (k=5; this sequence), A154964 (k=6), A179603 (k=7) and A179599 (k=8). We observe that there is no red king sequence for k=3. Other members of this family are A006190 (k=1), A133494 (k=0) and A168616 (k=-2).
Inverse binomial transform of A052918.
The sequence b(n+1) = 6*a(n), n >= 0 with b(0)=1, is a berserker sequence, see A180147. The b(n) sequence corresponds to 16 A[5] vectors with decimal values between 111 and 492. These vectors lead for the corner squares to sequence c(n+1)=4*A179606(n), n >= 0 with c(0)=1, and for the side squares to A180140. - Johannes W. Meijer, Aug 14 2010
Equals the INVERT transform of A063782: (1, 3, 10, 32, 104, ...). Example: a(3) = 71 = (1, 1, 4, 7) dot (32, 10, 3, 1) = (32 + 10 + 12 + 17). - Gary W. Adamson, Aug 14 2010

Crossrefs

Cf. A179597 (central square).

Programs

  • Maple
    with(LinearAlgebra): nmax:=22; m:=5; A[1]:= [0,1,0,1,1,0,0,0,0]: A[2]:= [1,0,1,1,1,1,0,0,0]: A[3]:= [0,1,0,0,1,1,0,0,0]: A[4]:= [1,1,0,0,1,0,1,1,0]: A[5]:= [0,0,0,1,1,1,0,0,1]: A[6]:= [0,1,1,0,1,0,0,1,1]: A[7]:= [0,0,0,1,1,0,0,1,0]: A[8]:= [0,0,0,1,1,1,1,0,1]: A[9]:= [0,0,0,0,1,1,0,1,0]: A:=Matrix([A[1],A[2],A[3],A[4],A[5],A[6],A[7],A[8],A[9]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    CoefficientList[Series[(1+x)/(1-3*x-5*x^2), {x, 0, 22}],x] (* or *) LinearRecurrence[{3,5,0},{1,4},23] (* Indranil Ghosh, Mar 05 2017 *)
  • PARI
    print(Vec((1 + x)/(1- 3*x - 5*x^2) + O(x^23))); \\ Indranil Ghosh, Mar 05 2017

Formula

G.f.: (1+x)/(1 - 3*x - 5*x^2).
a(n) = A015523(n) + A015523(n+1).
a(n) = 3*a(n-1) + 5*a(n-2) with a(0) = 1 and a(1) = 4.
a(n) = ((29 + 7*sqrt(29))*A^(-n-1) + (29-7*sqrt(29))*B^(-n-1))/290 with A = (-3+sqrt(29))/10 and B = (-3-sqrt(29))/10
Limit_{k->oo} a(n+k)/a(k) = (-1)^(n+1)*A000351(n)*A130196(n)/(A015523(n)*sqrt(29) - A072263(n)) for n >= 1.

A152187 a(n) = 3*a(n-1) + 5*a(n-2), with a(0)=1, a(1)=5.

Original entry on oeis.org

1, 5, 20, 85, 355, 1490, 6245, 26185, 109780, 460265, 1929695, 8090410, 33919705, 142211165, 596232020, 2499751885, 10480415755, 43940006690, 184222098845, 772366329985, 3238209484180, 13576460102465, 56920427728295
Offset: 0

Views

Author

Philippe Deléham, Nov 28 2008

Keywords

Comments

Unsigned version of A152185.
From Johannes W. Meijer, Aug 01 2010: (Start)
The a(n) represent the number of n-move routes of a fairy chess piece starting in a given side square (m = 2, 4, 6 and 8) on a 3 X 3 chessboard. This fairy chess piece behaves like a king on the eight side and corner squares but on the central square the king goes crazy and turns into a red king, see A179596.
The sequence above corresponds to 24 red king vectors, i.e., A[5] vectors, with decimal values 27, 30, 51, 54, 57, 60, 90, 114, 120, 147, 150, 153, 156, 177, 180, 210, 216, 240, 282, 306, 312, 402, 408 and 432. These vectors lead for the corner squares to A015523 and for the central square to A179606.
This sequence belongs to a family of sequences with g.f. (1+2*x)/(1 - 3*x - k*x^2). Red king sequences that are members of this family are A007483 (k=2), A108981 (k=4), A152187 (k=5; this sequence), A154964 (k=6), A179602 (k=7) and A179598 (k=8). We observe that there is no red king sequence for k=3. Other members of this family are A036563 (k=-2), A054486 (k=-1), A084244 (k=0), A108300 (k=1) and A000351 (k=10).
Inverse binomial transform of A015449 (without the first leading 1).
(End)

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{3,5},{1,5},40] (* Harvey P. Dale, May 03 2013 *)

Formula

G.f.: (1+2*x)/(1 - 3*x - 5*x^2).
Lim_{k->infinity} a(n+k)/a(k) = (A072263(n) + A015523(n)*sqrt(29))/2. - Johannes W. Meijer, Aug 01 2010
G.f.: G(0)*(1+2*x)/(2-3*x), where G(k) = 1 + 1/(1 - x*(29*k-9)/(x*(29*k+20) - 6/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 17 2013

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
Showing 1-10 of 19 results. Next