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.

A356185 The difference between number of even and number of odd Grassmannian permutations of size n.

Original entry on oeis.org

1, 1, 0, 1, 0, 3, 2, 9, 8, 23, 22, 53, 52, 115, 114, 241, 240, 495, 494, 1005, 1004, 2027, 2026, 4073, 4072, 8167, 8166, 16357, 16356, 32739, 32738, 65505, 65504, 131039, 131038, 262109, 262108, 524251, 524250, 1048537, 1048536, 2097111, 2097110, 4194261, 4194260
Offset: 0

Views

Author

Per W. Alexandersson, Jul 28 2022

Keywords

Comments

A permutation is Grassmann if it has at most one descent. A closed-form formula was proved by J. B. Gil and J. A. Tomasko.

Examples

			For n=3, 123, 231, 312 are even Grassmann permutations, and 132, 213 are the odd ones. Hence a(3) = 1.
		

Crossrefs

Bisections give: A005803 (even part), A183155 (odd part).

Programs

  • Mathematica
    Table[2^Floor[1 + (n - 1)/2] - n, {n, 1, 80}]

Formula

a(n) = 2^(1+floor((n-1)/2))-n.
From Alois P. Heinz, Jul 28 2022: (Start)
G.f.: -(4*x^3-3*x^2-x+1)/((2*x^2-1)*(x-1)^2).
a(n) = A000325(n) - A233411(n) = A060546(n) - n = 2^ceiling(n/2) - n.
a(n) = A000325(n) - 2*A032085(n) = A000325(n) - 2*A122746(n-2) for n>=2. (End)

A242278 Number of non-palindromic n-tuples of 3 distinct elements.

Original entry on oeis.org

0, 6, 18, 72, 216, 702, 2106, 6480, 19440, 58806, 176418, 530712, 1592136, 4780782, 14342346, 43040160, 129120480, 387400806, 1162202418, 3486725352, 10460176056, 31380882462, 94142647386, 282429005040, 847287015120, 2541864234006, 7625592702018, 22876787671992
Offset: 1

Views

Author

Mikk Heidemaa, Aug 16 2014

Keywords

Examples

			For n=3, the a(3)=18 solutions (non-palindromic 3-tuples) are:
{0,0,1}, {0,0,2}, {0,1,1}, {0,1,2}, {0,2,1}, {0,2,2}, {1,0,0}, {1,0,2},
{1,1,0}, {1,1,2}, {1,2,0}, {1,2,2}, {2,0,0}, {2,0,1}, {2,1,0}, {2,1,1},
{2,2,0}, {2,2,1}.
		

Crossrefs

Programs

  • Maple
    A242278:=n->(1/2)* 3^(n/2) * ((sqrt(3)-1) * (-1)^n - sqrt(3)-1) + 3^n: seq(A242278(n), n=1..28); # Wesley Ivan Hurt, Aug 17 2014.
  • Mathematica
    Table[1/2 * 3^(n/2) * ((Sqrt(3)-1) * (-1)^n - Sqrt(3)-1) + 3^n, {n, 28}]
  • PARI
    a(n)=3^n-3^ceil(n/2) \\ Charles R Greathouse IV, Dec 10 2014

Formula

a(n) = 1/2 * 3^(n/2) * ((sqrt(3)-1)*(-1)^n - sqrt(3)-1) + 3^n.
a(n) = 3^n - 3^ceiling(n/2).
a(n) = A000244(n) - A056449(n).
G.f.: (6*x) / (1 - 3*x - 3*x^2 + 9*x^3).
a(n) = 6*A167993(n). [Bruno Berselli, Aug 19 2014]

A240437 Number of non-palindromic n-tuples of 5 distinct elements.

Original entry on oeis.org

0, 20, 100, 600, 3000, 15500, 77500, 390000, 1950000, 9762500, 48812500, 244125000, 1220625000, 6103437500, 30517187500, 152587500000, 762937500000, 3814695312500, 19073476562500, 95367421875000, 476837109375000, 2384185742187500, 11920928710937500, 59604644531250000, 298023222656250000
Offset: 1

