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.

Previous Showing 101-110 of 119 results. Next

A350313 The Redstone permutation: a(1) = 2, a(2) = 1, otherwise the smallest number not occurring earlier which is strongly prime to n.

Original entry on oeis.org

2, 1, 4, 5, 3, 7, 8, 9, 10, 11, 6, 13, 14, 15, 16, 17, 12, 19, 20, 21, 22, 23, 18, 25, 26, 27, 28, 29, 24, 31, 32, 33, 34, 35, 36, 37, 30, 39, 40, 41, 38, 43, 44, 45, 46, 47, 42, 49, 50, 51, 52, 53, 48, 55, 56, 57, 58, 59, 54, 61, 62, 63, 64, 65, 66, 67, 60, 69, 70
Offset: 1

Views

Author

Peter Luschny, Dec 24 2021

Keywords

Comments

We say 'k is strongly prime to n' if and only if k is prime to n and k does not divide n - 1 (see A181830).
The sequence is a fixed-point-free permutation of the positive integers beginning with 2. According to Don Knuth, the number of fixed-point-free permutations beginning with 2 of [n] = {1, 2, ..., n} were already computed by Euler, see A000255.
We say n is a 'catch-up point' of a permutation p of the positive integers if and only if p restricted to [n] is a permutation of [n]. The catch-up points of this sequence start 2, 5, 11, 17, ... and are in A350314. This structure allows the sequence to be seen as an irregular triangle, as shown in the example section. The lengths of the resulting rows are a periodic sequence (see A350315).

Examples

			Catch-up points and initial segments:
[ 2]  2,  1,
[ 5]  4,  5,  3,
[11]  7,  8,  9, 10, 11,  6,
[17] 13, 14, 15, 16, 17, 12,
[23] 19, 20, 21, 22, 23, 18,
[29] 25, 26, 27, 28, 29, 24,
[37] 31, 32, 33, 34, 35, 36, 37, 30,
[41] 39, 40, 41, 38,
[47] 43, 44, 45, 46, 47, 42,
[53] 49, 50, 51, 52, 53, 48,
...
		

Crossrefs

Programs

A370383 Number of permutations of [n] having no substring [k,k+1,k+2,k+3,k+4].

Original entry on oeis.org

1, 1, 2, 6, 24, 119, 717, 5026, 40242, 362376, 3625081, 39885851, 478714416, 6224078292, 87145277160, 1307271652917, 20917481850667, 355612235468396, 6401234296266540, 121626707638142280, 2432586885636105251, 51085230669413519349, 1123891538655073251190
Offset: 0

Views

Author

Seiichi Manyama, Feb 17 2024

Keywords

Crossrefs

Programs

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

Formula

G.f.: Sum_{k>=0} k! * ( (x-x^5)/(1-x^5) )^k.
a(n) = Sum_{k=0..4} A184182(n,k). - Alois P. Heinz, Feb 17 2024

A370384 Number of permutations of [n] having no substring [k,k+1,k+2,k+3,k+4,k+5].

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 719, 5037, 40306, 362802, 3628296, 39913080, 478970641, 6226733531, 87175347936, 1307641346772, 20922387099240, 355682119243320, 6402298503373917, 121643960874649867, 2432883613692550316, 51090627024035616300, 1123995015882951892680
Offset: 0

Views

Author

Seiichi Manyama, Feb 17 2024

Keywords

Crossrefs

Programs

  • PARI
    my(N=30, x='x+O('x^N)); Vec(sum(k=0, N, k!*((x-x^6)/(1-x^6))^k))

Formula

G.f.: Sum_{k>=0} k! * ( (x-x^6)/(1-x^6) )^k.
a(n) = Sum_{k=0..5} A184182(n,k). - Alois P. Heinz, Feb 17 2024

A383380 Expansion of e.g.f. exp(-2*x) / (1-x)^4.

Original entry on oeis.org

1, 2, 8, 40, 248, 1808, 15136, 142784, 1496960, 17254144, 216740864, 2945973248, 43065951232, 673626675200, 11224114860032, 198447384666112, 3710328985124864, 73136238041563136, 1515739708283944960, 32947698735175172096, 749499782353468522496, 17806903161183314378752
Offset: 0

Views

Author

Seiichi Manyama, Apr 24 2025

Keywords

Crossrefs

Programs

  • PARI
    my(N=30, x='x+O('x^N)); Vec(serlaplace(exp(-2*x)/(1-x)^4))

Formula

E.g.f.: B(x)^2, where B(x) is the e.g.f. of A000255.
a(n) = n! * Sum_{k=0..n} (-2)^(n-k) * binomial(k+3,3)/(n-k)!.
a(0) = 1, a(1) = 2; a(n) = (n+1)*a(n-1) + 2*(n-1)*a(n-2).
a(n) ~ sqrt(Pi) * n^(n + 7/2) / (3*sqrt(2)*exp(n+2)). - Vaclav Kotesovec, Apr 25 2025

