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

A078008 Expansion of (1 - x)/((1 + x)*(1 - 2*x)).

Original entry on oeis.org

1, 0, 2, 2, 6, 10, 22, 42, 86, 170, 342, 682, 1366, 2730, 5462, 10922, 21846, 43690, 87382, 174762, 349526, 699050, 1398102, 2796202, 5592406, 11184810, 22369622, 44739242, 89478486, 178956970, 357913942, 715827882, 1431655766, 2863311530, 5726623062
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Conjecture: a(n) = the number of fractions in the infinite Farey row of 2^n terms with even denominators. Compare the Salamin & Gosper item in the Beeler et al. link. - Gary W. Adamson, Oct 27 2003
Counts closed walks starting and ending at the same vertex of a triangle. 3*a(n) = P(C_n, 3) chromatic polynomial for 3 colors on cyclic graph C_n. A078008(n) + 2*A001045(n) = 2^n provides decomposition of Pascal's triangle. - Paul Barry, Nov 17 2003
Permutations with one fixed point avoiding 123 and 132.
General form: iterate k -> 2^n - k. See also A001045. - Vladimir Joseph Stephan Orlovsky, Dec 11 2008
The inverse g.f. generates sequence 1, 0, -2, -2, -2, -2, ...
a(n) gives the number of oriented (i.e., unreduced for symmetry) meanders on an (n+2) X 3 rectangular grid; see A201145. - Jon Wild, Nov 22 2011
Pisano period lengths: 1, 1, 6, 1, 4, 6, 6, 2, 18, 4, 10, 6, 12, 6, 12, 2, 8, 18, 18, 4, ... - R. J. Mathar, Aug 10 2012
a(n) is the number of length n binary words that end in an odd length run of 0's if we do not include the first letter of the word in our run length count. a(4) =6 because we have 0000, 0010, 0110, 1000, 1010, 1110. - Geoffrey Critzer, Dec 16 2013
a(n) is the top left entry of the n-th power of any of the six 3 X 3 matrices [0, 1, 1; 1, 1, 1; 1, 0, 0], [0, 1, 1; 1, 1, 0; 1, 1, 0], [0, 1, 1; 1, 0, 1; 1, 1, 0], [0, 1, 1; 1, 1, 0; 1, 0, 1], [0, 1, 1; 1, 0, 1; 1, 0, 1] or [0, 1, 1; 1, 0, 0; 1, 1, 1]. - R. J. Mathar, Feb 04 2014
a(n) is the number of compositions of n into parts of two kinds without part 1. - Gregory L. Simay, Jun 04 2018
a(n) is the number of words of length n over a binary alphabet whose position in the lexicographic order is a multiple of three. a(3) = 2: aba, bab. - Alois P. Heinz, Apr 13 2022
a(n) is the number of words of length n over a ternary alphabet starting with a fixed letter (say, 'a') and ending in a different letter, such that no two adjacent letters are the same. a(4) = 6: abab, abac, abcb, acab, acac, acbc. - Ignat Soroko, Jul 19 2023

Examples

			G.f. = 1 + 2*x^2 + 2*x^3 + 6*x^4 + 10*x^5 + 22*x^6 + ... - _Michael Somos_, Mar 18 2022
		

References

  • Kenneth Edwards and Michael A. Allen, A new combinatorial interpretation of the Fibonacci numbers squared, Part II, Fib. Q., 58:2 (2020), 169-177.
  • I. P. Goulden and D. M. Jackson, Combinatorial Enumeration, John Wiley and Sons, N.Y., 1983, ex. 1.1.10a.

Crossrefs

First differences of A001045.
See A151575 for a signed version.
Bisections: A047849, A020988.

Programs

Formula

