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 21-30 of 544 results. Next

A378162 Number k such that !k = A000166(k) is squarefree.

Original entry on oeis.org

0, 2, 3, 6, 8, 11, 14, 15, 18, 20, 24, 27, 30, 32, 35, 36, 39, 42, 44, 47, 48, 54, 59, 60, 62, 63, 66, 68, 71, 72, 74, 75, 80, 83, 84, 86, 87, 90, 92, 95, 96, 98, 102, 104, 107, 108, 110, 114, 116
Offset: 1

Views

Author

Amiram Eldar, Nov 18 2024

Keywords

Comments

0 and numbers k such that A378160(k) = A378161(k).
If k is a term, then k-1 is squarefree (since (k-1) | A000166(k)).
a(34) >= 83.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 40], SquareFreeQ[Subfactorial[#]] &]
  • PARI
    lista(kmax) = {my(s = 0); print1(0, ", "); for(k = 2, kmax, s = k * s + (-1)^k; if(issquarefree(s), print1(k, ", ")));}

Extensions

a(34)-a(49) from Jinyuan Wang, Nov 25 2024

A065088 a(n) = A000166(n)*binomial(n,2).

Original entry on oeis.org

0, 0, 1, 6, 54, 440, 3975, 38934, 415324, 4805856, 60073245, 807651350, 11630179506, 178681848696, 2918470195459, 50511984152070, 923647710209400, 17795612550034304, 360361154138194809, 7652375096699313126, 170052779926651402990, 3947014523560698353400
Offset: 0

Views

Author

N. J. A. Sloane, Nov 10 2001

Keywords

Crossrefs

Cf. A000387.

Programs

  • Maple
    with (combstruct):with (combinat):a:=proc(m) [ZL, {ZL=Set(Cycle(Z, card>=m))}, labeled]; end: ZLL:=a(2):seq(count(ZLL, size=n)*binomial(n,2), n=0..21); # Zerinvary Lajos, Jun 11 2008
  • Mathematica
    Table[Subfactorial[n]*Binomial[n, 2], {n, 0, 22}] (* Zerinvary Lajos, Jul 09 2009 *)

A109742 a(n) = d(n-1) + d(n-2) + (n-1)[d(n-2) + 2d(n-3) + d(n-4)], where d(n), the derangement numbers, are given in A000166. (Let d(n) = 0 if n < 0.)

Original entry on oeis.org

1, 2, 5, 9, 27, 123, 693, 4653, 36111, 317583, 3118617, 33804177, 400755267, 5156954019, 71572594557, 1065571143093, 16938122939703, 286298719063863, 5127206924693601, 96975312507734553, 1931609062232400747, 40414621201681598667, 886153986344092389957
Offset: 1

Views

Author

N. J. A. Sloane, Aug 13 2005

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[2] = 2; a[3] = 5; a[n_] := a[n] = ((2*n^3 - 27*n^2 + 115*n - 150)*a[n - 3] + (2*n^3 - 23*n^2 + 85*n - 100)*a[n - 2] + 3*(2*n - 9)*a[n - 1])/(2*n - 9); Table[a[n], {n, 1, 23}]
    (* or: *)
    d[n_] := If[n < 0, 0, Subfactorial[n]]; Table[(n - 1)*(d[n - 4] + 2*d[n - 3] + d[n - 2]) + d[n - 2] + d[n - 1], {n, 1, 23}](* Jean-François Alcover, Nov 03 2016 *)
  • PARI
    d(n)=if(n>0, n!\/exp(1), n==0)
    a(n)=d(n-1) + d(n-2) + (n-1)*(d(n-2) + 2*d(n-3) + d(n-4)) \\ Charles R Greathouse IV, Nov 03 2016

A131631 Supersubfactorials: partial product of positive subfactorials (A000166).

Original entry on oeis.org

1, 2, 18, 792, 209880, 389117520, 5771780174160, 770509566129663360, 1028600220910021528728960, 15104551945968674840127424147200, 2661646219535110627933754465838408595200
Offset: 2

Views

Author

Jonathan Vos Post, Sep 01 2007

Keywords

Comments

This is to subfactorials (A000166, rencontres numbers, or derangements) as superfactorials (A000178) are to factorials (A000142).

Examples

			a(2) = 1.
a(3) = 1 * 2 = 2.
a(4) = 1 * 2 * 9 = 18 = 2 * 3^2.
a(5) = 1 * 2 * 9 * 44 = 792 = 2^3 * 3^2 * 11.
a(6) = 1 * 2 * 9 * 44 * 265 = 209880 = 2^3 * 3^2 * 5 * 11 * 53.
a(7) = 1 * 2 * 9 * 44 * 265 * 1854 = 389117520 = 2^4 * 3^4 * 5 * 11 * 53 * 103.
		

Crossrefs

Programs

  • Mathematica
    Table[Product[k!*Sum[(-1)^j/j!, {j,0,k}], {k,2,n}], {n,2,15}] (* Vaclav Kotesovec, Jul 11 2015 *)

Formula

a(n) = Product_{k=2..n} A000166(k).
a(n) ~ c * n^(n^2/2 + n + 5/12) * (2*Pi)^((n+1)/2) / (A * exp(3*n^2/4 + 2*n - 13/12)), where A = A074962 = 1.2824271291... is the Glaisher-Kinkelin constant and c = 1.2517384488693662195086340541087053383189277225386098721341690164735... . - Vaclav Kotesovec, Jul 11 2015

A156788 Triangle T(n, k) = binomial(n, k)*A000166(n-k)*k^n with T(0, 0) = 1, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 0, 4, 0, 3, 0, 27, 0, 8, 96, 0, 256, 0, 45, 640, 2430, 0, 3125, 0, 264, 8640, 29160, 61440, 0, 46656, 0, 1855, 118272, 688905, 1146880, 1640625, 0, 823543, 0, 14832, 1899520, 16166304, 41287680, 43750000, 47029248, 0, 16777216, 0, 133497, 34172928, 438143580, 1453326336, 2214843750, 1693052928, 1452729852, 0, 387420489
Offset: 0

Views

Author

Roger L. Bagula, Feb 15 2009

Keywords

Examples

			Triangle begins as:
  1;
  0,     1;
  0,     0,       4;
  0,     3,       0,       27;
  0,     8,      96,        0,      256;
  0,    45,     640,     2430,        0,     3125;
  0,   264,    8640,    29160,    61440,        0,    46656;
  0,  1855,  118272,   688905,  1146880,  1640625,        0, 823543;
  0, 14832, 1899520, 16166304, 41287680, 43750000, 47029248,      0, 16777216;
		

References

  • J. Riordan, Combinatorial Identities, Wiley, 1968, p.194.

Crossrefs

Programs

  • Mathematica
    A000166[n_]:= A000166[n]= If[n==0, 1, n*A000166[n-1] + (-1)^n];
    T[n_, k_]:= If[n==0, 1, Binomial[n, k]*A000166[n-k]*k^n];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* modified by G. C. Greubel, Jun 10 2021 *)
  • Sage
    def A000166(n): return 1 if (n==0) else n*A000166(n-1) + (-1)^n
    def A156788(n,k): return 1 if (n==0) else binomial(n,k)*k^n*A000166(n-k)
    flatten([[A156788(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jun 10 2021

Formula

T(n, k) = binomial(n, k)*A000166(n-k)*k^n with T(0, 0) = 1.
T(n, k) = binomial(n, k)*b(n-k)*k^n, where b(n) = n*b(n-1) + (-1)^n and b(0) = 1.
Sum_{k=0..n} T(n, k) = A137341(n).
From G. C. Greubel, Jun 10 2021: (Start)
T(n, 1) = A000240(n).
T(n, n) = A000312(n). (End)

Extensions

Edited by G. C. Greubel, Jun 10 2021

A260656 a(n) = lcm{!2, !3, ..., !n}, where !n = A000166(n) is subfactorial.

Original entry on oeis.org

1, 2, 18, 396, 104940, 10808820, 160327227060, 486432806900040, 72152091814676033160, 105952244289903723626034120, 1697305261921685687642685992397720, 108004858262683508632706244802225075247640, 266448824855803491635798907952730108331437779905720
Offset: 2

Views

Author

Vladimir Reshetnikov, Nov 13 2015

Keywords

Comments

a(n) <= A131631(n).

Examples

			For n = 5, a(5) = lcm(!2, !3, !4, !5) = lcm(1, 2, 9, 44) = 396.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember;
         `if`(n=0, 1, n*b(n-1)+(-1)^n)
        end:
    a:= n-> ilcm(seq(b(i), i=2..n)):
    seq(a(n), n=2..15);  # Alois P. Heinz, May 08 2020
  • Mathematica
    LCM@@@Subfactorial@Range[2, Range[2, 14]]
  • PARI
    a(n) = lcm(vector(n-1, k, if(k+1,round((k+1)!/exp(1)),1))); \\ Altug Alkan, Nov 13 2015

A272988 Convolution of the sequence of derangement numbers A000166 with itself.

Original entry on oeis.org

1, 0, 2, 4, 19, 92, 552, 3832, 30453, 272552, 2713710, 29752156, 356133959, 4620985700, 64600445812, 967927029168, 15473320537001, 262864036323600, 4728905854617562, 89808092596277364, 1795480569403712699, 37693097921348983852, 829024574048725950016, 19063166411687276701736
Offset: 0

Views

Author

J. C. George, May 12 2016

Keywords

Examples

			For n = 4, we get 1*9 + 0*2 + 1*1 + 2*0 + 9*1 = 19.
		

Crossrefs

Cf. A000166.

Programs

  • Mathematica
    Table[Sum[Subfactorial[k] Subfactorial[n - k], {k, 0, n}], {n, 0, 30}] (* Emanuele Munarini, Oct 06 2017 *)

Formula

a(n) = Sum_{i=0..n} A000166(i)*A000166(n-i).
G.f.: ( 1/(1 + x) + Sum_{k>=1} k^k*x^k/(1 + (k + 1)*x)^(k+1) )^2. - Ilya Gutkovskiy, Apr 13 2017
a(n) ~ 2*exp(-1)*n!. - Vaclav Kotesovec, Apr 13 2017

A281682 Decimal expansion of Sum_{n>=2} 1/A000166(n).

Original entry on oeis.org

1, 6, 3, 8, 2, 2, 7, 0, 7, 4, 5, 0, 5, 3, 7, 0, 6, 4, 7, 5, 4, 2, 8, 9, 3, 1, 1, 4, 1, 5, 1, 1, 2, 2, 6, 6, 1, 0, 6, 3, 5, 9, 3, 2, 4, 9, 6, 4, 4, 4, 3, 6, 1, 6, 4, 7, 2, 3, 2, 6, 2, 8, 2, 8, 7, 2, 6, 3, 0, 5, 8, 2, 9, 4, 4, 0, 6, 8, 2, 2, 3, 9, 8, 1, 8, 3, 0, 3, 9, 5, 6, 7, 2, 0, 7, 3, 2, 9, 9, 6, 0, 9, 1, 0, 8, 1, 3, 9, 0, 9, 1, 5, 3
Offset: 1

Views

Author

Keywords

Examples

			1.63822707450537064754289311415112266106359324964443616472326282872630582...
		

Crossrefs

Cf. A000166.

Programs

  • Derive
    PrecisionDigits ≔ 1000
    NotationDigits ≔ 1000
    sum(1/ROUND(n!/e), n, 2, 500)
  • Mathematica
    a[n_]:=If[n>0, Round[n!/E], 1]; RealDigits[Sum[1/a[n], {n, 2, 500}], 10, 113][[1]](* Indranil Ghosh, Mar 12 2017 *)

Formula

Equals Sum_{n>=2} 1/round(n!/e).

A295165 Numbers n such that !n and n!! (A000166(n) and A006882(n)) are coprime.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 12, 14, 17, 18, 20, 24, 30, 32, 33, 44, 48, 54, 62, 65, 68, 72, 74, 80, 84, 98, 102, 110, 114, 128, 140, 150, 158, 168, 180, 182, 198, 200, 212, 224, 228, 230, 234, 252, 257, 264, 270, 272, 278, 282, 308, 312, 314, 318, 332, 348, 354, 374, 380, 384, 402, 410, 420, 422, 432
Offset: 1

Views

Author

Robert Israel, Nov 16 2017

Keywords

Comments

Odd n is in the sequence iff !n is not divisible by any odd primes < n.
Even n is in the sequence iff !n is not divisible by any odd primes < n/2.
All odd terms are in A083318, all even terms > 2 are in A008864, but both of these are strict inclusions.
Odd terms include 1,3,5,9,17,33,65,257,513,32769.

Examples

			!5 = 44 and 5!! = 15 are coprime so 5 is in the sequence.
		

Crossrefs

Programs

  • Maple
    sf:= proc(n) option remember; n*procname(n-1)+(-1)^n end proc:
    sf(0):= 1:
    select(n -> igcd(sf(n),doublefactorial(n))=1, [$0..1000]);
  • Mathematica
    Select[Range[0, 1000], CoprimeQ[Subfactorial[#], #!!]&] (* Jean-François Alcover, Oct 16 2020 *)

A371998 a(n) = A000166(floor(n/2)) if n is even otherwise A000240(floor((n + 1)/2)).

Original entry on oeis.org

1, 1, 0, 0, 1, 3, 2, 8, 9, 45, 44, 264, 265, 1855, 1854, 14832, 14833, 133497, 133496, 1334960, 1334961, 14684571, 14684570, 176214840, 176214841, 2290792933, 2290792932, 32071101048, 32071101049, 481066515735, 481066515734, 7697064251744, 7697064251745
Offset: 0

Views

Author

Peter Luschny, Apr 25 2024

Keywords

Crossrefs

Programs

  • Maple
    a := n -> if irem(n,2) = 0 then A000166(iquo(n,2)) else A000240(iquo(n+1,2)) fi:
    seq(a(n), n = 0..32);
  • Python
    from functools import cache
    @cache
    def sf(n):
        if n == 0: return 1
        return n * sf(n - 1) + (-1 if n % 2 else 1)
    def a(n):
        h, r = divmod(n, 2)
        return sf(h) * (h + 1) if r else sf(h)
    print([a(n) for n in range(33)])
Previous Showing 21-30 of 544 results. Next