A180185 Triangle read by rows: T(n,k) is the number of permutations of [n] having no 3-sequences and having k successions (0 <= k <= floor(n/2)); a succession of a permutation p is a position i such that p(i +1) - p(i) = 1.

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 11, 9, 1, 53, 44, 9, 309, 265, 66, 3, 2119, 1854, 530, 44, 16687, 14833, 4635, 530, 11, 148329, 133496, 44499, 6180, 265, 1468457, 1334961, 467236, 74165, 4635, 53, 16019531, 14684570, 5339844, 934472, 74165, 1854, 190899411
Offset: 0

Views

Author

Emeric Deutsch, Sep 06 2010

Keywords

Comments

Row n has 1+floor(n/2) entries.
Sum of entries in row n is A002628(n).

Examples

			T(6,3)=3 because we have 125634, 341256, and 563412.
Triangle starts:
     1;
     1;
     1,    1;
     3,    2;
    11,    9,    1;
    53,   44,    9;
   309,  265,   66,    3;
  2119, 1854,  530,   44;
		

Crossrefs

Programs

  • Maple
    d[0] := 1: for n to 51 do d[n] := n*d[n-1]+(-1)^n end do: a := proc (n, k) if n = 0 and k = 0 then 1 elif k <= (1/2)*n then binomial(n-k, k)*d[n+1-k]/(n-k) else 0 end if end proc: for n from 0 to 12 do seq(a(n, k), k = 0 .. (1/2)*n) end do; # yields sequence in triangular form
  • Mathematica
    d[0] = 1; d[n_] := d[n] = n d[n - 1] + (-1)^n;
    T[n_, k_] := If[n == 0 && k == 0, 1, If[k <= n/2, Binomial[n - k, k] d[n + 1 - k]/(n - k), 0]];
    Table[T[n, k], {n, 0, 20}, {k, 0, Quotient[n, 2]}] // Flatten (* Jean-François Alcover, May 23 2020 *)
  • PARI
    d(n) = if(n<2, !n , round(n!/exp(1)));
    for(n=0, 20, for(k=0, (n\2), print1(binomial(n - k, k)*(d(n - k) + d(n - k - 1)),", ");); print();) \\ Indranil Ghosh, Apr 12 2017

Formula

T(n,k) = binomial(n-k,k)*(d(n-k) + d(n-k-1)), where d(j) = A000166(j) are the derangement numbers.
T(n,0) = d(n) + d(n-1) = A000255(n-1).
T(n,1) = d(n).
Sum_{k>=0} k*T(n,k) = A002629(n+1).

A195326 Numerators of fractions leading to e - 1/e (A174548).

Original entry on oeis.org

0, 2, 2, 7, 7, 47, 47, 5923, 5923, 426457, 426457, 15636757, 15636757, 7318002277, 7318002277, 1536780478171, 1536780478171, 603180793741, 603180793741, 142957467201379447, 142957467201379447
Offset: 0

Views

Author

Paul Curtz, Oct 12 2011

Keywords

Comments

The sequence of approximations of exp(1) obtained by truncating the Taylor series of exp(x) after n terms is A061354(n)/A061355(n) = 1, 2, 5/2, 8/3, 65/24, ...
A Taylor series of exp(-1) is 1, 0, 1/2, 1/3, 3/8, ... and (apart from the first 2 terms) given by A000255(n)/A001048(n). Subtracting both sequences term by term we obtain a series for exp(1) - exp(-1) = 0, 2, 2, 7/3, 7/3, 47/20, 47/20, 5923/2520, 5923/2520, 426457/181440, 426457/181440, ... which defines the numerators here.
Each second of the denominators (that is 3, 2520, 19958400, ...) is found in A085990 (where each third term, that is 60, 19958400, ...) is to be omitted.
This numerator sequence here is basically obtained by doubling entries of A051397, A009628, A087208, or A186763, caused by the standard associations between cosh(x), sinh(x) and exp(x).

Examples

			a(0) =  1  -  1;
a(1) =  2  -  0;
a(2) = 5/2 - 1/2.
		

Crossrefs

Programs

  • Maple
    taylExp1 := proc(n)
            add(1/j!,j=0..n) ;
    end proc:
    A000255 := proc(n)
            if n <=1 then
                    1;
            else
                    n*procname(n-1)+(n-1)*procname(n-2) ;
            end if;
    end proc:
    A001048 := proc(n)
            n!+(n-1)! ;
    end proc:
    A195326 := proc(n)
            if n = 0 then
                    0;
            elif n =1 then
                    2;
            else
                    taylExp1(n) -A000255(n-2)/A001048(n-1);
            end if;
              numer(%);
    end proc:
    seq(A195326(n),n=0..20) ; # R. J. Mathar, Oct 14 2011

