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-10 of 50 results. Next

A122018 Modulo 2 recursion switch between A000898 and A121966: A000898 first.

Original entry on oeis.org

1, 2, 6, 2, 40, 32, 464, 272, 7040, 4864, 136448, 87808, 3177472, 2123776, 86861824, 57128960, 2720112640, 1806049280, 96095928320, 63587041280, 3778819358720, 2507078533120, 163724570132480, 108568842403840, 7748467910901760
Offset: 0

Views

Author

Roger L. Bagula, Sep 11 2006

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember; if n::odd then procname(n-1)-(n-1)*procname(n-2) else 2*procname(n-1)+2*(n-1)*procname(n-2) fi end proc:
    f(0):= 1: f(1):= 2:
    map(f, [$0..50]); # Robert Israel, Jun 20 2018
  • Mathematica
    a[0] = 1; a[1] = 2; a[n_] := a[n] = If[Mod[n, 2] == 1, a[n - 1] - (n - 1)*a[n - 2], 2*(a[n - 1] + (n - 1)*a[n - 2])] b = Table[a[n], {n, 0, 30}]

Formula

For n>=2, a(n) = a(n-1) - (n-1)*a(n-2) if n is odd, a(n) = 2*a(n-1) + 2*(n-1)*a(n-2) if n is even. - Edited by Robert Israel, Jun 20 2018

Extensions

Offset changed by Robert Israel, Jun 20 2018

A047974 a(n) = a(n-1) + 2*(n-1)*a(n-2).

Original entry on oeis.org

1, 1, 3, 7, 25, 81, 331, 1303, 5937, 26785, 133651, 669351, 3609673, 19674097, 113525595, 664400311, 4070168161, 25330978113, 163716695587, 1075631907655, 7296866339961, 50322142646161, 356790528924523, 2570964805355607, 18983329135883665, 142389639792952801, 1091556096587136051
Offset: 0

Views

Author

Keywords

Comments

Related to partially ordered sets. - Detlef Pauly (dettodet(AT)yahoo.de), Sep 25 2003
The number of partial permutation matrices P in GL_n with P^2=0. Alternatively, the number of orbits of the Borel group of upper triangular matrices acting by conjugation on the set of matrices M in GL_n with M^2=0. - Brian Rothbach (rothbach(AT)math.berkeley.edu), Apr 16 2004
Number of ways to use the elements of {1..n} once each to form a collection of sequences, each having length 1 or 2. - Bob Proctor, Apr 18 2005
Hankel transform is A108400. - Paul Barry, Feb 11 2008
This is also the number of subsets of equivalent ways to arrange the elements of n pairs, when equivalence is defined under the joint operation of (optional) reversal of elements combined with permutation of the labels and the subset maps to itself. - Ross Drewe, Mar 16 2008
Equals inverse binomial transform of A000898. - Gary W. Adamson, Oct 06 2008
a(n) is also the moment of order n for the measure of density exp(-(x-1)^2/4)/(2*sqrt(Pi)) over the interval -oo..oo. - Groux Roland, Mar 26 2011
The n-th term gives the number of fixed-point-free involutions in S_n^B, the group of permutations on the set {-n,...,-1,1,2,...,n}. - Matt Watson, Jul 26 2012
From Peter Bala, Dec 03 2017: (Start)
a(n+k) == a(n) (mod k) for all n and k. Hence for each k, the sequence a(n) taken modulo k is a periodic sequence and the exact period divides k. Cf. A115329.
More generally, the same divisibility property holds for any sequence with an e.g.f. of the form F(x)*exp(x*G(x)), where F(x) and G(x) are power series with integer coefficients and G(0) = 1. See the Bala link for a proof. (End)

Crossrefs

Row sums of A067147.
Column k=2 of A359762.
Sequences with e.g.f = exp(x + q*x^2): A158968 (q=-9), A158954 (q=-4), A362177 (q=-3), A362176 (q=-2), A293604 (q=-1), A000012 (q=0), this sequence (q=1), A115329 (q=2), A293720 (q=4).

