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 25 results. Next

A325698 Numbers with as many even as odd prime indices, counted with multiplicity.

Original entry on oeis.org

1, 6, 14, 15, 26, 33, 35, 36, 38, 51, 58, 65, 69, 74, 77, 84, 86, 90, 93, 95, 106, 119, 122, 123, 141, 142, 143, 145, 156, 158, 161, 177, 178, 185, 196, 198, 201, 202, 209, 210, 214, 215, 216, 217, 219, 221, 225, 226, 228, 249, 262, 265, 278, 287, 291, 299
Offset: 1

Views

Author

Gus Wiseman, May 17 2019

Keywords

Comments

These are Heinz numbers of the integer partitions counted by A045931.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
The integers in the multiplicative subgroup of positive rational numbers generated by the products of two consecutive primes (A006094). The sequence is closed under multiplication, prime shift (A003961), and - where the result is an integer - under division. Using these closures, all the terms can be derived from the presence of 6. For example, A003961(6) = 15, A003961(15) = 35, 6 * 35 = 210, 210/15 = 14. Closed also under A297845, since A297845 can be defined using squaring, prime shift and multiplication. - Peter Munn, Oct 05 2020

Examples

			The sequence of terms together with their prime indices begins:
    1: {}
    6: {1,2}
   14: {1,4}
   15: {2,3}
   26: {1,6}
   33: {2,5}
   35: {3,4}
   36: {1,1,2,2}
   38: {1,8}
   51: {2,7}
   58: {1,10}
   65: {3,6}
   69: {2,9}
   74: {1,12}
   77: {4,5}
   84: {1,1,2,4}
   86: {1,14}
   90: {1,2,2,3}
   93: {2,11}
   95: {3,8}
		

Crossrefs

Positions of 0's in A195017.
A257992(n) = A257991(n).
Closed under: A003961, A003991, A297845.
Subsequence of A028260, A332820.

