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-20 of 146 results. Next

A163842 Triangle interpolating the swinging factorial (A056040) restricted to odd indices with its binomial transform. Same as interpolating the beta numbers 1/beta(n,n) (A002457) with (A163869). Triangle read by rows, for n >= 0, k >= 0.

Original entry on oeis.org

1, 7, 6, 43, 36, 30, 249, 206, 170, 140, 1395, 1146, 940, 770, 630, 7653, 6258, 5112, 4172, 3402, 2772, 41381, 33728, 27470, 22358, 18186, 14784, 12012, 221399, 180018, 146290, 118820, 96462, 78276, 63492, 51480
Offset: 0

Views

Author

Peter Luschny, Aug 06 2009

Keywords

Examples

			Triangle begins:
      1;
      7,     6;
     43,    36,    30;
    249,   206,   170,   140;
   1395,  1146,   940,   770,   630;
   7653,  6258,  5112,  4172,  3402,  2772;
  41381, 33728, 27470, 22358, 18186, 14784, 12012;
		

Crossrefs

Programs

  • Maple
    # Computes n rows of the triangle. For the functions 'SumTria' and 'swing' see A163840.
    a := n -> SumTria(k->swing(2*k+1),n,true);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; t[n_, k_] := Sum[Binomial[n-k, n-i]*sf[2*i+1], {i, k, n}]; Table[t[n, k], {n, 0, 7}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 28 2013 *)

Formula

T(n,k) = Sum_{i=k..n} binomial(n-k,n-i)*(2i+1)$ where i$ denotes the swinging factorial of i (A056040).

A163076 Primes of the form k$ - 1. Here '$' denotes the swinging factorial function (A056040).

Original entry on oeis.org

5, 19, 29, 139, 251, 12011, 48619, 51479, 155117519, 81676217699, 1378465288199, 5651707681619, 386971244197199, 1580132580471899, 30067266499541039, 6637553085023755473070799, 35257120210449712895193719, 399608854866744452032002440111
Offset: 1

Views

Author

Peter Luschny, Jul 21 2009

Keywords

Examples

			Since 4$ = 6 the prime 5 is listed.
		

Crossrefs

Cf. A055490, A056040, A163078 (arguments k), A163074, A163075.

Programs

  • Maple
    a := proc(n) select(isprime, map(x -> A056040(x)-1,[$1..n])); sort(%) end:
  • Mathematica
    Reap[Do[f = n!/Quotient[n, 2]!^2; If[PrimeQ[p = f - 1], Sow[p]], {n, 1, 70}]][[2, 1]] // Union (* Jean-François Alcover, Jun 28 2013 *)

Extensions

More terms from Jinyuan Wang, Mar 22 2020

A163079 Primes p such that p$ + 1 is also prime. Here '$' denotes the swinging factorial function (A056040).

Original entry on oeis.org

2, 3, 5, 31, 67, 139, 631, 9743, 16253, 17977, 27901, 37589
Offset: 1

Views

Author

Peter Luschny, Jul 21 2009

Keywords

Comments

a(n) are the primes in A163077.

Examples

			5 is prime and 5$ + 1 = 30 + 1 = 31 is prime, so 5 is in the sequence.
		

Crossrefs

Programs

  • Maple
    a := proc(n) select(isprime,select(k -> isprime(A056040(k)+1),[$0..n])) end:
  • Mathematica
    f[n_] := 2^(n - Mod[n, 2])*Product[k^((-1)^(k + 1)), {k, n}]; p = 2; lst = {}; While[p < 38000, a = f@p + 1; If[ PrimeQ@a, AppendTo[ lst, p]; Print@p]; p = NextPrime@p]; lst (* Robert G. Wilson v, Aug 08 2010 *)
  • PARI
    is(k) = isprime(k) && ispseudoprime(1+k!/(k\2)!^2); \\ Jinyuan Wang, Mar 22 2020

Extensions

a(8)-a(12) from Robert G. Wilson v, Aug 08 2010

A163213 Swinging Wilson remainders ((p-1)$ + (-1)^floor((p+2)/2))/p mod p, p prime. Here '$' denotes the swinging factorial function (A056040).

Original entry on oeis.org