Views

Author

Mikk Heidemaa, Aug 17 2014

Keywords

Examples

			For n=3 a(3)=100 solutions are:
{0,0,1}, {0,0,2}, {0,0,3}, {0,0,4}, {0,1,1}, {0,1,2}, {0,1,3}, {0,1,4},
{0,2,1}, {0,2,2}, {0,2,3}, {0,2,4}, {0,3,1}, {0,3,2}, {0,3,3}, {0,3,4},
{0,4,1}, {0,4,2}, {0,4,3}, {0,4,4}, {1,0,0}, {1,0,2}, {1,0,3}, {1,0,4},
{1,1,0}, {1,1,2}, {1,1,3}, {1,1,4}, {1,2,0}, {1,2,2}, {1,2,3}, {1,2,4},
{1,3,0}, {1,3,2}, {1,3,3}, {1,3,4}, {1,4,0}, {1,4,2}, {1,4,3}, {1,4,4},
{2,0,0}, {2,0,1}, {2,0,3}, {2,0,4}, {2,1,0}, {2,1,1}, {2,1,3}, {2,1,4},
{2,2,0}, {2,2,1}, {2,2,3}, {2,2,4}, {2,3,0}, {2,3,1}, {2,3,3}, {2,3,4},
{2,4,0}, {2,4,1}, {2,4,3}, {2,4,4}, {3,0,0}, {3,0,1}, {3,0,2}, {3,0,4},
{3,1,0}, {3,1,1}, {3,1,2}, {3,1,4}, {3,2,0}, {3,2,1}, {3,2,2}, {3,2,4},
{3,3,0}, {3,3,1}, {3,3,2}, {3,3,4}, {3,4,0}, {3,4,1}, {3,4,2}, {3,4,4},
{4,0,0}, {4,0,1}, {4,0,2}, {4,0,3}, {4,1,0}, {4,1,1}, {4,1,2}, {4,1,3},
{4,2,0}, {4,2,1}, {4,2,2}, {4,2,3}, {4,3,0}, {4,3,1}, {4,3,2}, {4,3,3},
{4,4,0}, {4,4,1}, {4,4,2}, {4,4,3}.
		

Crossrefs

Programs

  • Maple
    gf := (20*x^2) / (1 - 5*x - 5*x^2 + 25*x^3): ser := series(gf, x, 26):
    seq(coeff(ser,x,n), n=1..25); # Peter Luschny, May 13 2019
  • Mathematica
    Table[1/2 * 5^(n/2) * ((Sqrt[5]-1) * (-1)^n - Sqrt[5]-1) + 5^n, {n, 25}]
  • PARI
    concat([0], Vec( ( (20*x^2) / (1 - 5*x - 5*x^2 + 25*x^3) + O(x^30) ) ) ) \\ Joerg Arndt, Aug 18 2014

Formula

a(n) = 1/2 * 5^(n/2) * ((sqrt(5)-1) * (-1)^n - sqrt(5)-1) + 5^n.
a(n) = 5^n - 5^ceiling(n/2).
a(n) = A000351(n) - A056451(n).
G.f.: (20*x^2) / (1 - 5*x - 5*x^2 + 25*x^3). [corrected by Peter Luschny, May 13 2019]

A242026 Number of non-palindromic n-tuples of 4 distinct elements.

Original entry on oeis.org

0, 12, 48, 240, 960, 4032, 16128, 65280, 261120, 1047552, 4190208, 16773120, 67092480, 268419072, 1073676288, 4294901760, 17179607040, 68719214592, 274876858368, 1099510579200, 4398042316800, 17592181850112, 70368727400448, 281474959933440, 1125899839733760
Offset: 1

Views

Author

Mikk Heidemaa, Aug 12 2014

Keywords

Comments

