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

A317130 Number of permutations of [n] whose lengths of increasing runs are triangular numbers.

Original entry on oeis.org

1, 1, 1, 2, 7, 24, 93, 483, 2832, 17515, 123226, 978405, 8312802, 75966887, 756376739, 8070649675, 91320842018, 1099612368110, 14054043139523, 189320856378432, 2682416347625463, 39945105092501742, 623240458310527252, 10160826473676346731, 172871969109661492526
Offset: 0

Views

Author

Alois P. Heinz, Jul 21 2018

Keywords

Examples

			a(2) = 1: 21.
a(3) = 2: 123, 321.
a(4) = 7: 1243, 1342, 2134, 2341, 3124, 4123, 4321.
a(5) = 24: 12543, 13542, 14532, 21354, 21453, 23541, 24531, 31254, 31452, 32145, 32451, 34521, 41253, 41352, 42135, 42351, 43125, 51243, 51342, 52134, 52341, 53124, 54123, 54321.
		

Crossrefs

Programs

  • Maple
    g:= n-> `if`(issqr(8*n+1), 1, 0):
    b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
          `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
           add(b(u+j-1, o-j, t+1), j=1..o))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..27);
  • Mathematica
    g[n_] := If[IntegerQ @ Sqrt[8n+1], 1, 0];
    b[u_, o_, t_] := b[u, o, t] = If[u+o==0, g[t], If[g[t]==1, Sum[b[u-j, o+j-1, 1], {j, 1, u}], 0] + Sum[b[u+j-1, o-j, t+1], {j, 1, o}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 27] (* Jean-François Alcover, Apr 29 2020, after Alois P. Heinz *)

A317128 Number of permutations of [n] whose lengths of increasing runs are Fibonacci numbers.

Original entry on oeis.org

1, 1, 2, 6, 23, 112, 652, 4425, 34358, 299971, 2910304, 31059715, 361603228, 4560742758, 61947243329, 901511878198, 13994262184718, 230811430415207, 4030772161073249, 74301962970014978, 1441745847111969415, 29374226224980834077, 626971133730275593916
Offset: 0

Views

Author

Alois P. Heinz, Jul 21 2018

Keywords

Crossrefs

Programs

  • Maple
    g:= n-> (t-> `if`(issqr(t+4) or issqr(t-4), 1, 0))(5*n^2):
    b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
          `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
           add(b(u+j-1, o-j, t+1), j=1..o))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..27);
  • Mathematica
    g[n_] := With[{t = 5n^2}, If[IntegerQ@Sqrt[t+4] || IntegerQ@Sqrt[t-4], 1, 0]];
    b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
         If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
         Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021, after Alois P. Heinz *)

A317129 Number of permutations of [n] whose lengths of increasing runs are squares.

Original entry on oeis.org

1, 1, 1, 1, 2, 9, 40, 151, 571, 2897, 19730, 140190, 953064, 6708323, 54631552, 510143776, 4987278692, 49168919669, 505209884549, 5638095015594, 67921924172174, 852861260421398, 10992380368532792, 147296144926635359, 2082906807168675698, 30973237281668975230
Offset: 0

Views

Author

Alois P. Heinz, Jul 21 2018

Keywords

Examples

			a(3) = 1: 321.
a(4) = 2: 1234, 4321.
a(5) = 9: 12354, 12453, 13452, 21345, 23451, 31245, 41235, 51234, 54321.
		

Crossrefs

Programs

  • Maple
    g:= n-> `if`(issqr(n), 1, 0):
    b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
          `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
           add(b(u+j-1, o-j, t+1), j=1..o))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..27);
  • Mathematica
    g[n_] := If[IntegerQ@Sqrt[n], 1, 0];
    b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
         If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
         Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021, after Alois P. Heinz *)

A317131 Number of permutations of [n] whose lengths of increasing runs are prime numbers.

Original entry on oeis.org

1, 0, 1, 1, 5, 19, 80, 520, 2898, 22486, 171460, 1509534, 14446457, 147241144, 1650934446, 19494460567, 248182635904, 3340565727176, 47659710452780, 718389090777485, 11381176852445592, 189580213656445309, 3305258537062221020, 60273557241570401742
Offset: 0

Views

Author

Alois P. Heinz, Jul 21 2018

Keywords

Examples

			a(2) = 1: 12.
a(3) = 1: 123.
a(4) = 5: 1324, 1423, 2314, 2413, 3412.
a(5) = 19: 12345, 12435, 12534, 13245, 13425, 13524, 14235, 14523, 15234, 23145, 23415, 23514, 24135, 24513, 25134, 34125, 34512, 35124, 45123.
		

Crossrefs

Programs

  • Maple
    g:= n-> `if`(n=0 or isprime(n), 1, 0):
    b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
          `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
           add(b(u+j-1, o-j, t+1), j=1..o))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..27);
  • Mathematica
    g[n_] := If[n == 0 || PrimeQ[n], 1, 0];
    b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
         If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
         Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021, after Alois P. Heinz *)
  • Python
    from functools import lru_cache
    from sympy import isprime
    def g(n): return int(n == 0 or isprime(n))
    @lru_cache(maxsize=None)
    def b(u, o, t):
      if u + o == 0: return g(t)
      return (sum(b(u-j,  o+j-1,  1) for j in range(1, u+1)) if g(t) else 0) +\
              sum(b(u+j-1, o-j, t+1) for j in range(1, o+1))
    def a(n): return b(n, 0, 0)
    print([a(n) for n in range(28)]) # Michael S. Branicky, Mar 29 2021 after Alois P. Heinz