Extensions

Material meant to be placed in other sequences removed by R. J. Mathar, Oct 14 2011

A218538 Triangle read by rows: T(n,k) is the number of permutations of{1,2,...,n} avoiding [x,x+1] having genus k (see first comment for definition of genus).

Original entry on oeis.org

1, 1, 0, 3, 0, 0, 7, 4, 0, 0, 19, 29, 5, 0, 0, 53, 180, 76, 0, 0, 0, 153, 1004, 901, 61, 0, 0, 0, 453, 5035, 8884, 2315, 0, 0, 0, 0, 1367, 23653, 74177, 46285, 2847, 0, 0, 0, 0, 4191, 106414, 546626, 667640, 143586, 0, 0, 0, 0, 0, 13015, 463740, 3658723, 7777935, 3896494, 209624, 0
Offset: 1

Views

Author

Joerg Arndt, Nov 01 2012

Keywords

Comments

The genus g(p) of a permutation p of {1,2,...,n} is defined by g(p)=(1/2)[n+1-z(p)-z(cp')], where p' is the inverse permutation of p, c = 234...n1 = (1,2,...,n), and z(q) is the number of cycles of the permutation q.
Row sums are A000255 (permutations with no substring [x,x+1]).
First column is A078481.

Examples

			Triangle starts:
[ 1]  1,
[ 2]  1, 0,
[ 3]  3, 0, 0,
[ 4]  7, 4, 0, 0,
[ 5]  19, 29, 5, 0, 0,
[ 6]  53, 180, 76, 0, 0, 0,
[ 7]  153, 1004, 901, 61, 0, 0, 0,
[ 8]  453, 5035, 8884, 2315, 0, 0, 0, 0,
[ 9]  1367, 23653, 74177, 46285, 2847, 0, 0, 0, 0,
[10]  4191, 106414, 546626, 667640, 143586, 0, 0, 0, 0, 0,
[11]  13015, 463740, 3658723, 7777935, 3896494, 209624, 0, 0, 0, 0, 0,
[12]  40857, 1972339, 22712736, 77535694, 74678363, 13959422, 0, 0, ...,
[13]  129441, 8228981, 132804891, 685673340, 1131199122, 485204757, 23767241, 0, ...,
...
		

Crossrefs

Cf. A177267 (genus of all permutations).
Cf. A178514 (genus of derangements), A178515 (genus of involutions), A178516 (genus of up-down permutations), A178517 (genus of non-derangement permutations), A178518 (permutations of [n] having genus 0 and p(1)=k), A185209 (genus of connected permutations).

A247490 Square array read by antidiagonals: A(k, n) = (-1)^(n+1)* hypergeom([k, -n+1], [], 1) for n>0 and A(k,0) = 0 (n>=0, k>=1).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 2, 3, 2, 0, 1, 3, 7, 11, 9, 0, 1, 4, 13, 32, 53, 44, 0, 1, 5, 21, 71, 181, 309, 265, 0, 1, 6, 31, 134, 465, 1214, 2119, 1854, 0, 1, 7, 43, 227, 1001, 3539, 9403, 16687, 14833, 0, 1, 8, 57, 356, 1909, 8544, 30637, 82508, 148329, 133496
Offset: 0

Views

Author

Peter Luschny, Sep 20 2014

Keywords

Examples

			k\n
[1], 0, 1, 0,  1,   2,    9,   44,    265,      1854, ...  A000166
[2], 0, 1, 1,  3,  11,   53,   309,  2119,     16687, ...  A000255
[3], 0, 1, 2,  7,  32,  181,  1214,  9403,     82508, ...  A000153
[4], 0, 1, 3, 13,  71,  465,  3539,  30637,   296967, ...  A000261
[5], 0, 1, 4, 21, 134, 1001,  8544,  81901,   870274, ...  A001909
[6], 0, 1, 5, 31, 227, 1909, 18089, 190435,  2203319, ...  A001910
[7], 0, 1, 6, 43, 356, 3333, 34754, 398959,  4996032, ...  A176732
[8], 0, 1, 7, 57, 527, 5441, 61959, 770713, 10391023, ...  A176733
The referenced sequences may have a different offset or other small deviations.
		

Crossrefs

Programs

  • Maple
    A := (k,n) -> `if`(n<2,n,hypergeom([k,-n+1],[],1)*(-1)^(n+1));
    seq(print(seq(round(evalf(A(k,n),100)), n=0..8)), k=1..8);
  • Sage
    from mpmath import mp, hyp2f0
    mp.dps = 25; mp.pretty = True
    def A247490(k, n):
        if n < 2: return n
        if k == 1 and n == 2: return 0  # (failed to converge)
        return int((-1)^(n+1)*hyp2f0(k, -n+1, 1))
    for k in (1..8): print([k], [A247490(k, n) for n in (0..8)])

A271698 Triangle read by rows, T(n,k) = Sum_{j=0..n} C(-j,-n)*E1(j,k), E1 the Eulerian numbers A173018, for n>=0 and 0<=k<=n.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 2, 8, 1, 0, 0, 2, 28, 22, 1, 0, 0, 2, 72, 182, 52, 1, 0, 0, 2, 164, 974, 864, 114, 1, 0, 0, 2, 352, 4174, 8444, 3474, 240, 1, 0, 0, 2, 732, 15782, 61464, 57194, 12660, 494, 1, 0, 0, 2, 1496, 55286, 373940, 660842, 332528, 43358, 1004, 1, 0
Offset: 0

Views

Author

Peter Luschny, Apr 12 2016

Keywords

Examples

			Triangle starts:
1,
1, 0,
0, 1, 0,
0, 2, 1, 0,
0, 2, 8, 1, 0,
0, 2, 28, 22, 1, 0,
0, 2, 72, 182, 52, 1, 0,
0, 2, 164, 974, 864, 114, 1, 0
		

Crossrefs

A000255 (row sums), compare A028296 for alternating rows sums, A145654 and A005803 (diag. n,n-2).
Cf. A173018.

Programs

  • Maple
    A271698 := (n,k) -> add(binomial(-j,-n)*combinat:-eulerian1(j,k), j=0..n):
    seq(seq(A271698(n, k), k=0..n), n=0..10);
  • Mathematica
    <
    				

A316666 Number of simple relaxed compacted binary trees of right height at most one with no sequences on level 1 and no final sequences on level 0.

Original entry on oeis.org

1, 0, 1, 3, 15, 87, 597, 4701, 41787, 413691, 4512993, 53779833, 695000919, 9680369943, 144560191149, 2303928046437, 39031251610227, 700394126116851, 13270625547477177, 264748979672169681, 5547121478845459983, 121784530649198053263, 2795749225338111831429, 66981491857058929294653
Offset: 0

Views

Author

Michael Wallner, Jul 10 2018

Keywords

Comments

A relaxed compacted binary tree of size n is a directed acyclic graph consisting of a binary tree with n internal nodes, one leaf, and at most n pointers. It is constructed from a binary tree of size n, where the first leaf in a post-order traversal is kept and all other leaves are replaced by pointers. These links may point to any node that has already been visited by the post-order traversal. It is called simple if for nodes with two pointers both point to the same node. The right height is the maximal number of right-edges (or right children) on all paths from the root to any leaf after deleting all pointers. See the Wallner link.
a(n) is one of two "basis" sequences for sequences of the form a(0)=a, a(1)=b, a(n) = n*a(n-1) + (n-1)*a(n-2), the second basis sequence being A096654 (with 0 appended as a(0)). The sum of these sequences is listed as A000255. - Gary Detlefs, Dec 11 2018

Crossrefs

Cf. A000032, A000246, A001879, A051577, A213527, A288950, A288952, A288953 (subclasses of relaxed compacted binary trees of right height at most one, see the Wallner link).
Cf. A000166, A000255, A000262, A052852, A123023, A130905, A176408, A201203 (variants of simple relaxed compacted binary trees of right height at most one, see the Wallner link).

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!( (3*Exp(-x) + x-2)/(1-x)^2 )); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Dec 12 2018
  • Maple
    aseq := n-> 3*round((n+2)*n!/exp(1))-(n+2)*n!: bseq := n-> (n+2)*n!- 2* round((n+2)*n!/exp(1)): s := (a,b,n)-> a*aseq(n) + b*bseq( n): seq(s(1,0,n),n = 0..20);  # Gary Detlefs, Dec 11 2018
  • Mathematica
    terms = 24;
    CoefficientList[(3E^-z+z-2)/(1-z)^2 + O[z]^terms, z] Range[0, terms-1]! (* Jean-François Alcover, Sep 14 2018 *)
  • PARI
    Vec(serlaplace((3*exp(-x + O(x^25)) + x - 2)/(1 - x)^2)) \\ Andrew Howroyd, Jul 10 2018
    

Formula

E.g.f.: (3*exp(-z)+z-2)/(1-z)^2.
a(n) ~ (3*exp(-1) - 1) * n * n!. - Vaclav Kotesovec, Jul 12 2018
a(n) = 3*round((n+2)*n!/e) - (n+2)*n!. - Gary Detlefs, Dec 11 2018
From Seiichi Manyama, Apr 25 2025: (Start)
a(n) = 3 * A000255(n) - n! - (n+1)!.
a(0) = 1, a(1) = 0; a(n) = n*a(n-1) + (n-1)*a(n-2). (End)
Previous Showing 101-110 of 119 results. Next