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.

A205801 Expansion of e.g.f. exp( Sum_{n>=1} x^(n^2) / (n^2) ).

Original entry on oeis.org

1, 1, 1, 1, 7, 31, 91, 211, 1681, 52417, 461161, 2427481, 10744471, 219643711, 2619643027, 18939628891, 1410692293921, 23943786881281, 263853697605841, 2237281161036337, 53316533506210471, 900164075618402911, 11265158441537890891, 112769404714319769571
Offset: 0

Views

Author

Paul D. Hanna, Jan 31 2012

Keywords

Comments

Number of permutations of [n] whose cycle lengths are squares. - Alois P. Heinz, May 12 2016

Examples

			E.g.f.: A(x) = 1 + x + x^2/2! + x^3/3! + 7*x^4/4! + 31*x^5/5! + 91*x^6/6! +...
where
log(A(x)) = x + x^4/4 + x^9/9 + x^16/16 + x^25/25 + x^36/36 +...
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, add(`if`(issqr(j),
           a(n-j)*(j-1)!*binomial(n-1, j-1), 0), j=1..n))
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, May 12 2016
  • Mathematica
    a[n_] := a[n] = If[n==0, 1, Sum[If[IntegerQ @ Sqrt[j], a[n-j]*(j-1)! * Binomial[n-1, j-1], 0], {j, 1, n}]]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 19 2017, after Alois P. Heinz *)
    nmax = 25; CoefficientList[Series[Product[1/(1 - x^k)^(LiouvilleLambda[k]/k), {k, 1, nmax}], {x, 0, nmax}], x] * Range[0, nmax]! (* Vaclav Kotesovec, Nov 17 2019 *)
  • PARI
    {a(n)=n!*polcoeff(exp(sum(m=1, sqrtint(n+1), x^(m^2)/(m^2)+x*O(x^n))), n)}
    
  • PARI
    a(n) = if(n==0, 1, (n-1)!*sum(k=1, sqrtint(n), a(n-k^2)/(n-k^2)!)); \\ Seiichi Manyama, Apr 29 2022

Formula

The e.g.f. A(x)=1+a(1)x+a(2)x^2/2!+... is equal to the power series expansion of the product of (1-x^n)^{-lambda(n)/n} (n=1,2,...) where lambda(n) is the Liouville function A008836 (follows easily from the Lambert series of lambda(n) - see e. g., the Wikipedia link). - Mamuka Jibladze, Jan 12 2014
a(0) = 1; a(n) = (n-1)! * Sum_{k=1..floor(sqrt(n))} a(n-k^2)/(n-k^2)!. - Seiichi Manyama, Apr 29 2022

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 *)

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.

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

Original entry on oeis.org

1, 1, 0, 0, 1, 8, 0, 0, 0, 1, 18, 0, 0, 1428, 47998, 0, 1, 32, 0, 0, 9688, 505056, 0, 0, 0, 4085949, 284958912, 0, 0, 290824632172, 28643427712626, 0, 0, 0, 104902510, 9998016202, 1, 72, 23207824626842, 3008268832634364, 182778, 206173972520, 24290829974718, 0
Offset: 0

Views

Author

Alois P. Heinz, Jul 28 2018

Keywords

Crossrefs

Programs

  • Maple
    g:= (n, s)-> `if`(n in s or not issqr(n), 0, 1):
    b:= proc(u, o, t, s) option remember; `if`(u+o=0, g(t, s),
          `if`(g(t, s)=1, add(b(u-j, o+j-1, 1, s union {t})
           , j=1..u), 0)+ add(b(u+j-1, o-j, t+1, s), j=1..o))
        end:
    a:= n-> b(n, 0$2, {}):
    seq(a(n), n=0..50);
  • Mathematica
    g[n_, s_] := If[MemberQ[s, n] || !IntegerQ@Sqrt[n], 0, 1];
    b[u_, o_, t_, s_] := b[u, o, t, s] = If[u + o == 0, g[t, s],
         If[g[t, s] == 1, Sum[b[u - j, o + j - 1, 1, s ~Union~ {t}],
         {j, 1, u}], 0] + Sum[b[u + j - 1, o - j, t + 1, s], {j, 1, o}]];
    a[n_] := b[n, 0, 0, {}];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 24 2021, after Alois P. Heinz *)

Formula

a(n) = 0 <=> n in { A001422 }.
a(n) > 0 <=> n in { A003995 }.
Showing 1-6 of 6 results.