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 11-14 of 14 results.

A322295 Number of permutations of [2n] with exactly n rising or falling successions.

Original entry on oeis.org

1, 2, 10, 120, 2198, 54304, 1674468, 61736880, 2644978110, 129019925424, 7056278570108, 427516982398576, 28417031969575260, 2055803302988520320, 160786792285272198088, 13517797622576903566560, 1215656330296317906395790, 116440107306323155369822800
Offset: 0

Views

Author

Alois P. Heinz, Dec 02 2018

Keywords

Crossrefs

Bisection (even part) of A322294.
Cf. A001100.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> coeff(S(2*n), t, n):
    seq(a(n), n=0..20);
  • Mathematica
    s[n_] := s[n] = If[n < 4, {1, 1, 2t, 4t + 2 t^2}[[n+1]], Expand[(n+1-t)* s[n-1] - (1-t)(n-2 + 3t) s[n-2] - (1-t)^2 (n-5+t) s[n-3] + (1-t)^3 (n-3)* s[n-4]]];
    a[n_] := Coefficient[s[2n], t, n];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Oct 23 2021, after Alois P. Heinz *)

Formula

a(n) = A001100(2n,n).

A383857 Number of permutations of [n] such that precisely one rising or falling succession occurs, but without either n(n-1) or (n-1)n.

Original entry on oeis.org

0, 0, 2, 8, 34, 196, 1366, 10928, 98330, 983036, 10811134, 129714184, 1686103522, 23603603540, 354033474374, 5664286296416, 96289603698346, 1733166940314028, 32929480177913230, 658578501071986616, 13829959293448920434, 304255691156335505924
Offset: 1

Views

Author

Wolfdieter Lang, May 19 2025

Keywords

Comments

See A086852 or 2*A000130 for the counting including the successions n(n-1) and (n-1)n. See also the k = 1 columns of the triangles A001100 and 2*A086856.
For the number of permutations of length n without rising or falling successions see A002464(n).

Examples

			a(3) = 2*1 from the permutations 213 and the reverted 312.
a(4) = 2*4 from 1324, 1423, 2314, 3124 and the reverted 4231, 3241, 4132, 4213.
a(5) = 2*17 from the permutations corresponding to A086852(5) = 2*20, without 13542, 24513, 25413, and the reverted 24531, 31542, 31452.
		

Crossrefs

Formula

a(n) = A002464(n+1) - (n-1) * A002464(n).

A322296 Number of permutations of [2n+1] with exactly n rising or falling successions.

Original entry on oeis.org

1, 4, 48, 888, 22120, 685368, 25344480, 1087931184, 53138966904, 2909014993080, 176372774697856, 11729862804913680, 848948339328178128, 66420006805308507568, 5585680154203107163200, 502437191145813112268640, 48134705092961286591532440
Offset: 0

Views

Author

Alois P. Heinz, Dec 02 2018

Keywords

Crossrefs

Bisection (odd part) of A322294.
Cf. A001100.

Programs

  • Maple
    S:= proc(n) option remember; `if`(n<4, [1, 1, 2*t, 4*t+2*t^2]
           [n+1], expand((n+1-t)*S(n-1) -(1-t)*(n-2+3*t)*S(n-2)
           -(1-t)^2*(n-5+t)*S(n-3) +(1-t)^3*(n-3)*S(n-4)))
        end:
    a:= n-> coeff(S(2*n+1), t, n):
    seq(a(n), n=0..20);
  • Mathematica
    S[n_] := S[n] = If[n < 4, {1, 1, 2*t, 4*t + 2*t^2}[[n + 1]], Expand[
                   (n + 1 - t)*S[n - 1] -
         (1 - t)*(n - 2 + 3*t)*S[n - 2] -
         (1 - t)^2*(n - 5 + t)*S[n - 3] +
             (1 - t)^3*(n - 3)*S[n - 4]]];
    a[n_] := Coefficient[S[2*n + 1], t, n];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Apr 21 2022, after Alois P. Heinz *)

Formula

a(n) = A001100(2n+1,n).

A295290 a(n) is the smallest triangular number t such that t - n is a square, or -1 if no such triangular number exists.

Original entry on oeis.org

0, 1, 3, 3, -1, 6, 6, -1, -1, 10, 10, 15, 21, -1, 15, 15, -1, 21, -1, 28, 21, 21, -1, -1, 28, -1, -1, 28, 28, 45, 55, -1, 36, -1, -1, 36, 36, -1, -1, 55, -1, 45, 78, -1, 45, 45, 55, -1, -1, -1, 66, 55, -1, 78, 55, 55, 105, 66, -1, -1, -1, -1, 66, -1, -1, 66
Offset: 0

Views

Author

Jon E. Schoenfield, Nov 19 2017

Keywords

Comments

Smallest triangular number (A000217) that exceeds a square by exactly n, or -1 if there is no such triangular number.

Examples

			a(0) = 0 because 0 is the smallest number that is both triangular and square.
a(12) = 21 because 21 - 12 = 9 = 3^2 and there is no triangular number t < 21 such that t - 12 is a square.
a(4) = -1 because there exists no triangular number t such that t - 4 is a square.
		

Crossrefs

Cf. A000217 (triangular numbers), A000290 (squares), A001100 (square triangular numbers).

Programs

  • Maple
    f:= proc(n) local s,t,R, v, R0;
      R:= [isolve(s^2 - 2*t^2 = 8*n+1)];
      if R = [] then return -1 fi;
      v:= indets(R,name) minus {s,t};
      R0:= remove(hastype,eval(R,v[1]=0),negative);
      s:= subs(R0[1],s);
      (s^2-1)/8;
    end proc:
    map(f, [$0..100]); # Robert Israel, Nov 22 2017
  • Mathematica
    a[n_] := Module[{s, t, k}, If[Solve[s^2 - 2t^2 == 8n+1, {s, t}, Integers] == {}, Return[-1]]; For[k = 0, True, k++, t = k(k+1)/2; If[IntegerQ[ Sqrt[t-n]], Return[t]]]];
    a /@ Range[0, 100] (* Jean-François Alcover, Oct 16 2020 *)

Formula

a(t) = t for every triangular number t.
a(t-1) = t for every positive triangular number t.
Previous Showing 11-14 of 14 results.