Programs

  • MATLAB
    N = 18; A = zeros(N,1); for n = 1:N; a = factorial(n); s = 0; k = 0; while k <= floor(n/2); b = factorial(n - 2*k); c = factorial(k); s = s + a/(b*c); k = k+1; end; A(n) = s; end; disp(A); % Ross Drewe, Mar 16 2008
    
  • Magma
    [n le 2 select 1 else Self(n-1) + 2*(n-2)*Self(n-2): n in [1..40]]; // G. C. Greubel, Jul 12 2024
    
  • Maple
    seq( add(n!/((n-2*k)!*k!), k=0..floor(n/2)), n=0..30 ); # Detlef Pauly (dettodet(AT)yahoo.de), Nov 15 2001
    with(combstruct):seq(count(([S,{S=Set(Union(Z,Prod(Z,Z)))},labeled],size=n)),n=0..30); # Detlef Pauly (dettodet(AT)yahoo.de), Sep 25 2003
    A047974 := n -> I^(-n)*orthopoly[H](n, I/2):
    seq(A047974(n), n=0..26); # Peter Luschny, Nov 29 2017
  • Mathematica
    Range[0, 23]!*CoefficientList[ Series[ Exp[x*(1-x^2)/(1 - x)], {x, 0,23 }], x] - (* Zerinvary Lajos, Mar 23 2007 *)
    Table[I^(-n)*HermiteH[n, I/2], {n, 0, 23}] - (* Alyssa Byrnes and C. Vignat, Jan 31 2013 *)
  • PARI
    my(x='x+O('x^66)); Vec(serlaplace(exp(x^2+x))) \\ Joerg Arndt, May 04 2013
    
  • SageMath
    [(-i)^n*hermite(n,i/2) for n in range(41)] # G. C. Greubel, Jul 12 2024

Formula