Non-palindromic vs palindromic (DNA) sequences (e.g., {a,c,a,c} is a non-palindromic sequence but {a,c,c,a} is palindromic). Useful in bioinformatics.

Examples

			For n=2 the a(2)=12 solutions (non-palindromic 2-tuples over 4 distinct elements {a,c,g,t}) are: {a,c}, {a,g}, {a,t}, {c,a}, {c,g}, {c,f}, {g,a},{g,c}, {g,t}, {t,a}, {t,c}, {t,g}.
		

Crossrefs

Programs

  • Mathematica
    Table[2^(n-1) * (2^(n+1) + (-1)^n - 3), {n, 66}]
    LinearRecurrence[{4,4,-16},{0,12,48},30] (* Harvey P. Dale, May 24 2023 *)
  • PARI
    a(n) = ((-1)^n - 3)*2^(n-1) + 4^n; \\ Michel Marcus, Aug 12 2014
    
  • PARI
    concat(0, Vec(12*x^2 / ((2*x-1)*(2*x+1)*(4*x-1)) + O(x^100))) \\ Colin Barker, Aug 12 2014

Formula

a(n) = 2^(n-1) * (2^(n+1) + (-1)^n - 3).
a(n) = 4^n - 4^ceiling(n/2) = A000302(n) - A056450(n).
From Colin Barker, Aug 12 2014: (Start)
a(n) = 4*a(n-1) + 4*a(n-2) - 16*a(n-3).
G.f.: 12*x^2 / ((2*x-1)*(2*x+1)*(4*x-1)). (End)

Extensions

Typos in formula fixed by Colin Barker, Aug 12 2014

A285612 Binary representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 62", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 1, 10, 10, 110, 110, 1110, 1110, 11110, 11110, 111110, 111110, 1111110, 1111110, 11111110, 11111110, 111111110, 111111110, 1111111110, 1111111110, 11111111110, 11111111110, 111111111110, 111111111110, 1111111111110, 1111111111110, 11111111111110
Offset: 0

Views

Author

Robert Price, Apr 22 2017

Keywords

Comments