Programs

  • Mathematica
    Select[Range[100],Total[Cases[If[#==1,{},FactorInteger[#]],{p_,k_}:>k*(-1)^PrimePi[p]]]==0&]
  • PARI
    is(n) = {my(v = vector(2), f = factor(n));for(i = 1, #f~,v[1 + primepi(f[i, 1])%2]+=f[i, 2]);v[1] == v[2]} \\ David A. Corneth, Oct 06 2020
    
  • Python
    from sympy import factorint, primepi
    def ok(n):
        v = [0, 0]
        for p, e in factorint(n).items(): v[primepi(p)%2] += e
        return v[0] == v[1]
    print([k for k in range(300) if ok(k)]) # Michael S. Branicky, Apr 16 2022 after David A. Corneth

A045931 Number of partitions of n with equal number of even and odd parts.

Original entry on oeis.org

1, 0, 0, 1, 0, 2, 1, 3, 2, 5, 5, 7, 9, 11, 16, 18, 25, 28, 41, 44, 62, 70, 94, 107, 140, 163, 207, 245, 302, 361, 440, 527, 632, 763, 904, 1090, 1285, 1544, 1812, 2173, 2539, 3031, 3538, 4202, 4896, 5793, 6736, 7934, 9221, 10811, 12549, 14661, 16994, 19780
Offset: 0

Views

Author

Keywords

Comments

The trivariate g.f. with x marking weight (i.e., sum of the parts), t marking number of odd parts and s marking number of even parts, is 1/product((1-tx^(2j-1))(1-sx^(2j)), j=1..infinity). - Emeric Deutsch, Mar 30 2006

Examples

			a(9) = 5 because we have [8,1], [7,2], [6,3], [5,4] and [2,2,2,1,1,1].
From _Gus Wiseman_, Jan 23 2022: (Start)
The a(0) = 1 through a(12) = 9 partitions (A = 10, empty columns indicated by dots):
  ()  .  .  21   .  32   2211   43   3221   54       3322   65       4332
                    41          52   4211   63       4321   74       4431
                                61          72       4411   83       5322
                                            81       5221   92       5421
                                            222111   6211   A1       6321
                                                            322211   6411
                                                            422111   7221
                                                                     8211
                                                                     22221111
(End)
		

Crossrefs

The version for subsets of {1..n} is A001405.
Dominated by A027187 (partitions of even length).
More odd/even parts: A108950/A108949.
More or same number of odd/even parts: A130780/A171966.
The strict case is A239241.
This is column k = 0 of the triangle A240009.
Counting only distinct parts gives A241638, ranked by A325700.
A half-conjugate version is A277579.
These partitions are ranked by A325698.
A000041 counts integer partitions, strict A000009.
A047993 counts balanced partitions, ranked by A106529.
A257991/A257992 count odd/even parts by Heinz number.

Programs

  • Maple
    g:=1/product((1-t*x^(2*j-1))*(1-s*x^(2*j)),j=1..30): gser:=simplify(series(g,x=0,56)): P[0]:=1: for n from 1 to 53 do P[n]:=subs(s=1/t,coeff(gser,x^n)) od: seq(coeff(t*P[n],t),n=0..53); # Emeric Deutsch, Mar 30 2006
  • Mathematica
    p[n_] := p[n] = Select[IntegerPartitions[n], Count[#, ?OddQ] == Count[#, ?EvenQ] &]; t = Table[p[n], {n, 0, 10}] (* partitions of n with # odd parts = # even parts *)
    TableForm[t] (* partitions, vertical format *)
    Table[Length[p[n]], {n, 0, 30}] (* A045931 *)
    (* Peter J. C. Moses, Mar 10 2014 *)
    nmax = 100; CoefficientList[Series[Sum[x^(3*k) / Product[(1 - x^(2*j))^2, {j, 1, k}], {k, 0, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Jun 15 2025 *)

Formula

G.f.: Sum_{k>=0} x^(3*k)/Product_{i=1..k} (1-x^(2*i))^2. - Vladeta Jovovic, Aug 18 2007
a(n) = A000041(n)-A171967(n) = A130780(n)-A108950(n) = A171966(n)-A108949(n). - Reinhard Zumkeller, Jan 21 2010
a(n) = A000041(n) - A108950(n) - A108949(n) = A130780(n) + A171966(n) - A000041(n). - Gus Wiseman, Jan 23 2022
a(n) ~ Pi * exp(Pi*sqrt(2*n/3)) / (48*n^(3/2)). - Vaclav Kotesovec, Jun 15 2025

A051924 a(n) = binomial(2*n,n) - binomial(2*n-2,n-1); or (3n-2)*C(n-1), where C = Catalan numbers (A000108).

Original entry on oeis.org

1, 4, 14, 50, 182, 672, 2508, 9438, 35750, 136136, 520676, 1998724, 7696444, 29716000, 115000920, 445962870, 1732525830, 6741529080, 26270128500, 102501265020, 400411345620, 1565841089280, 6129331763880, 24014172955500, 94163002754652, 369507926510352
Offset: 1

Views

Author

Barry E. Williams, Dec 19 1999

Keywords

Comments

Number of partitions with Ferrers plots that fit inside an n X n box, but not in an n-1 X n-1 box. - Wouter Meeussen, Dec 10 2001
From Benoit Cloitre, Jan 29 2002: (Start)
Let m(1,j)=j, m(i,1)=i and m(i,j) = m(i-1,j) + m(i,j-1); then a(n) = m(n,n):
1 2 3 4 ...
2 4 7 11 ...
3 7 14 25 ...
4 11 25 50 ... (End)
This sequence also gives the number of clusters and non-crossing partitions of type D_n. - F. Chapoton, Jan 31 2005
If Y is a 2-subset of a 2n-set X then a(n) is the number of (n+1)-subsets of X intersecting Y. - Milan Janjic, Nov 18 2007
Prefaced with a 1: (1, 1, 4, 14, 50, ...) and convolved with the Catalan sequence = A097613: (1, 2, 7, 25, 91, ...). - Gary W. Adamson, May 15 2009
Total number of up steps before the second return in all Dyck n-paths. - David Scambler, Aug 21 2012
Conjecture: a(n) mod n^2 = n+2 iff n is an odd prime. - Gary Detlefs, Feb 19 2013
First differences of A000984 and A030662. - J. M. Bergot, Jun 22 2013
From R. J. Mathar, Jun 30 2013: (Start)
Equivalent to the Meeussen comment and the Bergot comment: The array view of A007318 is
1, 1, 1, 1, 1, 1,
1, 2, 3, 4, 5, 6,
1, 3, 6, 10, 15, 21,
1, 4, 10, 20, 35, 56,
1, 5, 15, 35, 70, 126,
1, 6, 21, 56, 126, 252,
and a(n) are the hook sums Sum_{k=0..n} A(n,k) + Sum_{r=0..n-1} A(r,n). (End)
From Gus Wiseman, Apr 12 2019: (Start)
Equivalent to Wouter Meeussen's comment, a(n) is the number of integer partitions (of any positive integer) such that the maximum of the length and the largest part is n. For example, the a(1) = 1 through a(3) = 14 partitions are:
(1) (2) (3)
(11) (31)
(21) (32)
(22) (33)
(111)
(211)
(221)
(222)
(311)
(321)
(322)
(331)
(332)
(333)
(End)
Coxeter-Catalan numbers for Coxeter groups of type D_n [Armstrong]. - N. J. A. Sloane, Mar 09 2022
a(n+1) is the number of ways that a best of n pairs contest with early termination can go. For example, the first stage of an association football (soccer) penalty-kick shoot out has n=5 pairs of shots and there are a(6)=672 distinct ways it can go. For n=2 pairs, writing G for goal and M for miss, and listing the up-to-four shots in chronological order with teams alternating shots, the n(3)=14 possibilities are MMMM, MMMG, MMGM, MMGG, MGM, MGGM, MGGG, GMMM, GMMG, GMG, GGMM, GGMG, GGGM, and GGGG. Not all four shots are taken in two cases because it becomes impossible for one team to overcome the lead of the other team. - Lee A. Newberg, Jul 20 2024

Examples

			Sums of {1}, {2, 1, 1}, {2, 2, 3, 3, 2, 1, 1}, {2, 2, 4, 5, 7, 6, 7, 5, 5, 3, 2, 1, 1}, ...
		

References

  • Drew Armstrong, Generalized Noncrossing Partitions and Combinatorics of Coxeter Groups, Mem. Amer. Math. Soc. 202 (2009), no. 949, x+159. MR 2561274 16; See Table 2.8.

Crossrefs

Left-central elements of the (1, 2)-Pascal triangle A029635.
Column sums of A096771.
Cf. A000108, A024482 (diagonal from 2), A076540 (diagonal from 3), A000124 (row from 2), A004006 (row from 3), A006522 (row from 4).
Cf. A128064; first differences of A000984.
Cf. A097613.

Programs

  • Haskell
    a051924 n = a051924_list !! (n-1)
    a051924_list = zipWith (-) (tail a000984_list) a000984_list
    -- Reinhard Zumkeller, May 25 2013
    
  • Magma
    [Binomial(2*n, n)-Binomial(2*n-2, n-1): n in [1..28]]; // Vincenzo Librandi, Dec 21 2016
  • Maple
    C:= n-> binomial(2*n, n)/(n+1): seq((n+1)*C(n)-n*C(n-1), n=1..25); # Emeric Deutsch, Jan 08 2008
    Z:=(1-z-sqrt(1-4*z))/sqrt(1-4*z): Zser:=series(Z, z=0, 32): seq(coeff(Zser, z, n), n=1..24); # Zerinvary Lajos, Jan 01 2007
    a := n -> 2^(-2+2*n)*GAMMA(-1/2+n)*(3*n-2)/(sqrt(Pi)*GAMMA(1+n)):
    seq(simplify(a(n)), n=1..24); # Peter Luschny, Dec 14 2015
  • Mathematica
    Table[Binomial[2n,n]-Binomial[2n-2,n-1],{n,30}] (* Harvey P. Dale, Jan 15 2012 *)
  • PARI
    a(n)=binomial(2*n,n)-binomial(2*n-2,n-1) \\ Charles R Greathouse IV, Jun 25 2013
    
  • PARI
    {a(n)=polcoeff((1-x) / sqrt(1-4*x +x*O(x^n)) - 1,n)}
    for(n=1,30,print1(a(n),", ")) \\ Paul D. Hanna, Nov 08 2014
    
  • PARI
    {a(n)=polcoeff( sum(m=1, n, x^m * sum(k=0, m, binomial(m, k)^2 * x^k) / (1-x +x*O(x^n))^(2*m)), n)}
    for(n=1, 30, print1(a(n), ", ")) \\ Paul D. Hanna, Nov 08 2014
    
  • Sage
    a = lambda n: 2^(-2+2*n)*gamma(n-1/2)*(3*n-2)/(sqrt(pi)*gamma(1+n))
    [a(n) for n in (1..120)] # Peter Luschny, Dec 14 2015
    

Formula

G.f.: (1-x) / sqrt(1-4*x) - 1. - Paul D. Hanna, Nov 08 2014
G.f.: Sum_{n>=1} x^n/(1-x)^(2*n) * Sum_{k=0..n} C(n,k)^2 * x^k. - Paul D. Hanna, Nov 08 2014
a(n+1) = binomial(2*n, n) + 2*Sum_{i=0..n-1} binomial(n+i, i) (V's in Pascal's Triangle). - Jon Perry Apr 13 2004
a(n) = n*C(n-1) - (n-1)*C(n-2), where C(n) = A000108(n) = Catalan(n). For example, a(5) = 50 = 5*C(4) - 4*C(3) - 5*14 - 3*5 = 70 - 20. Triangle A128064 as an infinite lower triangular matrix * A000108 = A051924 prefaced with a 1: (1, 1, 4, 14, 50, 182, ...). - Gary W. Adamson, May 15 2009
Sum of 3 central terms of Pascal's triangle: 2*C(2+2*n, n)+C(2+2*n, 1+n). - Zerinvary Lajos, Dec 20 2005
a(n+1) = A051597(2n,n). - Philippe Deléham, Nov 26 2006
The sequence 1,1,4,... has a(n) = C(2*n,n)-C(2*(n-1),n-1) = 0^n+Sum_{k=0..n} C(n-1,k-1)*A002426(k), and g.f. given by (1-x)/(1-2*x-2*x^2/(1-2*x-x^2/(1-2*x-x^2/(1-2*x-x^2/(1-.... (continued fraction). - Paul Barry, Oct 17 2009
a(n) = (3*n-2)*(2*n-2)!/(n*(n-1)!^2) = A001700(n) + A001791(n-1). - David Scambler, Aug 21 2012
D-finite with recurrence: a(n) = 2*(3*n-2)*(2*n-3)*a(n-1)/(n*(3*n-5)). - Alois P. Heinz, Apr 25 2014
a(n) = 2^(-2+2*n)*Gamma(-1/2+n)*(3*n-2)/(sqrt(Pi)*Gamma(1+n)). - Peter Luschny, Dec 14 2015
a(n) ~ (3/4)*4^n*(1-(7/24)/n-(7/128)/n^2-(85/3072)/n^3-(581/32768)/n^4-(2611/262144)/n^5)/sqrt(n*Pi). - Peter Luschny, Dec 16 2015
E.g.f.: ((1 - x)*BesselI(0,2*x) + x*BesselI(1,2*x))*exp(2*x) - 1. - Ilya Gutkovskiy, Dec 20 2016
a(n) = 2 * A097613(n) for n > 1. - Bruce J. Nicholson, Jan 06 2019
Sum_{n>=1} a(n)/8^n = 7/(4*sqrt(2)) - 1. - Amiram Eldar, May 06 2023

Extensions

Edited by N. J. A. Sloane, May 03 2008, at the suggestion of R. J. Mathar

A063886 Number of n-step walks on a line starting from the origin but not returning to it.

Original entry on oeis.org

1, 2, 2, 4, 6, 12, 20, 40, 70, 140, 252, 504, 924, 1848, 3432, 6864, 12870, 25740, 48620, 97240, 184756, 369512, 705432, 1410864, 2704156, 5408312, 10400600, 20801200, 40116600, 80233200, 155117520, 310235040, 601080390, 1202160780, 2333606220, 4667212440
Offset: 0

Views

Author

Henry Bottomley, Aug 28 2001

Keywords

Comments

A Chebyshev transform of A007877(n+1). The g.f. is transformed to (1+x)/((1-x)(1+x^2)) under the mapping G(x)->(1/(1+x^2))G(1/(1+x^2)). - Paul Barry, Oct 12 2004
a(n-1) = 2*C(n-2, floor((n-2)/2)) is also the number of bit strings of length n in which the number of 00 substrings is equal to the number of 11 substrings. For example, when n = 4 we have 4 such bit strings: 0011, 0101, 1010, and 1100. - Angel Plaza, Apr 23 2009
Hankel transform is A120617. - Paul Barry, Aug 10 2009
The Hankel transform of a(n) is (-2)^C(n+1,2). The Hankel transform of (-1)^C(n+1,2)*a(n) is (-1)^C(n+1,2)*A164584(n). - Paul Barry, Aug 17 2009
For n > 1, a(n) is also the number of n-step walks starting from the origin and returning to it exactly once. - Geoffrey Critzer, Jan 24 2010
-a(n) is the Z-sequence for the Riordan array A130777. (See the W. Lang link under A006232 for A- and Z-sequences for Riordan matrices). - Wolfdieter Lang, Jul 12 2011
Number of subsets of {1,...,n} in which the even elements appear as often at even positions as at odd positions. - Gus Wiseman, Mar 17 2018

Examples

			a(4) = 6 because there are six length four walks that do not return to the origin: {-1, -2, -3, -4}, {-1, -2, -3, -2}, {-1, -2, -1, -2}, {1, 2, 1, 2}, {1, 2, 3, 2}, {1, 2, 3, 4}. There are also six such walks that return exactly one time: {-1, -2, -1, 0}, {-1, 0, -1, -2}, {-1, 0, 1, 2}, {1, 0, -1, -2}, {1, 0, 1, 2}, {1, 2, 1, 0}. - _Geoffrey Critzer_, Jan 24 2010
The a(5) = 12 subsets in which the even elements appear as often at even positions as at odd positions: {}, {1}, {3}, {5}, {1,3}, {1,5}, {2,4}, {3,5}, {1,2,4}, {1,3,5}, {2,4,5}, {1,2,4,5}. - _Gus Wiseman_, Mar 17 2018
		

Crossrefs

Programs

  • Magma
    [1] cat [2*Binomial(n-1, Floor((n-1)/2)): n in [1..40]]; // G. C. Greubel, Jun 07 2023
    
  • Maple
    seq(seq(binomial(2*j,j)*i, i=1..2),j=0..16); # Zerinvary Lajos, Apr 28 2007
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n+1,
           4*a(n-2) +2*(a(n-1) -4*a(n-2))/n)
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 10 2014
    # third program:
    A063886 := series(BesselI(0, 2*x)*(1 + x*2 + x*Pi*StruveL(1, 2*x)) - Pi*x*BesselI(1, 2*x)*StruveL(0, 2*x), x = 0, 34): seq(n!*coeff(A063886, x, n), n = 0 .. 33); # Mélika Tebni, Jun 17 2024
  • Mathematica
    Table[Length[Select[Map[Accumulate, Strings[{-1, 1}, n]], Count[ #, 0] == 0 &]], {n, 0, 20}] (* Geoffrey Critzer, Jan 24 2010 *)
    CoefficientList[Series[Sqrt[(1+2x)/(1-2x)],{x,0,40}],x] (* Harvey P. Dale, Apr 28 2016 *)
  • PARI
    a(n)=(n==0)+2*binomial(n-1,(n-1)\2)
    
  • PARI
    a(n) = 2^n*prod(k=0,n-1,(k/n+1/n)^((-1)^k)); \\ Michel Marcus, Dec 03 2013
    
  • Python
    from math import ceil
    from sympy import binomial
    def a(n):
        if n==0: return 1
        return 2*binomial(n-1,(n-1)//2)
    print([a(n) for n in range(18)])
    # David Nacin, Feb 29 2012
    
  • SageMath
    [2*binomial(n-1, (n-1)//2) + int(n==0) for n in range(41)] # G. C. Greubel, Jun 07 2023

Formula

G.f.: sqrt((1+2*x)/(1-2*x)).
a(n+1) = 2*C(n, floor(n/2)) = 2*A001405(n); a(2n) = C(2n, n) = A000984(n) = 4*a(2n-2)-|A002420(n)| = 4*a(2n-2)-2*A000108(n-1) = 2*A001700(n-1); a(2n+1) = 2*a(2n) = A028329(n).
2*a(n) = A047073(n+1).
a(n) = Sum_{k=0..n} abs(A106180(n,k)). - Philippe Deléham, Oct 06 2006
a(n) = Sum_{k=0..n} (k+1)binomial(n, (n-k)/2) ( 1-cos((k+1)*Pi/2) (1+(-1)^(n-k))/(n+k+2) ). - Paul Barry, Oct 12 2004
G.f.: 1/(1-2*x/(1+x/(1+x/(1-x/(1-x/(1+x/(1+x/(1-x/(1-x/(1+ ... (continued fraction). - Paul Barry, Aug 10 2009
G.f.: 1 + 2*x/(G(0)-x+x^2) where G(k)= 1 - 2*x^2 - x^4/G(k+1); (continued fraction, 1-step). - Sergei N. Gladkovskii, Aug 10 2012
D-finite with recurrence: n*a(n) = 2*a(n-1) + 4*(n-2)*a(n-2). - R. J. Mathar, Dec 03 2012
From Sergei N. Gladkovskii, Jul 26 2013: (Start)
G.f.: 1/G(0), where G(k) = 1 - 2*x/(1 + 2*x/(1 + 1/G(k+1) )); (continued fraction).
G.f.: G(0), where G(k) = 1 + 2*x/(1 - 2*x/(1 + 1/G(k+1) )); (continued fraction).
G.f.: W(0)/2*(1+2*x), where W(k) = 1 + 1/(1 - 2*x/(2*x + (k+1)/(x*(2*k+1))/W(k+1) )), abs(x) < 1/2; (continued fraction). (End)
a(n) = 2^n*Product_{k=0..n-1} (k/n + 1/n)^((-1)^k). - Peter Luschny, Dec 02 2013
G.f.: G(0), where G(k) = 1 + 2*x*(4*k+1)/((2*k+1)*(1+2*x) - (2*k+1)*(4*k+3)*x*(1+2*x)/((4*k+3)*x + (k+1)*(1+2*x)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 19 2014
From Peter Bala, Mar 29 2024: (Start)
a(n) = 2^n * Sum_{k = 0..n} (-1)^(n+k)*binomial(1/2, k)*binomial(- 1/2, n-k) = 2^n * A000246(n)/n!.
a(n) = (1/2^n) * binomial(2*n, n) * hypergeom([-1/2, -n], [1/2 - n], -1). (End)
E.g.f.: BesselI(0, 2*x)*(1 + x*(2 + Pi)*StruveL(1, 2*x)) - Pi*x*BesselI(1, 2*x)*StruveL(0, 2*x). - Stefano Spezia, May 11 2024
a(n) = A089849(n) + A138364(n). - Mélika Tebni, Jun 17 2024
From Amiram Eldar, Aug 15 2025: (Start)
Sum_{n>=0} 1/a(n) = Pi/(3*sqrt(3)) + 2.
Sum_{n>=0} (-1)^n/a(n) = 2/3 + Pi/(9*sqrt(3)). (End)

A325700 Numbers with as many distinct even as distinct odd prime indices.

Original entry on oeis.org

1, 6, 12, 14, 15, 18, 24, 26, 28, 33, 35, 36, 38, 45, 48, 51, 52, 54, 56, 58, 65, 69, 72, 74, 75, 76, 77, 86, 93, 95, 96, 98, 99, 104, 106, 108, 112, 116, 119, 122, 123, 135, 141, 142, 143, 144, 145, 148, 152, 153, 158, 161, 162, 172, 175, 177, 178, 185, 192
Offset: 1

Views

Author

Gus Wiseman, May 17 2019

Keywords

Comments

These are the Heinz numbers of the integer partitions counted by A241638.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of terms together with their prime indices begins:
    1: {}
    6: {1,2}
   12: {1,1,2}
   14: {1,4}
   15: {2,3}
   18: {1,2,2}
   24: {1,1,1,2}
   26: {1,6}
   28: {1,1,4}
   33: {2,5}
   35: {3,4}
   36: {1,1,2,2}
   38: {1,8}
   45: {2,2,3}
   48: {1,1,1,1,2}
   51: {2,7}
   52: {1,1,6}
   54: {1,2,2,2}
   56: {1,1,1,4}
   58: {1,10}
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100],0==Total[(-1)^PrimePi/@First/@If[#==1,{},FactorInteger[#]]]&]

A349157 Heinz numbers of integer partitions where the number of even parts is equal to the number of odd conjugate parts.

Original entry on oeis.org

1, 4, 6, 15, 16, 21, 24, 25, 35, 60, 64, 77, 84, 90, 91, 96, 100, 121, 126, 140, 143, 150, 210, 221, 240, 247, 256, 289, 297, 308, 323, 336, 351, 360, 364, 375, 384, 400, 437, 462, 484, 490, 495, 504, 525, 529, 546, 551, 560, 572, 585, 600, 625, 667, 686, 726
Offset: 1

Views

Author

Gus Wiseman, Jan 21 2022

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), so these are numbers with the same number of even prime indices as odd conjugate prime indices.
These are also partitions for which the number of even parts is equal to the positive alternating sum of the parts.

Examples

			The terms and their prime indices begin:
    1: ()
    4: (1,1)
    6: (2,1)
   15: (3,2)
   16: (1,1,1,1)
   21: (4,2)
   24: (2,1,1,1)
   25: (3,3)
   35: (4,3)
   60: (3,2,1,1)
   64: (1,1,1,1,1,1)
   77: (5,4)
   84: (4,2,1,1)
   90: (3,2,2,1)
   91: (6,4)
   96: (2,1,1,1,1,1)
		

Crossrefs

A subset of A028260 (even bigomega), counted by A027187.
These partitions are counted by A277579.
This is the half-conjugate version of A325698, counted by A045931.
A000041 counts partitions, strict A000009.
A047993 counts balanced partitions, ranked by A106529.
A056239 adds up prime indices, row sums of A112798, counted by A001222.
A100824 counts partitions with at most one odd part, ranked by A349150.
A108950/A108949 count partitions with more odd/even parts.
A122111 represents conjugation using Heinz numbers.
A130780/A171966 count partitions with more or equal odd/even parts.
A257991/A257992 count odd/even prime indices.
A316524 gives the alternating sum of prime indices (reverse: A344616).

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    conj[y_]:=If[Length[y]==0,y,Table[Length[Select[y,#>=k&]],{k,1,Max[y]}]];
    Select[Range[100],Count[primeMS[#],?EvenQ]==Count[conj[primeMS[#]],?OddQ]&]

Formula

A257992(a(n)) = A257991(A122111(a(n))).

A274230 Number of holes in a sheet of paper when you fold it n times and cut off the four corners.

Original entry on oeis.org

0, 0, 1, 3, 9, 21, 49, 105, 225, 465, 961, 1953, 3969, 8001, 16129, 32385, 65025, 130305, 261121, 522753, 1046529, 2094081, 4190209, 8382465, 16769025, 33542145, 67092481, 134193153, 268402689, 536821761, 1073676289, 2147385345
Offset: 0

Views

Author

Philippe Gibone, Jun 15 2016

Keywords

Comments

The folds are always made so the longer side becomes the shorter side.
We could have counted not only the holes but also all the notches: 4, 6, 9, 15, 25, 45, 81, 153, 289, ... which has the formula a(n) = (2^ceiling(n/2) + 1) * (2^floor(n/2) + 1) and appears to match the sequence A183978. - Philippe Gibone, Jul 06 2016
The same sequence (0,0,1,3,9,21,49,...) turns up when you start with an isosceles right triangular piece of paper and repeatedly fold it in half, snipping corners as you go. Is there an easy way to see why the two questions have the same answer? - James Propp, Jul 05 2016
Reply from Tom Karzes, Jul 05 2016: (Start)
This case seems a little more complicated than the rectangular case, since with the triangle you alternate between horizontal/vertical folds vs. diagonal folds, and the resulting fold pattern is more complex, but I think the basic argument is essentially the same.
Note that with the triangle, the first hole doesn't appear until after you've made 3 folds, so if you start counting at zero folds, you have three leading zeros in the sequence: 0,0,0,1,3,9,21,... (End)
Also the number of subsets of {1,2,...,n} that contain both even and odd numbers. For example, a(3)=3 and the 3 subsets are {1,2}, {2,3}, {1,2,3}; a(4)=9 and the 9 subsets are {1,2}, {1,4}, {2,3}, {3,4}, {1,2,3}, {1,2,4}, {1,3,4}, {2,3,4}, {1,2,3,4}. (See comments in A052551 for the number of subsets of {1,2,...,n} that contain only odd and even numbers.) - Enrique Navarrete, Mar 26 2018
Also the number of integer compositions of n + 1 with an odd part other than the first or last. The complementary compositions are counted by A052955(n>0) = A027383(n) + 1. - Gus Wiseman, Feb 05 2022
Also the number of unit squares in the (n+1)-st iteration in the version of the dragon curve where the rotation directions alternate, so that any clockwise rotation is followed by a counterclockwise rotation, and vice versa (see image link below). - Talmon Silver, May 09 2023

Crossrefs

See A274626, A274627 for the three- and higher-dimensional analogs.
This is the main diagonal of A274635.
Counting fold lines instead of holes gives A027383.
Bisections are A060867 (even) and A134057 (odd).

Programs

Formula

u(0) = 0; v(0) = 0; u(n+1) = v(n); v(n+1) = 2u(n) + 1; a(n) = u(n)*v(n).
a(n) = (2^ceiling(n/2) - 1)*(2^floor(n/2) - 1).
Proof from Tom Karzes, Jul 05 2016: (Start)
Let r be the number of times you fold along one axis and s be the number of times you fold along the other axis. So r is ceiling(n/2) and s is floor(n/2), where n is the total number of folds.
When unfolded, the resulting paper has been divided into a grid of (2^r) by (2^s) rectangles. The interior grid lines will have diamond-shaped holes where they intersect (assuming diagonal cuts).
There are (2^r-1) internal grid lines along one axis and (2^s-1) along the other. The total number of internal grid line intersections is therefore (2^r-1)*(2^s-1), or (2^ceiling(n/2)-1)*(2^floor(n/2)-1) as claimed. (End)
From Colin Barker, Jun 22 2016, revised by N. J. A. Sloane, Jul 05 2016: (Start)
It follows that:
a(n) = (2^(n/2)-1)^2 for n even, a(n) = 2^n+1-3*2^((n-1)/2) for n odd.
a(n) = 3*a(n-1)-6*a(n-3)+4*a(n-4) for n>3.
G.f.: x^2 / ((1-x)*(1-2*x)*(1-2*x^2)).
a(n) = (1+2^n-2^((n-3)/2)*(3-3*(-1)^n+2*sqrt(2)+2*(-1)^n*sqrt(2))). (End)
a(n) = A000225(n) - 2*A052955(n-2) for n > 1. - Yuchun Ji, Nov 19 2018
a(n) = A079667(2^(n-1)) for n >= 1. - J. M. Bergot, Jan 18 2021
a(n) = 2^(n-1) - A052955(n) = 2^(n-1) - A027383(n) - 1. - Gus Wiseman, Jan 29 2022
E.g.f.: cosh(x) + cosh(2*x) - 2*cosh(sqrt(2)*x) + sinh(x) + sinh(2*x) - 3*sinh(sqrt(2)*x)/sqrt(2). - Stefano Spezia, Apr 06 2022

A098123 Number of compositions of n with equal number of even and odd parts.

Original entry on oeis.org

1, 0, 0, 2, 0, 4, 6, 6, 24, 28, 60, 130, 190, 432, 770, 1386, 2856, 5056, 9828, 18918, 34908, 68132, 128502, 244090, 470646, 890628, 1709136, 3271866, 6238986, 11986288, 22925630, 43932906, 84349336, 161625288, 310404768, 596009494
Offset: 0

Views

Author

Vladeta Jovovic, Sep 24 2004

Keywords

Examples

			From _Gus Wiseman_, Jun 26 2022: (Start)
The a(0) = 1 through a(7) = 6 compositions (empty columns indicated by dots):
  ()  .  .  (12)  .  (14)  (1122)  (16)
            (21)     (23)  (1212)  (25)
                     (32)  (1221)  (34)
                     (41)  (2112)  (43)
                           (2121)  (52)
                           (2211)  (61)
(End)
		

Crossrefs

For partitions: A045931, ranked by A325698, strict A239241 (conj A352129).
Column k=0 of A242498.
Without multiplicity: A242821, for partitions A241638 (ranked by A325700).
These compositions are ranked by A355321.
A047993 counts balanced partitions, ranked by A106529.
A108950/A108949 count partitions with more odd/even parts.
A130780/A171966 count partitions with more or as many odd/even parts.
Cf. A025178.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Count[#,?EvenQ]==Count[#,?OddQ]&]],{n,0,15}] (* Gus Wiseman, Jun 26 2022 *)

Formula

a(n) = Sum_{k=floor(n/3)..floor(n/2)} C(2*n-4*k,n-2*k)*C(n-1-k,2*n-4*k-1).
Recurrence: n*(2*n-7)*a(n) = 2*(n-2)*(2*n-5)*a(n-2) + 2*(2*n-7)*(2*n-3)*a(n-3) - (n-4)*(2*n-3)*a(n-4). - Vaclav Kotesovec, May 01 2014
a(n) ~ sqrt(c) * d^n / sqrt(Pi*n), where d = 1.94696532812840456026081823863... is the root of the equation 1-4*d-2*d^2+d^4 = 0, c = 0.225563290820392765554898545739... is the root of the equation 43*c^4-18*c^2+8*c-1=0. - Vaclav Kotesovec, May 01 2014
G.f.: 1/sqrt(1 - 4*x^3/(1-x^2)^2). - Seiichi Manyama, May 01 2025

A026010 a(n) = number of (s(0), s(1), ..., s(n)) such that s(i) is a nonnegative integer and |s(i) - s(i-1)| = 1 for i = 1,2,...,n and s(0) = 2. Also a(n) = sum of numbers in row n+1 of array T defined in A026009.

Original entry on oeis.org

1, 2, 4, 7, 14, 25, 50, 91, 182, 336, 672, 1254, 2508, 4719, 9438, 17875, 35750, 68068, 136136, 260338, 520676, 999362, 1998724, 3848222, 7696444, 14858000, 29716000, 57500460, 115000920, 222981435, 445962870, 866262915, 1732525830, 3370764540
Offset: 0

Views

Author

Keywords

Comments

Conjecture: a(n) is the number of integer compositions of n + 2 in which the even parts appear as often at even positions as at odd positions (confirmed up to n = 19). - Gus Wiseman, Mar 17 2018

Examples

			The a(3) = 7 compositions of 5 in which the even parts appear as often at even positions as at odd positions are (5), (311), (131), (113), (221), (122), (11111). Missing are (41), (14), (32), (23), (212), (2111), (1211), (1121), (1112). - _Gus Wiseman_, Mar 17 2018
		

Crossrefs

Programs

  • Magma
    [(&+[Binomial(Floor((n+k)/2), Floor(k/2)): k in [0..n]]): n in [0..40]]; // G. C. Greubel, Nov 08 2018
  • Mathematica
    Array[Sum[Binomial[Floor[(# + k)/2], Floor[k/2]], {k, 0, #}] &, 34, 0] (* Michael De Vlieger, May 16 2018 *)
    Table[2^(-1 + n)*(((2 + 3*#)*Gamma[(1 + #)/2])/(Sqrt[Pi]*Gamma[2 + #/2]) &[n + Mod[n, 2]]), {n,0,40}] (* Peter Pein, Nov 08 2018 *)
    Table[(1/2)^((5 - (-1)^n)/2)*(6*n + 7 - 3*(-1)^n)*CatalanNumber[(2*n + 1 - (-1)^n)/4], {n, 0, 40}] (* G. C. Greubel, Nov 08 2018 *)
  • PARI
    vector(40, n, n--; sum(k=0,n, binomial(floor((n+k)/2), floor(k/2)))) \\ G. C. Greubel, Nov 08 2018
    

Formula

a(2*n) = ((3*n + 1)/(2*n + 1))*C(2*n + 1, n)= A051924(1+n), n>=0, a(2*n-1) = a(2*n)/2 = A097613(1+n), n >= 1. - Herbert Kociemba, May 08 2004
a(n) = Sum_{k=0..n} binomial(floor((n+k)/2), floor(k/2)). - Paul Barry, Jul 15 2004
Inverse binomial transform of A005774: (1, 3, 9, 26, 75, 216, ...). - Gary W. Adamson, Oct 22 2007
Conjecture: (n+3)*a(n) - 2*a(n-1) + (-5*n-3)*a(n-2) + 2*a(n-3) + 4*(n-3)*a(n-4) = 0. - R. J. Mathar, Jun 20 2013
a(n) = (1/2)^((5 - (-1)^n)/2)*(6*n + 7 - 3*(-1)^n)*Catalan((2*n + 1 - (-1)^n)/4), where Catalan is the Catalan number = A000108. - G. C. Greubel, Nov 08 2018

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
Showing 1-10 of 25 results. Next