A317132 Number of permutations of [n] whose lengths of increasing runs are factorials.

Original entry on oeis.org

1, 1, 2, 5, 17, 70, 350, 2029, 13495, 100813, 837647, 7652306, 76282541, 823684964, 9578815164, 119346454671, 1586149739684, 22397700381817, 334879465463998, 5285103821004717, 87800206978975107, 1531533620821692217, 27987305231654121046, 534688325008397289484
Offset: 0

Views

Author

Alois P. Heinz, Jul 21 2018

Keywords

Crossrefs

Programs

  • Maple
    g:= proc(n) local i; 1; for i from 2 do
          if n=% then 1; break elif n<% then 0; break fi;
          %*i od; g(n):=%
        end:
    b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
          `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
           add(b(u+j-1, o-j, t+1), j=1..o))
        end:
    a:= n-> `if`(n=0, 1, add(b(j-1, n-j, 1), j=1..n)):
    seq(a(n), n=0..27);
  • Mathematica
    g[n_] := g[n] = Module[{i, k = 1}, For[i = 2, True, i++,
         If[n == k, k = 1; Break[]]; If[n < k, k = 0; Break[]];
         k = k*i]; k];
    b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
         If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
         Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
    a[n_] := If[n == 0, 1, Sum[b[j - 1, n - j, 1], {j, 1, n}]];
    a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021~, after Alois P. Heinz *)

Formula

a(3) = 5: 132, 213, 231, 312, 321.
a(4) = 17: 1324, 1423, 1432, 2143, 2314, 2413, 2431, 3142, 3214, 3241, 3412, 3421, 4132, 4213, 4231, 4312, 4321.

A322251 Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 3).

Original entry on oeis.org

1, 1, 1, 2, 8, 32, 132, 702, 4566, 31670, 237446, 2010626, 18782106, 187594266, 2009039346, 23200862726, 286250968646, 3740867774726, 51734894498790, 756345994706634, 11641318110171330, 188004200777993570, 3180713596572408650, 56276908859288339822
Offset: 0

Views

Author

Alois P. Heinz, Nov 30 2018

Keywords

Crossrefs

A322262 Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 6).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 14, 98, 546, 2562, 10626, 41118, 174174, 1093092, 10005996, 98041944, 889104216, 7315812504, 55893493656, 421564046904, 3519008733240, 36011379484080, 435775334314320, 5538098453968080, 68428271204813520, 805379194188288720
Offset: 0

Views

Author

Seiichi Manyama, Dec 01 2018

Keywords

Examples

			For n=6 the a(6)=2 permutations are 654321 and 123456.
		

Crossrefs

Cf. A000142, A322251 (mod 3), A317111 (mod 4), A322276 (mod 5).

Programs

  • PARI
    N=40; x='x+O('x^N); Vec(serlaplace(1/sum(k=0, 5, (-x)^k/k!)))

Formula

E.g.f.: 1/(1 - x + x^2/2! - x^3/3! + x^4/4! - x^5/5!).

A322276 Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 5).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 12, 72, 352, 1472, 5756, 26336, 180116, 1577006, 13720566, 109776526, 829240726, 6488348726, 59134377126, 640605185526, 7502207070150, 87309498759810, 989782736128170, 11277397727184650, 136523328121058170, 1817775858886701082
Offset: 0

Views

Author

Alois P. Heinz, Dec 01 2018

Keywords

Crossrefs

A322297 Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 7).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 16, 128, 800, 4160, 18944, 78080, 301160, 1208066, 6753606, 60823622, 648980646, 6581663766, 60475366230, 505780634070, 3921237755958, 29226687666930, 227116001463258, 2092153010685722, 24250743543656922, 322040690042341562
Offset: 0

Views

Author

Alois P. Heinz, Dec 02 2018

Keywords

Crossrefs

A322298 Number of permutations of [n] in which the length of every increasing run is 0 or 1 (mod 9).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 20, 200, 1520, 9440, 50624, 242816, 1066496, 4361216, 16856556, 64202712, 288983580, 2160645840, 24525417780, 294825080160, 3270522114228, 32898687457422, 302696887652022, 2577419367939422, 20537905525582022, 155236628840778062
Offset: 0

Views

Author

Alois P. Heinz, Dec 02 2018

Keywords

Crossrefs

Showing 1-10 of 13 results. Next