Initialized with a single black (ON) cell at stage zero.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Mathematica
    CAStep[rule_, a_] := Map[rule[[10 - #]] &, ListConvolve[{{0, 2, 0},{2, 1, 2}, {0, 2, 0}}, a, 2],{2}];
    code = 62; stages = 128;
    rule = IntegerDigits[code, 2, 10];
    g = 2 * stages + 1; (* Maximum size of grid *)
    a = PadLeft[{{1}}, {g, g}, 0,Floor[{g, g}/2]]; (* Initial ON cell on grid *)
    ca = a;
    ca = Table[ca = CAStep[rule, ca], {n, 1, stages + 1}];
    PrependTo[ca, a];
    (* Trim full grid to reflect growth by one cell at each stage *)
    k = (Length[ca[[1]]] + 1)/2;
    ca = Table[Table[Part[ca[[n]] [[j]],Range[k + 1 - n, k - 1 + n]], {j, k + 1 - n, k - 1 + n}], {n, 1, k}];
    Table[FromDigits[Part[ca[[i]] [[i]], Range[i, 2 * i - 1]], 10], {i, 1, stages - 1}]

Formula

Conjectures from Colin Barker, Apr 23 2017: (Start)
G.f.: (1 - x^2 + 10*x^4) / ((1 - x)*(1 - 10*x^2)).
a(n) = 10*(10^(n/2) - 1)/9 for n>1 and even.
a(n) = (10^((n+1)/2) - 10)/9 for n>1 and odd.
a(n) = a(n-1) + 10*a(n-2) - 10*a(n-3) for n>2.
(End)

A285613 Binary representation of the diagonal from the origin to the corner of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 62", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 10, 10, 100, 1100, 11000, 111000, 1110000, 11110000, 111100000, 1111100000, 11111000000, 111111000000, 1111110000000, 11111110000000, 111111100000000, 1111111100000000, 11111111000000000, 111111111000000000, 1111111110000000000, 11111111110000000000
Offset: 0

Views

Author

Robert Price, Apr 22 2017

Keywords

Comments

Initialized with a single black (ON) cell at stage zero.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Mathematica
    CAStep[rule_, a_] := Map[rule[[10 - #]] &, ListConvolve[{{0, 2, 0},{2, 1, 2}, {0, 2, 0}}, a, 2],{2}];
    code = 62; stages = 128;
    rule = IntegerDigits[code, 2, 10];
    g = 2 * stages + 1; (* Maximum size of grid *)
    a = PadLeft[{{1}}, {g, g}, 0,Floor[{g, g}/2]]; (* Initial ON cell on grid *)
    ca = a;
    ca = Table[ca = CAStep[rule, ca], {n, 1, stages + 1}];
    PrependTo[ca, a];
    (* Trim full grid to reflect growth by one cell at each stage *)
    k = (Length[ca[[1]]] + 1)/2;
    ca = Table[Table[Part[ca[[n]] [[j]],Range[k + 1 - n, k - 1 + n]], {j, k + 1 - n, k - 1 + n}], {n, 1, k}];
    Table[FromDigits[Part[ca[[i]] [[i]], Range[i, 2 * i - 1]], 10], {i, 1, stages - 1}]

Formula

Conjectures from Colin Barker, Apr 23 2017: (Start)
G.f.: (1 - 100*x^2 + 1000*x^4) / ((1 - 10*x)*(1 - 10*x^2)).
a(n) = (10^n - 10^(n/2)) / 9 for n>1 and even.
a(n) = (10^n - 10^(n/2+1/2)) / 9 for n>1 and odd.
a(n) = 10*a(n-1) + 10*a(n-2) - 100*a(n-3) for n>2.
(End)

A251861 Number of non-palindromic words (length n>0) over the alphabet of 26 letters.

Original entry on oeis.org

0, 650, 16900, 456300, 11863800, 308898200, 8031353200, 208826607600, 5429491797600, 141167083772000, 3670344178072000, 95428956352766400, 2481152865171926400, 64509974695265340800, 1677259342076898860800, 43608742899220046995200, 1133827315379721221875200, 29479510200008489360729600, 766467265200220723378969600, 19928148895209267985244544000
Offset: 1

Views

Author

Mikk Heidemaa, Dec 10 2014

Keywords

Comments

Example: the acronyms 'OEIS' and 'SIEO' are two distinct non-palindromic words of length 4 among all possible such 456300 words (over 26 letters of the Latin alphabet).

Examples

			For n=2, the a(2)=650 solutions are {ab,ac,...,az,...,yz}, but not, e.g., 'aa' or 'zz'.
		

Crossrefs

Analogs for other numbers of elements: (1) A000004, (2) A233411, (3) A242278, (4) A242026, (5) A240437.
Cf. A056450.

Programs

  • Maple
    seq(26^n - 26^ceil(n/2), n = 1 .. 50); # Robert Israel, Dec 11 2014
  • Mathematica
    f[n_, b_] := b^n - b^Ceiling[n/2]; Array[ f[#, 26] &, 50] (* Robert G. Wilson v, Dec 10 2014 *)
    Table[2^(n/2-1)*13^(n/2)*((-1)^n*(Sqrt[26]-1)-Sqrt[26]-1)+26^n, {n, 50}]
  • PARI
    a(n)=26^n-26^ceil(n/2) \\ Charles R Greathouse IV, Dec 10 2014

Formula

a(n) = 2^(n/2-1)*13^(n/2)*((-1)^n*(sqrt(26)-1)-sqrt(26)-1)+26^n.
a(n) = 26^n - 26^ceiling(n/2).
G.f.: 650*x^2/((1 - 26*x)*(1 - 26*x^2)).
a(n+3) = 26*a(n+2) + 26*a(n+1) - 676*a(n). - Robert Israel, Dec 11 2014
Showing 1-7 of 7 results.