Euler expands(1-x)/(1 - x - 2*x^2) into an infinite series and finds that the coefficient of the n-th term is (2^n + (-1)^n 2)/3. Section 226 shows that Euler could have easily found the recursion relation: a(n) = a(n-1) + 2a(n-2) with a(0) = 1 and a(1) = 0. - V. Frederick Rickey (fred-rickey(AT)usma.edu), Feb 10 2006. [Typos corrected by Jaume Oliver Lafont, Jun 01 2009]
a(n) = Sum_{k=0..floor(n/3)} binomial(n, f(n)+3*k) where f(n) = (0, 2, 1, 0, 2, 1, ...) = A080424(n). - Paul Barry, Feb 20 2003
E.g.f. (exp(2*x) + 2*exp(-x))/3. - Paul Barry, Apr 20 2003
a(n) = A001045(n) + (-1)^n = A000079(n) - 2*A001045(n). - Paul Barry, Feb 20 2003
a(n) = (2^n + 2*(-1)^n)/3. - Mario Catalani (mario.catalani(AT)unito.it), Aug 29 2003
a(n) = T(n, i/(2*sqrt(2)))*(-i*sqrt(2))^n - U(n-1, i/(2*sqrt(2)))*(-i*sqrt(2))^(n-1)/2. - Paul Barry, Nov 17 2003
From Paul Barry, Jul 30 2004: (Start)
a(n) = 2*a(n-1) + 2*(-1)^n for n > 0, with a(0)=1.
a(n) = Sum_{k=0..n} (-1)^k*(2^(n-k-1) + 0^(n-k)/2). (End)
a(n) = A014113(n-1) for n > 0; a(n) = A052953(n-1) - 2*(n mod 2) = sum of n-th row of the triangle in A108561. - Reinhard Zumkeller, Jun 10 2005
A137208(n+1) - 2*A137208(n) = a(n) signed. - Paul Curtz, Aug 03 2008
a(n) = A001045(n+1) - A001045(n) - Paul Curtz, Feb 09 2009
If p[1] =0, and p[i]=2, (i>1), and if A is 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)=det A. - Milan Janjic, Apr 29 2010
a(n) = 2*(a(n-2) + a(n-3) + a(n-4) ... + a(0)), that is, twice the sum of all the previous terms except the last; with a(0) = 1 and a(1) = 0. - Benoit Jubin, Nov 21 2011
a(n+1) = 2*A001045(n). - Benoit Jubin, Nov 22 2011
G.f.: 1 - x + x*Q(0), where Q(k) = 1 + 2*x^2 + (2*k+3)*x - x*(2*k+1 + 2*x)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 05 2013
G.f.: 1+ x^2*Q(0), where Q(k) = 1 + 1/(1 - x*(4*k+1+2*x)/(x*(4*k+3+2*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 01 2014
a(n) = 3*a(n-2) + 2*a(n-3). - David Neil McGrath, Sep 10 2014
a(n) = (-1)^n * A151575(n). - G. C. Greubel, Jun 28 2019
a(n)+a(n+1) = 2^n. - R. J. Mathar, Feb 24 2021
a(n) = -a(2-n) * (-2)^(n-1) = (3/2)*(a(n-1) + a(n-2)) - a(n-3) for all n in Z. - Michael Somos, Mar 18 2022

A163271 Numerators of fractions in a 'zero-transform' approximation of sqrt(2) by means of a(n) = (a(n-1) + c)/(a(n-1) + 1) with c=2 and a(1)=0.

Original entry on oeis.org

0, 2, 4, 10, 24, 58, 140, 338, 816, 1970, 4756, 11482, 27720, 66922, 161564, 390050, 941664, 2273378, 5488420, 13250218, 31988856, 77227930, 186444716, 450117362, 1086679440, 2623476242, 6333631924, 15290740090, 36915112104, 89120964298, 215157040700
Offset: 1

Views

Author

Mark Dols, Jul 24 2009

Keywords

Comments

Twice the Pell numbers; for denominators see A001333 (numerators of the approximation of sqrt(2) for a(1) = 1).
Row sums of the triangle A128966. - Reinhard Zumkeller, Jul 20 2013
Because a(n+1)/A001333(n) approximates sqrt(2) and a(n) = 2*A001333(n) - a(n+1), we get that a(n)/A001333(n) approximates 2 - sqrt(2). - Danny Rorabaugh, Mar 14 2015
Number of weak orderings R on {1,...,n} that are weakly single-peaked w.r.t. the total ordering 1 < ... < n and for which {1,...,n} has exactly one minimal and one maximal element for the weak ordering R. - J. Devillet, Sep 28 2017

Crossrefs

Cf. A000129 (Pell numbers), A001333 (denominators), A052542.
Cf. A293004.

Programs

  • GAP
    a := [0, 2];; for n in [3..10^2] do a[n] := 2*a[n-1] + a[n-2]; od; A163271:=a; # Muniru A Asiru, Oct 08 2017
  • Haskell
    a163271 = sum . a128966_row . (subtract 1)
    -- Reinhard Zumkeller, Jul 20 2013
    
  • Maple
    A163271:=gfun:-rectoproc({a(n) = 2 * a(n-1) + a(n-2), a(1) = 0, a(2) = 2}, a(n), remember):  map(A163271, [$1..100]);  # Muniru A Asiru, Oct 08 2017
  • Mathematica
    CoefficientList[Series[2*t^2/(1-2*t - t^2), {t,0,50}], t] (* or *) LinearRecurrence[{2,1},{0,2},50] (* G. C. Greubel, Dec 12 2016 *)
  • PARI
    concat([0], Vec(2*t^2/(1-2*t - t^2) + O(t^50))) \\ G. C. Greubel, Dec 12 2016
    

Formula

a(n) = A052542(n-1), n > 1.
G.f.: x + x^2/(2*G(0)-x) where G(k) = 1 - (k+1)/(1 - x/(x +(k+1)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Dec 07 2012
a(n) = 2*a(n-1) + a(n-2). - Jacob Antony, Jun 07 2013
a(n) = b(n) - b(n-1) = 2b(n-1) - a(n-1) where b(n) = A001333(n). - Danny Rorabaugh, Mar 14 2015
G.f.: 2*t^2/(1 - 2*t - t^2). - G. C. Greubel, Dec 12 2016
a(n) = 2*A000129(n-1) (see the first comment). - J. Devillet, Sep 28 2017

A216800 T(n,k)=Number of permutations of an nXk array with each element moving exactly one horizontally or vertically and without 2-loops.

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 6, 0, 6, 0, 0, 10, 8, 8, 10, 0, 0, 22, 0, 88, 0, 22, 0, 0, 42, 32, 292, 292, 32, 42, 0, 0, 86, 0, 1774, 0, 1774, 0, 86, 0, 0, 170, 128, 7676, 10140, 10140, 7676, 128, 170, 0, 0, 342, 0, 39844, 0, 207408, 0, 39844, 0, 342, 0, 0, 682, 512, 186996
Offset: 1

Views

Author

R. H. Hardin Sep 17 2012

Keywords

Comments

Table starts
.0....0....0........0.........0............0..............0.................0
.0....2....2........6........10...........22.............42................86
.0....2....0........8.........0...........32..............0...............128
.0....6....8.......88.......292.........1774...........7676.............39844
.0...10....0......292.........0........10140..............0............361200
.0...22...32.....1774.....10140.......207408........1879040..........27918806
.0...42....0.....7676.........0......1879040..............0.........489300384
.0...86..128....39844....361200.....27918806......489300384.......22902801416
.0..170....0...186996.........0....302667484..............0......539812977524
.0..342..512...927134..12911864...3991662992...129127695440....20296105418276
.0..682....0..4460016.........0..46492284664..............0...550843711073468
.0.1366.2048.21812696.461788640.585384941184.34175930646380.18708387030790218

Examples

			Some solutions for n=4 k=4
..1..5..3..7....1..5..3..7....4..0..1..2....1..5..3..7....4..0..1..2
..0..9..2..6....0..4..2..6....8..6..7..3....0..4..2..6....5..6..7..3
..4.13.11.15....9.13.11.15...12..5..9.10...12..8.14.10...12..8..9.10
..8.12.10.14....8.12.10.14...13.14.15.11...13..9.15.11...13.14.15.11
		

Crossrefs

Column 2 is A014113(n-1)
Diagonal is A216678

A135440 a(n) = a(n-1) + 2a(n-2).

Original entry on oeis.org

-1, 4, 2, 10, 14, 34, 62, 130, 254, 514, 1022, 2050, 4094, 8194, 16382, 32770, 65534, 131074, 262142, 524290, 1048574, 2097154, 4194302, 8388610, 16777214, 33554434, 67108862, 134217730, 268435454, 536870914, 1073741822, 2147483650, 4294967294, 8589934594, 17179869182, 34359738370
Offset: 0

Views

Author

Paul Curtz, Feb 18 2008

Keywords

Comments

First differences of A014551. - Reinhard Zumkeller, Jan 02 2013
It can be noticed that, once deprived of its first term, this is an "autosequence" of the second kind, whose companion of the first kind is A014113. - Jean-François Alcover, Aug 19 2022

Programs

  • Haskell
    a135440 n = a135440_list !! n
    a135440_list = zipWith (-) (tail a014551_list) a014551_list
    -- Reinhard Zumkeller, Jan 02 2013
  • Mathematica
    f[n_]:=2/(n+1);x=4;Table[x=f[x];Numerator[x],{n,0,5!}] (* Vladimir Joseph Stephan Orlovsky, Mar 12 2010 *)
    LinearRecurrence[{1,2}, {-1,4}, 25] (* or *) Table[2^n - 2*(-1)^n, {n,0,25}] (* G. C. Greubel, Oct 14 2016 *)

Formula

From R. J. Mathar, Feb 19 2008: (Start)
O.g.f.: -1/(2*x-1) - 2/(1+x).
a(n) = 2^n - 2*(-1)^n. (End)
a(n) = 2*A014551(n-1), n>0. - Paul Curtz, Jun 01 2011
E.g.f.: exp(2*x) - 2*exp(-x). - G. C. Greubel, Oct 14 2016

Extensions

More terms from R. J. Mathar, Feb 19 2008

A290732 Number of distinct values of X*(3*X-1)/2 mod n.

Original entry on oeis.org

1, 2, 3, 4, 3, 6, 4, 8, 9, 6, 6, 12, 7, 8, 9, 16, 9, 18, 10, 12, 12, 12, 12, 24, 11, 14, 27, 16, 15, 18, 16, 32, 18, 18, 12, 36, 19, 20, 21, 24, 21, 24, 22, 24, 27, 24, 24, 48, 22, 22, 27, 28, 27, 54, 18, 32, 30, 30, 30, 36
Offset: 1

Views

Author

N. J. A. Sloane, Aug 10 2017

Keywords

Examples

			The values taken by (3*X^2-X)/2 mod n for small n are:
   1, [0]
   2, [0, 1]
   3, [0, 1, 2]
   4, [0, 1, 2, 3]
   5, [0, 1, 2]
   6, [0, 1, 2, 3, 4, 5]
   7, [0, 1, 2, 5]
   8, [0, 1, 2, 3, 4, 5, 6, 7]
   9, [0, 1, 2, 3, 4, 5, 6, 7, 8]
  10, [0, 1, 2, 5, 6, 7]
  11, [0, 1, 2, 4, 5, 7]
  12, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  ...
		

Crossrefs

Cf. A000224 (analog for X^2), A014113, A290729, A290730, A290731, A317623.

Programs

  • Maple
    a:=[]; M:=80;
    for n from 1 to M do
    q1:={};
    for i from 0 to 2*n-1 do q1:={op(q1), i*(3*i-1)/2 mod n}; od;
    s1:=sort(convert(q1,list));
    a:=[op(a),nops(s1)];
    od:
    a;
  • Mathematica
    a[n_] := Table[PolynomialMod[X(3X-1)/2, n], {X, 0, 2*n-1}]// Union // Length;
    Array[a, 60] (* Jean-François Alcover, Sep 01 2018 *)
  • PARI
    a(n)={my(v=vector(n)); for(i=0, 2*n-1, v[i*(3*i-1)/2%n + 1]=1); vecsum(v)} \\ Andrew Howroyd, Oct 27 2018
    
  • PARI
    a(n)={my(f=factor(n)); prod(i=1, #f~, my([p,e]=f[i,]); if(p<=3, p^e, 1 + p^(e+1)\(2*p+2)))} \\ Andrew Howroyd, Nov 03 2018

Formula

a(3^n) = 3^n. - Hugo Pfoertner, Aug 25 2018
a(n) = A317623(n) * A040001(n). - Andrew Howroyd, Oct 27 2018
Multiplicative with a(2^e) = 2^e, a(3^e) = 3^e, a(p^e) = 1 + floor( p^(e+1)/(2*p+2) ) for prime p >= 5. - Andrew Howroyd, Nov 03 2018

Extensions

Even terms corrected by Andrew Howroyd, Nov 03 2018

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

Original entry on oeis.org

2, 2, 9, 16, 37, 72, 149, 296, 597, 1192, 2389, 4776, 9557, 19112, 38229, 76456, 152917, 305832, 611669, 1223336, 2446677, 4893352, 9786709, 19573416, 39146837, 78293672, 156587349, 313174696, 626349397, 1252698792, 2505397589, 5010795176, 10021590357
Offset: 0

Views

Author

Iain Fox, Oct 11 2017

Keywords

Comments

Ratio of successive terms approaches 2.

Examples

			a(0) = 2.
a(1) = 2.
a(2) = 2 + 2*2 + 3 = 9.
a(3) = 9 + 2*2 + 3 = 16.
a(4) = 16 + 9*2 + 3 = 37.
...
		

Programs

  • Magma
    [(2^(n+2)+2*(-1)^n)/3+2^n-(3-(-1)^n)/2: n in [0..40]]; // Vincenzo Librandi, Oct 20 2017
  • Mathematica
    Table[(2^(n + 2) + 2 (-1)^n) / 3 + 2^n - (3 - (-1)^n) / 2, {n, 0, 40}] (* Vincenzo Librandi, Oct 20 2017 *)
    LinearRecurrence[{2,1,-2},{2,2,9},50] (* Harvey P. Dale, Mar 06 2025 *)
  • PARI
    Vec((2/(1-x-2*x^2)) + (3*x^2/((1-x)*(1-x-2*x^2))) + O(x^50)) \\ Michel Marcus, Oct 12 2017
    
  • PARI
    first(n) = Vec((2 - 2*x + 3*x^2)/(1 - 2*x - x^2 + 2*x^3) + O(x^n)) \\ Iain Fox, Dec 18 2017
    

Formula

a(n) = (2^(n+2) + 2*(-1)^n)/3 + 2^n - (3-(-1)^n)/2.
a(n) = A014113(n+1) + A141023(n).
G.f.: (2 - 2*x + 3*x^2)/(1 - 2*x - x^2 + 2*x^3).
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), n > 2. - Iain Fox, Dec 18 2017

A321373 Array T(n,k) read by antidiagonals where the first row is (-1)^k*A140966(k) and each subsequent row is obtained by adding A001045(k) to the preceding one.

Original entry on oeis.org

2, 2, -1, 2, 0, 3, 2, 1, 4, 1, 2, 2, 5, 4, 7, 2, 3, 6, 7, 12, 9, 2, 4, 7, 10, 17, 20, 23, 2, 5, 8, 13, 22, 31, 44, 41, 2, 6, 9, 16, 27, 42, 65, 84, 87, 2, 7, 10, 19, 32, 53, 86, 127, 172, 169, 2, 8, 11, 22, 37, 64, 107, 170, 257, 340, 343
Offset: 0

Views

Author

Paul Curtz, Nov 08 2018

Keywords

Comments

Array:
2, -1, 3, 1, 7, 9, 23, 41, 87, ... = (-1)^n*A140966(n)
2, 0, 4, 4, 12, 20, 44, 84, 172, ... = abs(A084247(n+1))
2, 1, 5, 7, 17, 31, 65, 127, 257, ... = A014551(n)
2, 2, 6, 10, 22, 42, 86, 170, 342, ... = A078008(n+2) = A014113(n+1)
2, 3, 7, 13, 27, 53, 107, 213, 427, ... = A048573(n)
2, 4, 8, 16, 32, 64, 128, 256, 512, ... = A000079(n+1)
2, 5, 9, 19, 37, 75, 149, 299, 597, ... = A062092(n)
2, 6, 10, 22, 42, 86, 170, 342, 682, ... = A078008(n+3) = A014113(n+2).
T(n+1,k) = (-1)^k*A140966(k) + (n+1)*A001045(k).
Every row T(n+1,k) has the signature (1,2).
T(0,k) = 2, -2, 2, -2, ... = (-1)^n*2.
T(n+1,k) - T(0,k) = (n+1)*A001045(n).
5*A001045(n) is not in the OEIS.

Examples

			Triangle a(n):
  2;
  2, -1;
  2,  0,  3;
  2,  1,  4,  1;
  2,  2,  5,  4,  7;
  2,  3,  6,  7, 12,  9;
  2,  4,  7, 10, 17, 20, 23;
  etc.
Row sums: 2, 1, 5, 8, 20, 39, 83, 166, 338, 677, 1361, 2724, ... = b(n+2).
With b(0) = 2 and b(1) = 0, b(n) = b(n-1) + 2*b(n-2)  + n - 4, n > 1.
b(n) = A001045(n) - A097065(n-1).
b(n) = b(n-2) + A000225(n-2).
		

Crossrefs

Programs

  • Mathematica
    T[_, 0] = 2;
    T[0, k_] := (2^k + 5(-1)^k)/3;
    T[n_ /; n>0, k_ /; k>0] := T[n, k] = T[n-1, k] + (2^k + (-1)^(k+1))/3;
    T[, ] = 0;
    Table[T[n-k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 10 2018 *)

A067763 Square array read by antidiagonals of base n numbers written as 122...222 with k 2's (and a suitable interpretation for n=0, 1 or 2).

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 2, 5, 4, 1, 2, 7, 10, 5, 1, 2, 9, 22, 17, 6, 1, 2, 11, 46, 53, 26, 7, 1, 2, 13, 94, 161, 106, 37, 8, 1, 2, 15, 190, 485, 426, 187, 50, 9, 1, 2, 17, 382, 1457, 1706, 937, 302, 65, 10, 1, 2, 19, 766, 4373, 6826, 4687, 1814, 457, 82, 11, 1, 2, 21, 1534, 13121
Offset: 0

Views

Author

Henry Bottomley, Feb 06 2002

Keywords

Comments

Start with a node; step one is to connect that node to n+1 new nodes so that it is of degree n+1; further steps are to connect each existing node of degree 1 to n new nodes so that it is of degree n+1; T(n,k) is the total number of nodes after k steps.

Examples

			Rows start: 1,2,2,2,2,2,...; 1,3,5,7,9,11,...; 1,4,10,22,46,94,...; 1,5,17,53,161,485,... T(3,2) =122 base 3 =17.
		

Crossrefs

Rows include A040000, A005408, A033484, A048473, A020989, A057651, A061801 etc. For negative n (not shown) absolute values of rows would effectively include A000012, A014113, A046717.

Formula

T(n, k) =((n+1)*n^k-2)/(n-1) [with T(1, k)=2k+1] =n*T(n, k-1)+2 =(n+1)*T(n, k-1)-n*T(n, k-2) =T(n, k-1)+(1+1/n)*n^k =A055129(k, n)+A055129(k-1, n). Coefficient of x^k in expansion of (1+x)/((1-x)(1-nx)).
Showing 1-8 of 8 results.