1, 1, 1, 3, 1, 6, 9, 13, 12, 2, 19, 2, 5, 36, 6, 19, 43, 11, 47, 67, 39, 41, 70, 12, 17, 83, 88, 81, 25, 53, 91, 97, 106, 79, 43, 39, 7, 29, 73, 6, 79, 115
Offset: 1

Views

Author

Peter Luschny, Jul 24 2009

Keywords

Comments

If this is zero, p is a swinging Wilson prime.

Examples

			The swinging Wilson quotient related to the 5th prime is (252+1)/11=23, so the 5th term is 23 mod 11 = 1.
		

Crossrefs

Programs

  • Maple
    WR := proc(f,r,n) map(p->(f(p-1)+r(p))/p mod p,select(isprime,[$1..n])) end:
    A002068 := n -> WR(factorial,p->1,n);
    A163213 := n -> WR(swing,p->(-1)^iquo(p+2,2),n);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; a[n_] := (p = Prime[n]; Mod[(sf[p - 1] + (-1)^Floor[(p + 2)/2])/p, p]); Table[a[n], {n, 1, 42}] (* Jean-François Alcover, Jun 28 2013 *)
  • PARI
    sf(n)=n!/(n\2)!^2
    apply(p->sf(p-1)\/p%p, primes(100)) \\ Charles R Greathouse IV, Dec 11 2016

A163649 Triangle interpolating between (-1)^n (A033999) and A056040(n), read by rows.

Original entry on oeis.org

1, -1, 1, 1, -2, 2, -1, 3, -6, 6, 1, -4, 12, -24, 6, -1, 5, -20, 60, -30, 30, 1, -6, 30, -120, 90, -180, 20, -1, 7, -42, 210, -210, 630, -140, 140, 1, -8, 56, -336, 420, -1680, 560, -1120, 70
Offset: 0

Views

Author

Peter Luschny, Aug 02 2009

Keywords

Comments

Given T(n,k) = (-1)^(n-k)*floor(k/2)!^(-2)*n!/(n-k)!, let A(n,k) = abs(T(n,k)) be the coefficients of the polynomials Sum_{k=0..n} binomial(n,k)*A056040(k)*q^k. Substituting q^k -> 1/(floor(k/2)+1) in the polynomials gives the extended Motzkin numbers A189912. (See A089627 for the Motzkin numbers and A194586 for the complementary Motzkin numbers.)

Examples

			1
-1, 1
1, -2, 2
-1, 3, -6, 6
1, -4, 12, -24, 6
-1, 5, -20, 60, -30, 30
1, -6, 30, -120, 90, -180, 20
-1, 7, -42, 210, -210, 630, -140, 140
1, -8, 56, -336, 420, -1680, 560, -1120, 70
		

Crossrefs

Row sums give A163650, row sums of absolute values give A163865.
Aerated versions A194586 (odd case) and A089627 (even case).

