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.

A273001 Number of permutations of [n] whose cycle lengths are Fibonacci numbers.

Original entry on oeis.org

1, 1, 2, 6, 18, 90, 420, 2220, 19020, 130860, 1096920, 9862920, 83843640, 1411202520, 16144792560, 203091829200, 2989264122000, 37012939750800, 597962683188000, 8681244913692000, 126467701221607200, 5006833609034743200, 95602098255580238400
Offset: 0

Views

Author

Alois P. Heinz, May 12 2016

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, add(
          `if`(issqr(5*j^2+4) or issqr(5*j^2-4),
           a(n-j)*(j-1)!*binomial(n-1, j-1), 0), j=1..n))
        end:
    seq(a(n), n=0..25);
  • Mathematica
    a[n_] := a[n] = If[n == 0, 1, Sum[If[IntegerQ @ Sqrt[5*j^2+4] || IntegerQ @ Sqrt[5*j^2-4], a[n-j]*(j-1)!*Binomial[n-1, j-1], 0], {j, 1, n}]]; Table[ a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 30 2017, translated from Maple *)

Formula

E.g.f.: exp(Sum_{n>=2} x^F(n)/F(n)) with F = A000045.

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

A273998 Number of endofunctions on [n] whose cycle lengths are primes.

Original entry on oeis.org

1, 0, 1, 8, 75, 904, 13255, 229536, 4587961, 103971680, 2634212961, 73787255200, 2264440519891, 75563445303072, 2724356214102055, 105546202276277504, 4373078169296869425, 192970687573630633216, 9035613818754820178689, 447469496697658409400960
Offset: 0

Views

Author

Alois P. Heinz, Jun 06 2016

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local r, p;
          if n=0 then 1 else r, p:=0, 2;
          while p<=n do r:= r+(p-1)!*b(n-p)*
             binomial(n-1, p-1); p:= nextprime(p)
          od; r fi
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_] := b[n] = Module[{r, p}, If[n == 0, 1, {r, p} = {0, 2}; While[p <= n, r = r + (p - 1)!*b[n - p]*Binomial[n-1, p-1]; p = NextPrime[p]]; r]];
    a[0] = 1; a[n_] := Sum[b[j]*n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jun 06 2018, from Maple *)

A329944 Number of permutations of [n] whose cycle lengths avoid primes.

Original entry on oeis.org

1, 1, 1, 1, 7, 31, 211, 1051, 10081, 107857, 1227241, 8969401, 108817831, 1173362191, 19426473067, 320062090531, 5692838161921, 70426164947041, 1346222143950481, 21952313047471537, 493701484264143751, 10971915198235355071, 266542798822750395331
Offset: 0

Views

Author

Alois P. Heinz, Nov 24 2019

Keywords

Examples

			a(4) = 7: (1)(2)(3)(4), (1234), (1243), (1324), (1342), (1423), (1432).
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, add(`if`(isprime(j), 0,
          a(n-j)*binomial(n-1, j-1)*(j-1)!), j=1..n))
        end:
    seq(a(n), n=0..25);
  • Mathematica
    a[n_] := a[n] = If[n == 0, 1, Sum[If[PrimeQ[j], 0,
         a[n-j] Binomial[n-1, j-1] (j-1)!], {j, 1, n}]];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Oct 31 2021, after Alois P. Heinz *)

Formula

a(n) mod 2 = 1.
a(n) mod 10 = period 5: repeat [1,1,1,1,7], g.f.: (7*x^4+x^3+x^2+x+1)/(1-x^5).

A305618 Expansion of e.g.f. log(1 + Sum_{k>=1} x^prime(k)/prime(k)!).

Original entry on oeis.org

0, 1, 1, -3, -9, 20, 190, -126, -6280, -10326, 293041, 1519320, -16985045, -194560444, 1013712777, 27317463952, -19210030599, -4305097718760, -17733269020226, 743855089334604, 7868686621862292, -132351392654695270, -2854492900112993039, 20150897206881256464
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 06 2018

Keywords

Comments

Logarithmic transform of A010051.

Examples

			E.g.f.: A(x) = x^2/2! + x^3/3! - 3*x^4/4! - 9*x^5/5! + 20*x^6/6! + ...
