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

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

A122117 a(n) = 3*a(n-1) + 4*a(n-2), with a(0)=1, a(1)=2.

Original entry on oeis.org

1, 2, 10, 38, 154, 614, 2458, 9830, 39322, 157286, 629146, 2516582, 10066330, 40265318, 161061274, 644245094, 2576980378, 10307921510, 41231686042, 164926744166, 659706976666, 2638827906662, 10555311626650, 42221246506598
Offset: 0

Views

Author

Philippe Deléham, Oct 19 2006

Keywords

Comments

Inverse binomial transform of A005053. Binomial transform of [1, 1, 7, 13, 55, ...] = A015441(n+1).
Convolved with [1, 2, 2, 2, ...] = powers of 4: [1, 4, 16, 64, ...]. - Gary W. Adamson, Jun 02 2009
a(n) is the number of compositions of n when there are 2 types of 1 and 6 types of other natural numbers. - Milan Janjic, Aug 13 2010

Crossrefs

Programs

  • GAP
    a:=[1,2];; for n in [3..30] do a[n]:=3*a[n-1]+4*a[n-2]; od; a; # G. C. Greubel, May 18 2019
    
  • Magma
    I:=[1, 2]; [n le 2 select I[n] else 3*Self(n-1)+4*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jul 06 2012
    
  • Mathematica
    CoefficientList[Series[(1-x)/(1-3*x-4*x^2),{x,0,30}],x] (* Vincenzo Librandi, Jul 06 2012 *)
  • PARI
    Vec((1-x)/(1-3*x-4*x^2)+O(x^30)) \\ Charles R Greathouse IV, Jan 11 2012
    
  • Python
    def A122117(n): return ((4<<(m:=n<<1))|2)//5-((1<Chai Wah Wu, Apr 22 2025
  • Sage
    from sage.combinat.sloane_functions import recur_gen2b; it = recur_gen2b(1,2,3,4, lambda n: 0); [next(it) for i in range(24)] # Zerinvary Lajos, Jul 03 2008
    
  • Sage
    ((1-x)/(1-3*x-4*x^2)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, May 18 2019
    

Formula

a(n) = 2*A108981(n-1) for n > 0, with a(0) = 1.
a(2*n) = 4*a(2*n-1) + 2, a(2*n+1) = 4*a(2*n) - 2.
a(n) = Sum_{k=0..n} 2^(n-k)*A055380(n,k).
G.f.: (1-x)/(1-3*x-4*x^2).
Lim_{n->infinity} a(n+1)/a(n) = 4.
a(n) = Sum_{k=0..n} A122016(n,k)*2^k. - Philippe Deléham, Nov 05 2008
a(n) = A100088(2*n). - Chai Wah Wu, Apr 22 2025

Extensions

Corrected by T. D. Noe, Nov 07 2006

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

A193729 Mirror of the triangle A193728.

Original entry on oeis.org

1, 1, 2, 3, 10, 8, 9, 42, 64, 32, 27, 162, 360, 352, 128, 81, 594, 1728, 2496, 1792, 512, 243, 2106, 7560, 14400, 15360, 8704, 2048, 729, 7290, 31104, 73440, 103680, 87552, 40960, 8192, 2187, 24786, 122472, 344736, 604800, 677376, 473088, 188416, 32768
Offset: 0

Views

Author

Clark Kimberling, Aug 04 2011

Keywords

Comments

T(n, k) is obtained by reversing the rows of the triangle A193728.
Triangle T(n,k), read by rows, given by [1,2,0,0,0,0,...] DELTA [2,2,0,0,0,0,...] where DELTA is the operator defined in A084938. - Philippe Deléham, Oct 05 2011

Examples

			First six rows:
   1;
   1,   2;
   3,  10,    8;
   9,  42,   64,   32;
  27, 162,  360,  352,  128;
  81, 594, 1728, 2496, 1792, 512;
		

Crossrefs

Programs

  • Magma
    function T(n, k) // T = A193729
      if k lt 0 or k gt n then return 0;
      elif n lt 2 then return k+1;
      else return 3*T(n-1, k) + 4*T(n-1, k-1);
      end if;
    end function;
    [T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 28 2023
    
  • Mathematica
    (* First program *)
    z = 8; a = 1; b = 2; c = 2; d = 1;
    p[n_, x_] := (a*x + b)^n ; q[n_, x_] := (c*x + d)^n
    t[n_, k_] := Coefficient[p[n, x], x^k]; t[n_, 0] := p[n, x] /. x -> 0;
    w[n_, x_] := Sum[t[n, k]*q[n + 1 - k, x], {k, 0, n}]; w[-1, x_] := 1
    g[n_] := CoefficientList[w[n, x], {x}]
    TableForm[Table[Reverse[g[n]], {n, -1, z}]]
    Flatten[Table[Reverse[g[n]], {n, -1, z}]]  (* A193728 *)
    TableForm[Table[g[n], {n, -1, z}]]
    Flatten[Table[g[n], {n, -1, z}]]   (* A193729 *)
    (* Second program *)
    T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[n<2, k+1, 3*T[n-1,k] + 4*T[n -1, k-1]]];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 28 2023 *)
  • SageMath
    def T(n, k): # T = A193729
        if (k<0 or k>n): return 0
        elif (n<2): return k+1
        else: return 3*T(n-1, k) + 4*T(n-1, k-1)
    flatten([[T(n, k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Nov 28 2023

Formula

Let w(n,k) be the triangle of A193728, then the triangle in this sequence is given by w(n,n-k).
T(n,k) = 4*T(n-1,k-1) + 3*T(n-1,k) with T(0,0)=T(1,0)=1 and T(1,1)=2. - Philippe Deléham, Oct 05 2011
G.f.: (1-2*x-2*x*y)/(1-3*x-4*x*y). - R. J. Mathar, Aug 11 2015
From G. C. Greubel, Nov 28 2023: (Start)
T(n, 0) = A133494(n).
T(n, 1) = 2*A081038(n-1).
T(n, n) = A081294(n).
Sum_{k=0..n} T(n, k) = (1/7)*(4*[n=0] + 3*A000420(n)).
Sum_{k=0..n} (-1)^k * T(n, k) = A033999(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = (1/2)*[n=0] + A108981(n-1).
Sum_{k=0..floor(n/2)} (-1)^k * T(n-k, k) = (1/2)*[n=0] + A247560(n-1).
(End)

A124793 Numbers in a perpendicular plane intersecting a 3D clockwise spiral produced by powers of 2.

Original entry on oeis.org

1, 5, 35, 157, 1123, 5021, 35939, 160669, 1150051, 5141405, 36801635, 164524957, 1177652323, 5264798621, 37684874339, 168473555869, 1205915978851, 5391153787805, 38589311323235, 172516921209757, 1234857962343523
Offset: 1

Views

Author

Keywords

Comments

The general formula for powers of k integer is a(n) = k^((1/4)*(10*n - 7 - (-1)^n)) + k^((1/4)*(10*n - 1 + (-1)^n)) - a(n-1), with a(0)=1 and where k is an integer value. If we replace k with "i" or "-i" where i=sqrt(-1), we get a periodic complex sequence (period 8).

Examples

			Write powers of 2 in a sort of 3D clockwise spiral. After the initial 1 (2^0) move right till 2^1=2 (practically only one step); then move down till 2^2=4 (3,4); then left till 2^3=8 (5,6,7,8). When writing number 5 we are in the same column of 1 so 5 is the second number of the sequence. Then move up till 2^4=16. Then move up perpendicularly to the plane till 2^5=32 and again right till 2^6=64. The number 35 is in the sequence because it lies in the same line as 1 and 5. The process continues down, left, up, perpendicular, right and so on.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local a,i,x,y; a:=1; print(a); for i from 1 by 1 to n do x:=1/4*(10*i-7-(-1)^i); y:=1/4*(10*i-1+(-1)^i); a:=2^x+2^y-a; print(a); od; end: P(100);
  • Mathematica
    LinearRecurrence[{-1, 32, 32}, {1, 5, 35}, 25] (* Paolo Xausa, Feb 23 2024 *)

Formula

a(n) = 2^((1/4)*(10*n - 7 - (-1)^n)) + 2^((1/4)*(10*n - 1 + (-1)^n)) - a(n-1), with a(0)=1.
From Colin Barker, Jul 07 2012: (Start)
a(n) = -a(n-1) + 32*a(n-2) + 32*a(n-3).
G.f.: x*(1+2*x)*(1+4*x)/((1+x)*(1-32*x^2)). (End)
a(2n) = 3/31 + 19*32^n/124, a(2n+1) = -3/31 + 136*32^n/124. [R. J. Mathar, Jul 10 2012]

A140724 Period 10: 1, 5, 9, 7, 7, 9, 5, 1, 3, 3 repeated.

Original entry on oeis.org

1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7, 9, 5, 1, 3, 3, 1, 5, 9, 7, 7
Offset: 0

Views

Author

Paul Curtz, Jul 12 2008

Keywords

Comments

The last digit of A108981(n).
Also the continued fraction of (290003+sqrt(240183699293))/652402.
Also the decimal expansion of 13073/81819.
The period contains each of the 5 odd digits twice.

Programs

Formula

a(n)+a(n+5) = 10 = A010692(n).
a(n) = a(n+10) .
a(10*k+9+i) = a(10*k+18-i) (palindromic).
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-2*a(n-4)+a(n-5). G.f.: -(1+3*x+x^2-3*x^3+3*x^4)/ ((x-1) * (x^4-x^3+x^2-x+1)).

Extensions

Edited by R. J. Mathar, Sep 07 2009
Showing 1-6 of 6 results.