Programs

  • Maple
    a := proc(n,k) (-1)^(n-k)*floor(k/2)!^(-2)*n!/(n-k)! end:
    seq(print(seq(a(n,k),k=0..n)),n=0..8);
  • Mathematica
    t[n_, k_] := (-1)^(n - k)*Floor[k/2]!^(-2)*n!/(n - k)!; Table[t[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 29 2013 *)
  • PARI
    for(n=0,10, for(k=0,n, print1((-1)^(n -k)*( (floor(k/2))! )^(-2)*(n!/(n - k)!), ", "))) \\ G. C. Greubel, Aug 01 2017

Formula

T(n,k) = (-1)^(n-k)*floor(k/2)!^(-2)*n!/(n-k)!.
E.g.f.: egf(x,y) = exp(-x)*BesselI(0,2*x*y)*(1+x*y).

A163770 Triangle read by rows interpolating the swinging subfactorial (A163650) with the swinging factorial (A056040).

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 3, 4, 6, -9, -7, -4, 0, 6, 44, 35, 28, 24, 24, 30, -165, -121, -86, -58, -34, -10, 20, 594, 429, 308, 222, 164, 130, 120, 140, -2037, -1443, -1014, -706, -484, -320, -190, -70, 70, 6824, 4787, 3344, 2330, 1624, 1140, 820, 630, 560, 630
Offset: 0

Views

Author

Peter Luschny, Aug 05 2009

Keywords

Comments

An analog to the derangement triangle (A068106).

Examples

			1
0, 1
1, 1, 2
2, 3, 4, 6
-9, -7, -4, 0, 6
44, 35, 28, 24, 24, 30
-165, -121, -86, -58, -34, -10, 20
		

Crossrefs

Row sums are A163773.

Programs

  • Maple
    DiffTria := proc(f,n,display) local m,A,j,i,T; T:=f(0);
    for m from 0 by 1 to n-1 do A[m] := f(m);
    for j from m by -1 to 1 do A[j-1] := A[j-1] - A[j] od;
    for i from 0 to m do T := T,(-1)^(m-i)*A[i] od;
    if display then print(seq(T[i],i=nops([T])-m..nops([T]))) fi;
    od; subsop(1=NULL,[T]) end:
    swing := proc(n) option remember; if n = 0 then 1 elif
    irem(n, 2) = 1 then swing(n-1)*n else 4*swing(n-1)/n fi end:
    Computes n rows of the triangle.
    A163770 := n -> DiffTria(k->swing(k),n,true);
    A068106 := n -> DiffTria(k->factorial(k),n,true);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; t[n_, k_] := Sum[(-1)^(n - i)*Binomial[n - k, n - i]*sf[i], {i, k, n}]; Table[t[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 28 2013 *)

Formula

T(n,k) = Sum_{i=k..n} (-1)^(n-i)*binomial(n-k,n-i)*i$ where i$ denotes the swinging factorial of i (A056040).

A163840 Triangle interpolating the binomial transform of the swinging factorial (A163865) with the swinging factorial (A056040).

Original entry on oeis.org

1, 2, 1, 5, 3, 2, 16, 11, 8, 6, 47, 31, 20, 12, 6, 146, 99, 68, 48, 36, 30, 447, 301, 202, 134, 86, 50, 20, 1380, 933, 632, 430, 296, 210, 160, 140, 4251, 2871, 1938, 1306, 876, 580, 370, 210, 70, 13102, 8851, 5980, 4042, 2736, 1860, 1280, 910, 700, 630
Offset: 0

Views

Author

Peter Luschny, Aug 06 2009

Keywords

Comments

Triangle read by rows.
An analog to the binomial triangle of the factorials (A076571).

Examples

			Triangle begins
    1;
    2,   1;
    5,   3,   2;
   16,  11,   8,   6;
   47,  31,  20,  12,  6;
  146,  99,  68,  48, 36, 30;
  447, 301, 202, 134, 86, 50, 20;
		

Crossrefs

Row sums are A163843.

Programs

  • Maple
    SumTria := proc(f,n,display) local m,A,j,i,T; T:=f(0);
    for m from 0 by 1 to n-1 do A[m] := f(m);
    for j from m by -1 to 1 do A[j-1] := A[j-1] + A[j] od;
    for i from 0 to m do T := T,A[i] od;
    if display then print(seq(T[i],i=nops([T])-m..nops([T]))) fi;
    od; subsop(1=NULL,[T]) end:
    swing := proc(n) option remember; if n = 0 then 1 elif
    irem(n, 2) = 1 then swing(n-1)*n else 4*swing(n-1)/n fi end:
    # Computes n rows of the triangle:
    A163840 := n -> SumTria(swing,n,true);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; t[n_, k_] := Sum[Binomial[n - k, n - i]*sf[i], {i, k, n}]; Table[t[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 28 2013 *)

Formula

T(n,k) = Sum_{i=k..n} binomial(n-k,n-i)*i$ where i$ denotes the swinging factorial of i (A056040), for n >= 0, k >= 0.

A163841 Triangle interpolating the swinging factorial (A056040) restricted to even indices with its binomial transform. Same as interpolating bilateral Schroeder paths (A026375) with the central binomial coefficients (A000984).

Original entry on oeis.org

1, 3, 2, 11, 8, 6, 45, 34, 26, 20, 195, 150, 116, 90, 70, 873, 678, 528, 412, 322, 252, 3989, 3116, 2438, 1910, 1498, 1176, 924, 18483, 14494, 11378, 8940, 7030, 5532, 4356, 3432, 86515, 68032, 53538
Offset: 0

Views

Author

Peter Luschny, Aug 06 2009

Keywords

Comments

For n >= 0, k >= 0 let T(n,k) = sum{i=k..n} binomial(n-k,n-i)*(2i)$ where i$ denotes the swinging factorial of i (A056040). Triangle read by rows.

Examples

			Triangle begins
     1;
     3,    2;
    11,    8,    6;
    45,   34,   26,   20;
   195,  150,  116,   90,   70;
   873,  678,  528,  412,  322,  252;
  3989, 3116, 2438, 1910, 1498, 1176,  924;
		

Crossrefs

Programs

  • Maple
    Computes n rows of the triangle. For the functions 'SumTria' and 'swing' see A163840.
    a := n -> SumTria(k->swing(2*k),n,true);
  • Mathematica
    sf[n_] := n!/Quotient[n, 2]!^2; t[n_, k_] := Sum[Binomial[n - k, n - i]*sf[2*i], {i, k, n}]; Table[t[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 28 2013 *)

A180064 a(n) = n!/A056040(n).

Original entry on oeis.org

1, 1, 1, 1, 4, 4, 36, 36, 576, 576, 14400, 14400, 518400, 518400, 25401600, 25401600, 1625702400, 1625702400, 131681894400, 131681894400, 13168189440000, 13168189440000, 1593350922240000, 1593350922240000, 229442532802560000, 229442532802560000
Offset: 0

Views

Author

Robert G. Wilson v, Aug 08 2010

Keywords

Comments

From Emeric Deutsch, Dec 24 2008 [edited and moved here by Andrey Zabolotskiy, Oct 19 2023]: (Start)
a(n+1) is the number of permutations of {1,2,...,n} with no even entry followed by a smaller entry. Example: a(5)=4 because we have 1234, 1324, 3124 and 2314.
a(n+1) is the number of permutations p of {1,2,...,n} such that p(j) is odd whenever j is even. Example: a(5)=4 because we have 4123, 2143, 2341 and 4321.
a(n+1) = A134434(n,0). (End)

Crossrefs

Programs

  • Maple
    A180064 := n -> iquo(n,2)!^2; # Peter Luschny, Aug 23 2010
  • Mathematica
    f[n_] := 2^(n - Mod[n, 2])*Product[k^((-1)^(k+1)), {k,n}]; Array[ #!/f@# &, 25, 0]

Formula

a(n) = A000142(n) / A056040(n).
a(n) = floor(n/2)!^2. - Peter Luschny, Aug 23 2010

A196747 Numbers n such that 3 does not divide swing(n) = A056040(n).

Original entry on oeis.org

0, 1, 2, 6, 7, 8, 18, 19, 20, 24, 25, 26, 54, 55, 56, 60, 61, 62, 72, 73, 74, 78, 79, 80, 162, 163, 164, 168, 169, 170, 180, 181, 182, 186, 187, 188, 216, 217, 218, 222, 223, 224, 234, 235, 236, 240, 241, 242, 486, 487, 488, 492, 493, 494, 504, 505, 506, 510
Offset: 1

Views

Author

Peter Luschny, Oct 06 2011

Keywords

Crossrefs

Programs

  • Maple
    SwingExp := proc(m,n) local p, q; p := m;
    do q := iquo(n,p);
       if (q mod 2) = 1 then RETURN(1) fi;
       if q = 0 then RETURN(0) fi;
       p := p * m;
    od end:
    Search := proc(n,L) local m, i, r; m := n;
    for i in L do r := SwingExp(i,m);
       if r <> 0 then RETURN(NULL) fi
    od; n end:
    A196747_list := n -> Search(n,[3]):  # n is a search limit
  • Mathematica
    (* A naive solution *) sf[n_] := n!/Quotient[n, 2]!^2; Select[Range[0, 600], ! Divisible[sf[#], 3] &] (* Jean-François Alcover, Jun 28 2013 *)
  • PARI
    valp(n,p)=my(s); while(n\=p, s+=n); s
    is(n)=my(t=valp(n,3)); t%2==0 && 2*valp(n\2,3)==t \\ Charles R Greathouse IV, Feb 02 2016
Previous Showing 11-20 of 146 results. Next