exp(A(x)) = 1 + x^2/2! + x^3/3! + x^5/5! + x^7/7! + ... + x^A000040(k)/A039716(k) + ...
exp(exp(A(x))-1) = 1 + x^2/2! + x^3/3! + 3*x^4/4! + 11*x^5/5! + ... + A190476(k)*x^k/k! + ...
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; (t-> `if`(n=0, 0, t(n)-add(a(j)*t(n-j)*
           j*binomial(n, j), j=1..n-1)/n))(i-> `if`(isprime(i), 1, 0))
        end:
    seq(a(n), n=1..25);  # Alois P. Heinz, Dec 04 2018
  • Mathematica
    nmax = 24; Rest[CoefficientList[Series[Log[1 + Sum[x^Prime[k]/Prime[k]!, {k, 1, nmax}]], {x, 0, nmax}], x] Range[0, nmax]!]
    a[n_] := a[n] = Boole[PrimeQ[n]] - Sum[k Binomial[n, k] Boole[PrimeQ[n - k]] a[k], {k, 1, n - 1}]/n; a[0] = 0; Table[a[n], {n, 24}]

A353162 Expansion of e.g.f. exp(Sum_{p prime} p * x^p).

Original entry on oeis.org

1, 0, 4, 18, 48, 1320, 4200, 115920, 994560, 11793600, 264055680, 2601244800, 67761429120, 1067726499840, 21513457405440, 485310649824000, 9925206939648000, 254012624170905600, 6174538264806912000, 160933619800835481600, 4458470291543671603200
Offset: 0

Views

Author

Seiichi Manyama, Apr 28 2022

Keywords

Crossrefs

Programs

  • PARI
    my(N=30, x='x+O('x^N)); Vec(serlaplace(exp(sum(k=1, N, isprime(k)*k*x^k))))
    
  • PARI
    a(n) = if(n==0, 1, (n-1)!*sum(k=1, n, isprime(k)*k^2*a(n-k)/(n-k)!));

Formula

a(0) = 1; a(n) = (n-1)! * Sum_{p<=n, p prime} p^2 * a(n-p)/(n-p)!.

A305619 Expansion of e.g.f. log(1 + Sum_{k>=1} x^prime(k)/prime(k)).

Original entry on oeis.org

0, 1, 2, -3, 4, -10, 636, -1078, -18416, -131976, 5035920, 5333592, 187347744, -4079616528, -14669908512, -140154110640, 28743506893056, -92449999037568, 2738959517576448, -52969092379214976, 34211286306178560, -16812071564735736576, 1407763084021569335808
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 06 2018

Keywords

Examples

			E.g.f.: A(x) = x^2/2! + 2*x^3/3! - 3*x^4/4! + 4*x^5/5! - 10*x^6/6! + ...
exp(A(x)) = 1 + x^2/2 + x^3/3 + x^5/5 + x^7/7 + ... + x^A000040(k)/A000040(k) + ...
exp(exp(A(x))-1) = 1 + x^2/2! + 2*x^3/3! + 3*x^4/4! + 44*x^5/5! + ... + A218002(k)*x^k/k! + ...
		

Crossrefs

Programs

  • Maple
    a:=series(log(1+add(x^ithprime(k)/ithprime(k),k=1..100)),x=0,24): seq(n!*coeff(a,x,n),n=0..23); # Paolo P. Lava, Mar 26 2019
  • Mathematica
    nmax = 23; Rest[CoefficientList[Series[Log[1 + Sum[x^Prime[k]/Prime[k], {k, 1, nmax}]], {x, 0, nmax}], x] Range[0, nmax]!]
    a[n_] := a[n] = Boole[PrimeQ[n]] (n - 1)! - Sum[k Binomial[n, k] Boole[PrimeQ[n - k]] (n - k - 1)! a[k], {k, 1, n - 1}]/n; a[0] = 0; Table[a[n], {n, 23}]

A347949 E.g.f.: 1 / (1 - Sum_{k>=1} x^prime(k) / prime(k)).

Original entry on oeis.org

1, 0, 1, 2, 6, 64, 170, 2988, 14616, 180192, 1934712, 21673200, 300266736, 4220710272, 61785461712, 1003589762784, 17448621367680, 327598207658496, 6279739240655232, 134169095009652480, 2817563310900129024, 64570676279407718400, 1547773850801172960000, 38824156236466815920640
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 20 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 23; CoefficientList[Series[1/(1 - Sum[x^Prime[k]/Prime[k], {k, 1, nmax}]), {x, 0, nmax}], x] Range[0, nmax]!
    a[0] = 1; a[n_] := a[n] = Sum[Binomial[n, k] (k - 1)! Boole[PrimeQ[k]] a[n - k], {k, 1, n}]; Table[a[n], {n, 0, 23}]

Formula

a(0) = 1; a(n) = Sum_{k=1..n} binomial(n,k) * (k-1)! * A010051(k) * a(n-k).
Showing 1-8 of 8 results.