E.g.f.: exp(x^2+x). - Len Smiley, Dec 11 2001
Binomial transform of A001813 (with interpolated zeros). - Paul Barry, May 09 2003
a(n) = Sum_{k=0..n} C(k,n-k)*n!/k!. - Paul Barry, Mar 29 2007
a(n) = Sum_{k=0..floor(n/2)} C(n,2k)*(2k)!/k!; - Paul Barry, Feb 11 2008
G.f.: 1/(1-x-2*x^2/(1-x-4*x^2/(1-x-6*x^2/(1-x-8*x^2/(1-... (continued fraction). -Paul Barry, Apr 10 2009
E.g.f.: Q(0); Q(k) = 1+(x^2+x)/(2*k+1-(x^2+x)*(2*k+1)/((x^2+x)+(2*k+2)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 24 2011
a(n) = D^n(exp(x)) evaluated at x = 0, where D is the operator sqrt(1+4*x)*d/dx. Cf. A000085 and A115329. - Peter Bala, Dec 07 2011
a(n) ~ 2^(n/2 - 1/2)*exp(sqrt(n/2) - n/2 - 1/8)*n^(n/2). - Vaclav Kotesovec, Oct 08 2012
E.g.f.: 1 + x*(E(0)-1)/(x+1) where E(k) = 1 + (1+x)/(k+1)/(1-x/(x+1/E(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 26 2013
a(n) = i^(-n)*H_{n}(i/2) with i the imaginary unit and H_{n} the Hermite polynomial of degree n. - Alyssa Byrnes and C. Vignat, Jan 31 2013
E.g.f.: -Q(0)/x where Q(k) = 1 - (1+x)/(1 - x/(x - (k+1)/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Mar 06 2013
G.f.: 1/Q(0), where Q(k) = 1 + x*2*k - x/(1 - x*(2*k+2)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 17 2013
E.g.f.: E(0)-1-x-x^2, where E(k) = 2 + 2*x*(1+x) - 8*k^2 + x^2*(1+x)^2*(2*k+3)*(2*k-1)/E(k+1); (continued fraction). - Sergei N. Gladkovskii, Dec 21 2013
E.g.f.: Product_{k>=1} 1/(1 + (-x)^k)^(mu(k)/k). - Ilya Gutkovskiy, May 26 2019
a(n) = Sum_{k=0..floor(n/2)} 2^k*B(n, k), where B are the Bessel numbers A100861. - Peter Luschny, Jun 04 2021

A300121 Number of normal generalized Young tableaux, of shape the integer partition with Heinz number n, with all rows and columns weakly increasing and all regions connected skew partitions.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 8, 4, 11, 12, 16, 12, 32, 28, 31, 8, 64, 31, 128, 33, 82, 64, 256, 28, 69, 144, 69, 86, 512, 105, 1024, 16, 208, 320, 209, 82, 2048, 704, 512, 86, 4096, 318, 8192, 216, 262, 1536, 16384, 64, 465, 262, 1232, 528, 32768, 209, 588, 245, 2912, 3328
Offset: 1

Views

Author

Gus Wiseman, Feb 25 2018

Keywords

Comments

The diagram of a connected skew partition is required to be connected as a polyomino but can have empty rows or columns. A generalized Young tableau of shape y is an array obtained by replacing the dots in the Ferrers diagram of y with positive integers. A tableau is normal if its entries span an initial interval of positive integers. The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			The a(9) = 11 tableaux:
1 1
1 1
.
2 1   1 1   1 1   1 2
1 1   1 2   2 2   1 2
.
1 1   1 2   1 2   1 3
2 3   1 3   3 3   2 3
.
1 2   1 3
3 4   2 4
		

Crossrefs

Programs

  • Mathematica
    undcon[y_]:=Select[Tuples[Range[0,#]&/@y],Function[v,GreaterEqual@@v&&With[{r=Select[Range[Length[y]],y[[#]]=!=v[[#]]&]},Or[Length[r]<=1,And@@Table[v[[i]]Table[PrimePi[p],{k}]]]];
    Table[Length[cos[Reverse[primeMS[n]]]],{n,50}]

A000899 Number of solutions to the rook problem on an n X n board having a certain symmetry group (see Robinson for details).

Original entry on oeis.org

0, 0, 0, 1, 9, 70, 571, 4820, 44676, 450824, 4980274, 59834748, 778230060, 10896609768, 163456629604, 2615335902176, 44460874280032, 800296440705472, 15205636325496568, 304112744618157872, 6386367741011250672
Offset: 1

Views

Author

Keywords

References

  • L. C. Larson, The number of essentially different nonattacking rook arrangements, J. Recreat. Math., 7 (No. 3, 1974), circa pages 180-181.
  • R. W. Robinson, Counting arrangements of bishops, pp. 198-214 of Combinatorial Mathematics IV (Adelaide 1975), Lect. Notes Math., 560 (1976).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000900.

Programs

  • Maple
    For Maple program see A000903.
  • Mathematica
    a[n_] := ((n+1)! - (2*Floor[(n+1)/2])!! - 2*Sum[Binomial[n+1, 2*k]*(2*k-1)!!, {k, 0, (n+1)/2}] + 2*Sum[2^k*BellB[k]*StirlingS1[Floor[(n+1)/2], k], {k, 0, Floor[(n+1)/2]}])/8; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Dec 23 2013, from explicit formulas *)

Formula

a(n)=(A000142(n)-2*A000085(n)-A037223(n)+2*A000898(floor(n/2)))/8 (all of which have explicit formulas).
For asymptotics see the Robinson paper.

Extensions

More terms from Vladeta Jovovic, May 09 2000

A299968 Number of normal generalized Young tableaux of size n with all rows and columns strictly increasing.

Original entry on oeis.org

1, 1, 2, 5, 15, 51, 189, 753, 3248, 14738, 70658, 354178, 1857703, 10121033, 57224955, 334321008, 2017234773, 12530668585, 80083779383, 525284893144, 3533663143981, 24336720018666, 171484380988738, 1234596183001927, 9075879776056533, 68052896425955296
Offset: 0

Views

Author

Gus Wiseman, Feb 26 2018

Keywords

Comments

A generalized Young tableau of shape y is an array obtained by replacing the dots in the Ferrers diagram of y with positive integers. A tableau is normal if its entries span an initial interval of positive integers.

Examples

			The a(4) = 15 tableaux:
1 2 3 4
.
1 2 3   1 2 4   1 3 4   1 2 3   1 2 3
4       3       2       2       3
.
1 2   1 3   1 2
3 4   2 4   2 3
.
1 2   1 3   1 2   1 4   1 3
3     2     2     2     2
4     4     3     3     3
.
1
2
3
4
		

Crossrefs

Programs

  • Mathematica
    unddis[y_]:=DeleteCases[y-#,0]&/@Tuples[Table[If[y[[i]]>Append[y,0][[i+1]],{0,1},{0}],{i,Length[y]}]];
    dos[y_]:=With[{sam=Rest[unddis[y]]},If[Length[sam]===0,If[Total[y]===0,{{}},{}],Join@@Table[Prepend[#,y]&/@dos[sam[[k]]],{k,1,Length[sam]}]]];
    Table[Sum[Length[dos[y]],{y,IntegerPartitions[n]}],{n,1,8}]

Formula

a(n) = Sum_{k=0..n} 2^k * A238121(n,k). - Ludovic Schwob, Sep 23 2023

Extensions

More terms from Ludovic Schwob, Sep 23 2023

A062267 Row sums of (signed) triangle A060821 (Hermite polynomials).

Original entry on oeis.org

1, 2, 2, -4, -20, -8, 184, 464, -1648, -10720, 8224, 230848, 280768, -4978816, -17257600, 104891648, 727511296, -1901510144, -28538404352, 11377556480, 1107214478336, 1759326697472, -42984354695168, -163379084079104
Offset: 0

Views

Author

Wolfdieter Lang, Jun 19 2001

Keywords

Crossrefs

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Exp(x*(2-x)))); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Jun 08 2018
  • Maple
    A062267 := proc(n)
        HermiteH(n,1) ;
        simplify(%) ;
    end proc: # R. J. Mathar, Feb 05 2013
  • Mathematica
    lst={};Do[p=HermiteH[n,1];AppendTo[lst,p],{n,0,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Jun 15 2009 *)
    Table[2^n HypergeometricU[-n/2, 1/2, 1], {n, 0, 23}] (* Benedict W. J. Irwin, Oct 17 2017 *)
    With[{nmax=50}, CoefficientList[Series[Exp[x*(2-x)], {x,0,nmax}],x]* Range[0, nmax]!] (* G. C. Greubel, Jun 08 2018 *)
  • PARI
    x='x+O('x^30); Vec(serlaplace(exp(-x*(x-2)))) \\ G. C. Greubel, Jun 08 2018
    
  • PARI
    a(n) = polhermite(n,1); \\ Michel Marcus, Jun 09 2018
    
  • Python
    from sympy import hermite, Poly
    def a(n): return sum(Poly(hermite(n, x), x).all_coeffs()) # Indranil Ghosh, May 26 2017
    

Formula

a(n) = Sum_{m=0..n} A060821(n, m) = H(n, 1), with the Hermite polynomials H(n, x).
E.g.f.: exp(-x*(x-2)).
a(n) = 2*(a(n - 1) - (n - 1)*a(n - 2)). - Roger L. Bagula, Sep 11 2006
a(n) = 2^n * U(-n/2, 1/2, 1), where U is the confluent hypergeometric function. - Benedict W. J. Irwin, Oct 17 2017
E.g.f.: Product_{k>=1} ((1 + x^k)/(1 - x^k))^(mu(k)/k). - Ilya Gutkovskiy, May 26 2019

A000903 Number of inequivalent ways of placing n nonattacking rooks on n X n board up to rotations and reflections of the board.

Original entry on oeis.org

1, 1, 2, 7, 23, 115, 694, 5282, 46066, 456454, 4999004, 59916028, 778525516, 10897964660, 163461964024, 2615361578344, 44460982752488, 800296985768776, 15205638776753680, 304112757426239984, 6386367801916347184
Offset: 1

Views

Author

Keywords

Examples

			For n=4 the 7 solutions may be taken to be 1234,1243,1324,1423,1432,2143,2413.
		

References

  • L. C. Larson, The number of essentially different nonattacking rook arrangements, J. Recreat. Math., 7 (No. 3, 1974), circa pages 180-181.
  • R. C. Read, personal communication.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Z. Stankova and J. West, A new class of Wilf-equivalent permutations, J. Algeb. Combin., 15 (2002), 271-290.

Crossrefs

Programs

  • Maple
    Maple programs for A000142, A037223, A122670, A001813, A000085, A000898, A000407, A000902, A000900, A000901, A000899, A000903
    P:=n->n!; # Gives A000142
    G:=proc(n) local k; k:=floor(n/2); k!*2^k; end; # Gives A037223, A000165
    R:=proc(n) local m; if n mod 4 = 2 or n mod 4 = 3 then RETURN(0); fi; m:=floor(n/4); (2*m)!/m!; end; # Gives A122670, A001813
    unprotect(D); D:=proc(n) option remember; if n <= 1 then 1 else D(n-1)+(n-1)*D(n-2); fi; end; # Gives A000085
    B:=proc(n) option remember; if n <= 1 then RETURN(1); fi; if n mod 2 = 1 then RETURN(B(n-1)); fi; 2*B(n-2) + (n-2)*B(n-4); end; # Gives A000898 (doubled up)
    rho:=n->R(n)/2; # Gives A000407, aerated
    beta:=n->B(n)/2; # Gives A000902, doubled up
    delta:=n->(D(n)-B(n))/2; # Gives A000900
    unprotect(gamma); gamma:=n-> if n <= 1 then RETURN(0) else (G(n)-B(n)-R(n))/4; fi; # Gives A000901, doubled up
    alpha:=n->P(n)/8-G(n)/8+B(n)/4-D(n)/4; # Gives A000899
    unprotect(sigma); sigma:=n-> if n <= 1 then RETURN(1); else P(n)/8+G(n)/8+R(n)/4+D(n)/4; fi; #Gives A000903
  • Mathematica
    c[n_] := Floor[n/2]! 2^Floor[n/2];
    r[n_] := If[Mod[n, 4] > 1, 0, m = Floor[n/4]; If[m == 0, 1, (2 m)!/m!]];
    d[0] = d[1] = 1; d[n_] := d[n] = (n - 1)d[n - 2] + d[n - 1];
    a[1] = 1; a[n_] := (n! + c[n] + 2 r[n] + 2 d[n])/8;
    Array[a, 21] (* Jean-François Alcover, Apr 06 2011, after Matthias Engelhardt, further improved by Robert G. Wilson v *)

Formula

If n>1 then a(n) = 1/8 * (F(n) + C(n) + 2 * R(n) + 2 * D(n)), where F(n) = A000142(n) [all solutions, i.e., factorials], C(n) = A037223(n) [central symmetric solutions], R(n) = A037224(n) [rotationally symmetric solutions] and D(n) = A000085(n) [symmetric solutions by reflection at a diagonal]. - Matthias Engelhardt, Apr 05 2000
For asymptotics see the Robinson paper.

Extensions

More terms from David W. Wilson, Jul 13 2003

A000900 Number of solutions to the rook problem on an n X n board having a certain symmetry group (see Robinson for details).

Original entry on oeis.org

0, 0, 0, 1, 2, 10, 28, 106, 344, 1272, 4592, 17692, 69384, 283560, 1191984, 5171512, 23087168, 105883456, 498572416, 2404766224, 11878871456, 59975885856, 309439708352, 1628919330208, 8746079933568, 47840206525056
Offset: 0

Views

Author

Keywords

References

  • L. C. Larson, The number of essentially different nonattacking rook arrangements, J. Recreat. Math., 7 (No. 3, 1974), circa pages 180-181.
  • R. W. Robinson, Counting arrangements of bishops, pp. 198-214 of Combinatorial Mathematics IV (Adelaide 1975), Lect. Notes Math., 560 (1976).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

  • Maple
    For Maple program see A000903.
  • Mathematica
    a85[n_] := Sum[ (2k)!/k!/2^k Binomial[n, 2k], {k, 0, n/2}]; a898[n_] := Sum[ 2^k*StirlingS1[n, k]*BellB[k], {k, 0, n}]; a[n_] := (a85[n] - a898[Floor[n/2]])/2; a[1] = 0; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Dec 13 2011, after formula *)

Formula

a(n)=(A000085(n)-A000898(int(n/2)))/2
For asymptotics see the Robinson paper.

Extensions

More terms from Vladeta Jovovic, May 09 2000

A300788 Number of strict integer partitions of n in which the even parts appear as often at even positions as at odd positions.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 19, 23, 26, 30, 35, 42, 47, 54, 62, 73, 82, 94, 107, 124, 139, 158, 179, 206, 230, 260, 293, 334, 372, 420, 470, 532, 591, 664, 740, 835, 924, 1034, 1148, 1288, 1422, 1588, 1756, 1962, 2161, 2404
Offset: 0

Views

Author

Gus Wiseman, Mar 12 2018

Keywords

Examples

			The a(9) = 3 strict partitions: (9), (621), (531). Missing are: (81), (72), (63), (54), (432).
		

Crossrefs

Programs

  • Mathematica
    cobal[y_]:=Sum[(-1)^x,{x,Join@@Position[y,_?EvenQ]}];
    Table[Length[Select[IntegerPartitions[n],cobal[#]===0&&UnsameQ@@#&]],{n,0,40}]

Extensions

a(41)-a(58) from Alois P. Heinz, Mar 13 2018

A300060 Number of domino tilings of the diagram of the integer partition with Heinz number n.

Original entry on oeis.org

1, 0, 1, 1, 0, 0, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 2, 1, 0, 0, 3, 0, 3, 1, 1, 0, 0, 0, 0, 1, 0, 2, 1, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 5, 0, 0, 1, 1, 0, 3, 0, 2, 0, 0, 0, 1, 1, 3, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 4, 1, 0, 0, 1, 0, 5, 1, 0, 2, 3, 0, 2, 1, 1, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Feb 23 2018

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Crossrefs

Programs

  • Maple
    h:= proc(l, f) option remember; local k; if min(l[])>0 then
         `if`(nops(f)=0, 1, h(map(x-> x-1, l[1..f[1]]), subsop(1=[][], f)))
        else for k from nops(l) while l[k]>0 by -1 do od;
            `if`(nops(f)>0 and f[1]>=k, h(subsop(k=2, l), f), 0)+
            `if`(k>1 and l[k-1]=0, h(subsop(k=1, k-1=1, l), f), 0)
          fi
        end:
    g:= l-> `if`(add(`if`(l[i]::odd, (-1)^i, 0), i=1..nops(l))=0,
            `if`(l=[], 1, h([0$l[1]], subsop(1=[][], l))), 0):
    a:= n-> g(sort(map(i-> numtheory[pi](i[1])$i[2], ifactors(n)[2]), `>`)):
    seq(a(n), n=1..120);  # Alois P. Heinz, May 22 2018
  • Mathematica
    h[l_, f_] := h[l, f] = Module[{k}, If[Min[l] > 0, If[Length[f] == 0, 1, h[Map[Function[x, x-1], l[[Range @ f[[1]]]]], ReplacePart[f, 1 -> Nothing]]], For[k = Length[l], l[[k]] > 0, k-- ]; If[Length[f] > 0 && f[[1]] >= k, h[ReplacePart[l, k -> 2], f], 0] + If[k > 1 && l[[k-1]] == 0, h[ReplacePart[l, {k -> 1, k - 1 -> 1}], f], 0]]];
    g[l_] := If[Sum[If[OddQ @ l[[i]], (-1)^i, 0], {i, 1, Length[l]}] == 0, If[l == {}, 1, h[Table[0, l[[1]]], ReplacePart[l, 1 -> Nothing]]], 0];
    a[n_] := g[Reverse @ Sort[ Flatten[ Map[ Function[i, Table[PrimePi[i[[1]]], i[[2]]]], FactorInteger[n]]]]];
    Array[a, 120] (* Jean-François Alcover, May 28 2018, after Alois P. Heinz *)
Showing 1-10 of 50 results. Next