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

A027383 a(2*n) = 3*2^n - 2; a(2*n+1) = 2^(n+2) - 2.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 22, 30, 46, 62, 94, 126, 190, 254, 382, 510, 766, 1022, 1534, 2046, 3070, 4094, 6142, 8190, 12286, 16382, 24574, 32766, 49150, 65534, 98302, 131070, 196606, 262142, 393214, 524286, 786430, 1048574, 1572862, 2097150, 3145726, 4194302, 6291454
Offset: 0

Views

Author

Keywords

Comments

Number of balanced strings of length n: let d(S) = #(1's) - #(0's), # == count in S, then S is balanced if every substring T of S has -2 <= d(T) <= 2.
Number of "fold lines" seen when a rectangular piece of paper is folded n+1 times along alternate orthogonal directions and then unfolded. - Quim Castellsaguer (qcastell(AT)pie.xtec.es), Dec 30 1999
Also the number of binary strings with the property that, when scanning from left to right, once the first 1 is seen in position j, there must be a 1 in positions j+2, j+4, ... until the end of the string. (Positions j+1, j+3, ... can be occupied by 0 or 1.) - Jeffrey Shallit, Sep 02 2002
a(n-1) is also the Moore lower bound on the order of a (3,n)-cage. - Eric W. Weisstein, May 20 2003 and Jason Kimberley, Oct 30 2011
Partial sums of A016116. - Hieronymus Fischer, Sep 15 2007
Equals row sums of triangle A152201. - Gary W. Adamson, Nov 29 2008
From John P. McSorley, Sep 28 2010: (Start)
a(n) = DPE(n+1) is the total number of k-double-palindromes of n up to cyclic equivalence. See sequence A180918 for the definitions of a k-double-palindrome of n and of cyclic equivalence. Sequence A180918 is the 'DPE(n,k)' triangle read by rows where DPE(n,k) is the number of k-double-palindromes of n up to cyclic equivalence. For example, we have a(4) = DPE(5) = DPE(5,1) + DPE(5,2) + DPE(5,3) + DPE(5,4) + DPE(5,5) = 0 + 2 + 2 + 1 + 1 = 6.
The 6 double-palindromes of 5 up to cyclic equivalence are 14, 23, 113, 122, 1112, 11111. They come from cyclic equivalence classes {14,41}, {23,32}, {113,311,131}, {122,212,221}, {1112,2111,1211,1121}, and {11111}. Hence a(n)=DPE(n+1) is the total number of cyclic equivalence classes of n containing at least one double-palindrome.
(End)
From Herbert Eberle, Oct 02 2015: (Start)
For n > 0, there is a red-black tree of height n with a(n-1) internal nodes and none with less.
In order a red-black tree of given height has minimal number of nodes, it has exactly 1 path with strictly alternating red and black nodes. All nodes outside this height defining path are black.
Consider:
mrbt5 R
/ \
/ \
/ \
/ B
/ / \
mrbt4 B / B
/ \ B E E
/ B E E
mrbt3 R E E
/ \
/ B
mrbt2 B E E
/ E
mrbt1 R
E E
(Red nodes shown as R, blacks as B, externals as E.)
Red-black trees mrbt1, mrbt2, mrbt3, mrbt4, mrbt5 of respective heights h = 1, 2, 3, 4, 5; all minimal in the number of internal nodes, namely 1, 2, 4, 6, 10.
Recursion (let n = h-1): a(-1) = 0, a(n) = a(n-1) + 2^floor(n/2), n >= 0.
(End)
Also the number of strings of length n with the digits 1 and 2 with the property that the sum of the digits of all substrings of uneven length is not divisible by 3. An example with length 8 is 21221121. - Herbert Kociemba, Apr 29 2017
a(n-2) is the number of achiral n-bead necklaces or bracelets using exactly two colors. For n=4, the four arrangements are AAAB, AABB, ABAB, and ABBB. - Robert A. Russell, Sep 26 2018
Partial sums of powers of 2 repeated 2 times, like A200672 where is 3 times. - Yuchun Ji, Nov 16 2018
Also the number of binary words of length n with cuts-resistance <= 2, where, for the operation of shortening all runs by one, cuts-resistance is the number of applications required to reach an empty word. Explicitly, these are words whose sequence of run-lengths, all of which are 1 or 2, has no odd-length run of 1's sandwiched between two 2's. - Gus Wiseman, Nov 28 2019
Also the number of up-down paths with n steps such that the height difference between the highest and lowest points is at most 2. - Jeremy Dover, Jun 17 2020
Also the number of non-singleton integer compositions of n + 2 with no odd part other than the first or last. Including singletons gives A052955. This is an unsorted (or ordered) version of A351003. The version without even (instead of odd) interior parts is A001911, complement A232580. Note that A000045(n-1) counts compositions without odd parts, with non-singleton case A077896, and A052952/A074331 count non-singleton compositions without even parts. Also the number of compositions y of n + 1 such that y_i = y_{i+1} for all even i. - Gus Wiseman, Feb 19 2022

Examples

			After 3 folds one sees 4 fold lines.
Example: a(3) = 6 because the strings 001, 010, 100, 011, 101, 110 have the property.
Binary: 1, 10, 100, 110, 1010, 1110, 10110, 11110, 101110, 111110, 1011110, 1111110, 10111110, 11111110, 101111110, 111111110, 1011111110, 1111111110, 10111111110, ... - _Jason Kimberley_, Nov 02 2011
Example: Partial sums of powers of 2 repeated 2 times:
a(3) = 1+1+2 = 4;
a(4) = 1+1+2+2 = 6;
a(5) = 1+1+2+2+4 = 10.
_Yuchun Ji_, Nov 16 2018
		

References

  • John P. McSorley: Counting k-compositions of n with palindromic and related structures. Preprint, 2010. [John P. McSorley, Sep 28 2010]

Crossrefs

Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), this sequence (k=3), A062318 (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A000066 (actual order of a (3,g)-cage).
Bisections are A033484 (even) and A000918 (odd).
a(n) = A305540(n+2,2), the second column of the triangle.
Numbers whose binary expansion is a balanced word are A330029.
Binary words counted by cuts-resistance are A319421 or A329860.
The complementary compositions are counted by A274230(n-1) + 1, with bisections A060867 (even) and A134057 (odd).
Cf. A000346, A000984, A001405, A001700, A011782 (compositions).
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent: A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A060482, A136252 (minor differences from A354788 at the start); A354785 (3*s(n)), A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Haskell
    import Data.List (transpose)
    a027383 n = a027383_list !! n
    a027383_list = concat $ transpose [a033484_list, drop 2 a000918_list]
    -- Reinhard Zumkeller, Jun 17 2015
    
  • Magma
    [2^Floor((n+2)/2)+2^Floor((n+1)/2)-2: n in [0..50]]; // Vincenzo Librandi, Aug 16 2011
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=2*a[n-2]+2 od: seq(a[n], n=1..41); # Zerinvary Lajos, Mar 16 2008
  • Mathematica
    a[n_?EvenQ] := 3*2^(n/2)-2; a[n_?OddQ] := 2^(2+(n-1)/2)-2; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 21 2011, after Quim Castellsaguer *)
    LinearRecurrence[{1, 2, -2}, {1, 2, 4}, 41] (* Robert G. Wilson v, Oct 06 2014 *)
    Table[Length[Select[Tuples[{0,1},n],And[Max@@Length/@Split[#]<=2,!MatchQ[Length/@Split[#],{_,2,ins:1..,2,_}/;OddQ[Plus[ins]]]]&]],{n,0,15}] (* Gus Wiseman, Nov 28 2019 *)
  • PARI
    a(n)=2^(n\2+1)+2^((n+1)\2)-2 \\ Charles R Greathouse IV, Oct 21 2011
    
  • Python
    def a(n): return 2**((n+2)//2) + 2**((n+1)//2) - 2
    print([a(n) for n in range(43)]) # Michael S. Branicky, Feb 19 2022

Formula

a(0)=1, a(1)=2; thereafter a(n+2) = 2*a(n) + 2.
a(2n) = 3*2^n - 2 = A033484(n);
a(2n-1) = 2^(n+1) - 2 = A000918(n+1).
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = Sum_{k=0..n} 2^min(k, n-k).
a(n) = 2^floor((n+2)/2) + 2^floor((n+1)/2) - 2. - Quim Castellsaguer (qcastell(AT)pie.xtec.es)
a(n) = 2^(n/2)*(3 + 2*sqrt(2) + (3-2*sqrt(2))*(-1)^n)/2 - 2. - Paul Barry, Apr 23 2004
a(n) = A132340(A052955(n)). - Reinhard Zumkeller, Aug 20 2007
a(n) = A052955(n+1) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n+1)) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n-1)+1) for n > 0. - Hieronymus Fischer, Sep 15 2007
A132666(a(n)) = a(n-1) + 1 for n > 0. - Hieronymus Fischer, Sep 15 2007
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = 2*( (a(n-2)+1) mod (a(n-1)+1) ), n > 1. - Pierre Charland, Dec 12 2010
a(n) = A136252(n-1) + 1, for n > 0. - Jason Kimberley, Nov 01 2011
G.f.: (1+x*R(0))/(1-x), where R(k) = 1 + 2*x/( 1 - x/(x + 1/R(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013
a(n) = 2^((2*n + 3*(1-(-1)^n))/4)*3^((1+(-1)^n)/2) - 2. - Luce ETIENNE, Sep 01 2014
a(n) = a(n-1) + 2^floor((n-1)/2) for n>0, a(0)=1. - Yuchun Ji, Nov 23 2018
E.g.f.: 3*cosh(sqrt(2)*x) - 2*cosh(x) + 2*sqrt(2)*sinh(sqrt(2)*x) - 2*sinh(x). - Stefano Spezia, Apr 06 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 24 2000
Replaced definition with a simpler one. - N. J. A. Sloane, Jul 09 2022

A053251 Coefficients of the '3rd-order' mock theta function psi(q).

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 5, 6, 7, 8, 9, 11, 12, 13, 16, 17, 19, 22, 24, 27, 31, 34, 37, 42, 46, 51, 57, 62, 68, 76, 83, 91, 101, 109, 120, 132, 143, 156, 171, 186, 202, 221, 239, 259, 283, 306, 331, 360, 388, 420, 455, 490, 529, 572, 616, 663, 716, 769, 827
Offset: 0

Views

Author

Dean Hickerson, Dec 19 1999

Keywords

Comments

Number of partitions of n into odd parts such that if a number occurs as a part then so do all smaller positive odd numbers.
Number of ways to express n as a partial sum of 1 + [1,3] + [1,5] + [1,7] + [1,9] + .... E.g., a(6)=2 because we have 6 = 1+1+1+1+1+1 = 1+3+1+1. - Jon Perry, Jan 01 2004
Also number of partitions of n such that the largest part occurs exactly once and all the other parts occur exactly twice. Example: a(9)=4 because we have [9], [7,1,1], [5,2,2] and [3,2,2,1,1]. - Emeric Deutsch, Mar 08 2006
Number of partitions (d1,d2,...,dm) of n such that 0 < d1/1 < d2/2 < ... < dm/m. - Seiichi Manyama, Mar 17 2018
For Emeric Deutsch's comment above, (1) this appears to be an alternately equal case of A122130, (2) the ordered version (compositions) is A239327, (3) allowing any length gives A351006, (4) the even-length version is A351007. - Gus Wiseman, Feb 25 2022

Examples

			q + q^2 + q^3 + 2*q^4 + 2*q^5 + 2*q^6 + 3*q^7 + 3*q^8 + 4*q^9 + ...
From _Seiichi Manyama_, Mar 17 2018: (Start)
n | Partition (d1,d2,...,dm) | (d1/1, d2/2, ... , dm/m)
--+--------------------------+-------------------------
1 | (1)                      | (1)
2 | (2)                      | (2)
3 | (3)                      | (3)
4 | (4)                      | (4)
  | (1, 3)                   | (1, 3/2)
5 | (5)                      | (5)
  | (1, 4)                   | (1, 2)
6 | (6)                      | (6)
  | (1, 5)                   | (1, 5/2)
7 | (7)                      | (7)
  | (1, 6)                   | (1, 3)
  | (2, 5)                   | (2, 5/2)
8 | (8)                      | (8)
  | (1, 7)                   | (1, 7/2)
  | (2, 6)                   | (2, 3)
9 | (9)                      | (9)
  | (1, 8)                   | (1, 4)
  | (2, 7)                   | (2, 7/2)
  | (1, 3, 5)                | (1, 3/2, 5/3) (End)
		

References

  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 55, Eq. (26.13).
  • Srinivasa Ramanujan, Collected Papers, Chelsea, New York, 1962, pp. 354-355.
  • Srinivasa Ramanujan, The Lost Notebook and Other Unpublished Papers, Narosa Publishing House, New Delhi, 1988, p. 31.

Crossrefs

Other '3rd-order' mock theta functions are at A000025, A053250, A053252, A053253, A053254, A053255.
Cf. A003475.

Programs

  • Maple
    f:=n->q^(n^2)/mul((1-q^(2*i+1)),i=0..n-1); add(f(i),i=1..6);
    # second Maple program:
    b:= proc(n, i) option remember; (s-> `if`(n>s, 0, `if`(n=s, 1,
          b(n, i-1)+b(n-i, min(n-i, i-1)))))(i*(i+1)/2)
        end:
    a:= n-> `if`(n=0, 0, add(b(j, min(j, n-2*j-1)), j=0..iquo(n, 2))):
    seq(a(n), n=0..80);  # Alois P. Heinz, May 17 2018
  • Mathematica
    Series[Sum[q^n^2/Product[1-q^(2k-1), {k, 1, n}], {n, 1, 10}], {q, 0, 100}]
    (* Second program: *)
    b[n_, i_] := b[n, i] = Function[s, If[n > s, 0, If[n == s, 1, b[n, i - 1] + b[n - i, Min[n - i, i - 1]]]]][i*(i + 1)/2];
    a[n_] := If[n==0, 0, Sum[b[j, Min[j, n-2*j-1]], {j, 0, Quotient[n, 2]}]];
    Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Jun 17 2018, after Alois P. Heinz *)
  • PARI
    { n=20; v=vector(n); for (i=1,n,v[i]=vector(2^(i-1))); v[1][1]=1; for (i=2,n, k=length(v[i-1]); for (j=1,k, v[i][j]=v[i-1][j]+1; v[i][j+k]=v[i-1][j]+2*i-1)); c=vector(n); for (i=1,n, for (j=1,2^(i-1), if (v[i][j]<=n, c[v[i][j]]++))); c } \\ Jon Perry
    
  • PARI
    {a(n) = local(t); if(n<0, 0, t = 1 + O(x^n); polcoeff( sum(k=1, sqrtint(n), t *= x^(2*k-1) / (1 - x^(2*k-1)) + O(x^(n-(k-1)^2+1))), n))} /* Michael Somos, Sep 04 2007 */

Formula

G.f.: psi(q) = Sum_{n>=1} q^(n^2) / ( (1-q)*(1-q^3)*...*(1-q^(2*n-1)) ).
G.f.: Sum_{k>=1} q^k*Product_{j=1..k-1} (1+q^(2*j)) (see the Fine reference, p. 58, Eq. (26,53)). - Emeric Deutsch, Mar 08 2006
a(n) ~ exp(Pi*sqrt(n/6)) / (4*sqrt(n)). - Vaclav Kotesovec, Jun 09 2019

Extensions

More terms from Emeric Deutsch, Mar 08 2006

A351005 Number of integer partitions of n into parts that are alternately equal and unequal.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 3, 2, 4, 2, 5, 4, 6, 4, 8, 5, 10, 6, 12, 8, 16, 9, 18, 12, 22, 14, 28, 16, 33, 20, 40, 24, 48, 28, 56, 34, 67, 40, 80, 46, 94, 56, 110, 64, 130, 75, 152, 88, 176, 102, 206, 118, 238, 138, 276, 159, 320, 182, 368, 210, 424, 242, 488, 276, 558
Offset: 0

Views

Author

Gus Wiseman, Jan 31 2022

Keywords

Comments

Also partitions whose multiplicities are all 2's, except possibly for the last, which may be 1.

Examples

			The a(1) = 1 through a(12) = 6 partitions (A..C = 10..12):
  1  2   3  4   5    6     7    8     9    A     B      C
     11     22  221  33    331  44    441  55    443    66
                     2211       332        442   551    552
                                3311       3322  33221  4422
                                           4411         5511
                                                        332211
		

Crossrefs

The even-length ordered version is A003242, ranked by A351010.
The even-length case is A035457.
Without equalities we have A122135, opposite A122129, even-length A122134.
The non-strict version is A351004, opposite A351003, even-length A035363.
The opposite version is A351006, even-length A351007.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],And@@Table[#[[i]]==#[[i+1]],{i,1,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,2,Length[#]-1,2}]&]],{n,0,30}]

A351006 Number of integer partitions of n into parts that are alternately unequal and equal.

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 4, 6, 7, 9, 10, 12, 14, 16, 18, 22, 25, 28, 31, 36, 40, 46, 50, 56, 64, 71, 78, 88, 96, 106, 118, 130, 143, 158, 172, 190, 209, 228, 248, 274, 298, 324, 354, 384, 418, 458, 494, 536, 584, 631, 683, 742, 800, 864, 936, 1010, 1088, 1176, 1264
Offset: 0

Views

Author

Gus Wiseman, Jan 31 2022

Keywords

Examples

			The a(1) = 1 through a(11) = 12 partitions (A = 10, B = 11):
  1  2  3   4    5    6    7    8     9      A      B
        21  31   32   42   43   53    54     64     65
            211  41   51   52   62    63     73     74
                 311  411  61   71    72     82     83
                           322  422   81     91     92
                           511  611   522    433    A1
                                3221  711    622    533
                                      4221   811    722
                                      32211  5221   911
                                             42211  4331
                                                    6221
                                                    52211
		

Crossrefs

Without equalities we have A122129, opposite A122135, even-length A351008.
The non-strict version is A351003, opposite A351004, even-length A351012.
The alternately equal and unequal version is A351005, even-length A035457.
The even-length case is A351007.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],And@@Table[#[[i]]==#[[i+1]],{i,2,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,1,Length[#]-1,2}]&]],{n,0,30}]

A122135 Expansion of f(x, -x^4) / phi(-x^2) in powers of x where f(, ) and phi() are Ramanujan theta functions.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 6, 7, 10, 12, 16, 20, 26, 31, 40, 48, 60, 72, 89, 106, 130, 154, 186, 220, 264, 310, 370, 433, 512, 598, 704, 818, 958, 1110, 1293, 1494, 1734, 1996, 2308, 2650, 3052, 3496, 4014, 4584, 5248, 5980, 6825, 7760, 8834, 10020, 11380, 12882, 14594
Offset: 0

Views

Author

Michael Somos, Aug 21 2006

Keywords

Comments

Generating function arises naturally in Rodney Baxter's solution of the Hard Hexagon Model according to George Andrews.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
From Gus Wiseman, Feb 26 2022: (Start)
Conjecture: Also the number of integer partitions y of n such that y_i > y_{i+1} for all even i. For example, the a(1) = 1 through a(9) = 12 partitions are:
(1) (2) (3) (4) (5) (6) (7) (8) (9)
(11) (21) (22) (32) (33) (43) (44) (54)
(31) (41) (42) (52) (53) (63)
(221) (51) (61) (62) (72)
(321) (331) (71) (81)
(2211) (421) (332) (432)
(3211) (431) (441)
(521) (531)
(3311) (621)
(4211) (3321)
(4311)
(5211)
The even-length case appears to be A122134.
The odd-length case is A351595.
The alternately unequal version appears to be A122129, even A351008, odd A122130.
The alternately equal version is A351003, even A351012, odd A000009.
The alternately equal and unequal version is A351005, even A035457, odd A351593.
The alternately unequal and equal version is A351006, even A351007, odd A053251. (End)
For Wiseman's conjecture above and three other partition-theoretic interpretations of this sequence see Connor, Proposition 4. - Peter Bala, Jan 02 2025

Examples

			G.f. = 1 + x + 2*x^2 + 2*x^3 + 3*x^4 + 4*x^5 + 6*x^6 + 7*x^7 + 10*x^8 + ...
G.f. = q^9 + q^49 + 2*q^89 + 2*q^129 + 3*q^169 + 4*q^209 + 6*q^249 + ...
		

References

  • G. E. Andrews, q-series, CBMS Regional Conference Series in Mathematics, 66, Amer. Math. Soc. 1986, see p. 8, Eq. (1.5). MR0858826 (88b:11063)
  • G. E. Andrews, R. Askey and R. Roy, Special Functions, Cambridge University Press, 1999; Exercise 6(d), p. 591.

Crossrefs

Programs

  • Maple
    f:=n->1/mul(1-q^(20*k+n),k=0..20);
    f(1)*f(2)*f(5)*f(6)*f(8)*f(9)*f(11)*f(12)*f(14)*f(15)*f(18)*f(19);
    series(%,q,200); seriestolist(%); # N. J. A. Sloane, Mar 19 2012
  • Mathematica
    a[ n_] := SeriesCoefficient[ QPochhammer[ -x, -x^5] QPochhammer[ x^4, -x^5] QPochhammer[-x^5] / EllipticTheta[ 4, 0, x^2], {x, 0, n}]; (* Michael Somos, Nov 12 2016 *)
    nmax = 50; CoefficientList[Series[Product[1/((1 - x^(20*k+1))*(1 - x^(20*k+2))*(1 - x^(20*k+5))*(1 - x^(20*k+6))*(1 - x^(20*k+8))*(1 - x^(20*k+9))*(1 - x^(20*k+11))*(1 - x^(20*k+12))*(1 - x^(20*k+14))*(1 - x^(20*k+15))*(1 - x^(20*k+18))*(1 - x^(20*k+19)) ), {k, 0, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Nov 12 2016 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum(k=0, (sqrtint(4*n+1) - 1) \2, x^(k^2 + k) / prod(i=1, 2*k+1, 1 - x^i, 1 + x * O(x^(n-k^2-k)))), n))};

Formula

Expansion of f(x^2, x^8) / f(-x, -x^4) in powers of x where f(, ) is Ramanujan's general theta function. - Michael Somos, Nov 12 2016
Expansion of f(-x^3, -x^7) * f(-x^4, -x^16) / ( f(-x) * f(-x^20) ) in powers of x where f(, ) is Ramanujan's general theta function.
Euler transform of period 20 sequence [ 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, ...].
G.f.: Sum_{k>=0} x^(k^2 + k) / ((1 - x) * (1 - x^2) * ... * (1 - x^(2*k+1))).
Let f(n) = 1/Product_{k >= 0} (1-q^(20k+n)). Then g.f. is f(1)*f(2)*f(5)*f(6)*f(8)*f(9)*f(11)*f(12)*f(14)*f(15)*f(18)*f(19); - N. J. A. Sloane, Mar 19 2012.
a(n) ~ (3 + sqrt(5))^(1/4) * exp(Pi*sqrt(2*n/5)) / (4*sqrt(5)*n^(3/4)). - Vaclav Kotesovec, Nov 12 2016

A122134 Expansion of Sum_{k>=0} x^(k^2+k)/((1-x)(1-x^2)...(1-x^(2k))).

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 4, 4, 6, 7, 10, 11, 16, 18, 24, 28, 36, 42, 54, 62, 78, 91, 112, 130, 159, 184, 222, 258, 308, 356, 424, 488, 576, 664, 778, 894, 1044, 1196, 1389, 1590, 1838, 2098, 2419, 2754, 3162, 3596, 4114, 4668, 5328, 6032, 6864, 7760, 8806, 9936, 11252
Offset: 0

Views

Author

Michael Somos, Aug 21 2006, Oct 10 2007

Keywords

Comments

Generating function arises naturally in Rodney Baxter's solution of the Hard Hexagon Model according to George Andrews.
In Watson 1937 page 275 he writes "Psi_0(q^{1/2},q) = prod_1^oo (1+q^{2n}) G(-q^2)" so this is the expansion in powers of q^2. - Michael Somos, Jun 29 2015
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Rogers-Ramanujan functions: G(q) (see A003114), H(q) (A003106).
From Gus Wiseman, Feb 26 2022: (Start)
Conjecture: Also the number of even-length integer partitions y of n such that y_i != y_{i+1} for all even i. For example, the a(2) = 1 through a(9) = 7 partitions are:
(11) (21) (22) (32) (33) (43) (44) (54)
(31) (41) (42) (52) (53) (63)
(51) (61) (62) (72)
(2211) (3211) (71) (81)
(3311) (3321)
(4211) (4311)
(5211)
This appears to be the even-length version of A122135.
The odd-length version is A351595.
For Wiseman's conjecture above and three other partition-theoretic interpretations of this sequence see Connor, Proposition 3. - Peter Bala, Jan 02 2025

Examples

			G.f. = 1 + x^2 + x^3 + 2*x^4 + 2*x^5 + 4*x^6 + 4*x^7 + 6*x^8 + 7*x^9 + ...
G.f. = q + q^81 + q^121 + 2*q^161 + 2*q^201 + 4*q^241 + 4*q^281 + ...
		

References

  • G. E. Andrews, R. Askey and R. Roy, Special Functions, Cambridge University Press, 1999; Exercise 6(c), p. 591.
  • G. E. Andrews, q-series, CBMS Regional Conference Series in Mathematics, 66, Amer. Math. Soc. 1986, see p. 8, Eq. (1.6). MR0858826 (88b:11063)

Crossrefs

Programs

  • Mathematica
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[ Sum[ x^(k^2 + k) / QPochhammer[ x, x, 2 k], {k, 0, (Sqrt[ 4 n + 1] - 1) / 2}], {x, 0, n}]]; (* Michael Somos, Jun 29 2015 *)
    a[ n_] := SeriesCoefficient [ 1 / (QPochhammer[ x^4, -x^5] QPochhammer[ -x, -x^5] QPochhammer[ x, x^2]), {x, 0, n}]; (* Michael Somos, Jun 29 2015 *)
    a[ n_] := SeriesCoefficient[ QPochhammer[ x^2, -x^5] QPochhammer[ -x^3, -x^5] QPochhammer[ -x^5] / EllipticTheta[ 4, 0, x^2], {x, 0, n}]; (* Michael Somos, Jun 29 2015 *)
    nmax = 50; CoefficientList[Series[Product[1/((1 - x^(20*k+2))*(1 - x^(20*k+3))*(1 - x^(20*k+4))*(1 - x^(20*k+5))*(1 - x^(20*k+6))*(1 - x^(20*k+7))*(1 - x^(20*k+13))*(1 - x^(20*k+14))*(1 - x^(20*k+15))*(1 - x^(20*k+16))*(1 - x^(20*k+17)) *(1 - x^(20*k+18))), {k, 0, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Nov 12 2016 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum(k=0, (sqrtint(4*n + 1) - 1)\2, x^(k^2 + k) / prod(i=1, 2*k, 1 - x^i, 1 + x * O(x^(n -k^2-k)))), n))};

Formula

Euler transform of period 20 sequence [ 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, ...].
Expansion of f(x^4, x^6) / f(-x^2, -x^3) in powers of x where f(, ) is the Ramanujan general theta function. - Michael Somos, Jun 29 2015
Expansion of f(-x^2, x^3) / phi(-x^2) in powers of x where phi() is a Ramanujan theta function. - Michael Somos, Jun 29 2015
Expansion of G(-x) / chi(-x) in powers of x where chi() is a Ramanujan theta function and G() is a Rogers-Ramanujan function. - Michael Somos, Jun 29 2015
G.f.: Sum_{k>=0} x^(k^2 + k) / ((1 - x) * (1 - x^2) * ... * (1 - x^(2*k))).
Expansion of f(-x, -x^9) * f(-x^8, -x^12) / ( f(-x) * f(-x^20) ) in powers of x where f(, ) is the Ramanujan general theta function.
a(n) = number of partitions of n into parts that are each either == 2, 3, ..., 7 (mod 20) or == 13, 14, ..., 18 (mod 20). - Michael Somos, Jun 29 2015 [corrected by Vaclav Kotesovec, Nov 12 2016]
a(n) ~ (3 - sqrt(5))^(1/4) * exp(Pi*sqrt(2*n/5)) / (4*sqrt(5)*n^(3/4)). - Vaclav Kotesovec, Nov 12 2016

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

A357643 Number of integer compositions of n into parts that are alternately equal and unequal.

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 5, 5, 9, 7, 17, 14, 28, 25, 49, 42, 87, 75, 150, 132, 266, 226, 466, 399, 810, 704, 1421, 1223, 2488, 2143, 4352, 3759, 7621, 6564, 13339, 11495, 23339, 20135, 40852, 35215, 71512, 61639, 125148, 107912, 219040, 188839, 383391, 330515, 670998
Offset: 0

Views

Author

Gus Wiseman, Oct 12 2022

Keywords

Examples

			The a(1) = 1 through a(8) = 9 compositions:
  (1)  (2)   (3)  (4)    (5)    (6)     (7)      (8)
       (11)       (22)   (113)  (33)    (115)    (44)
                  (112)  (221)  (114)   (223)    (116)
                                (1122)  (331)    (224)
                                (2211)  (11221)  (332)
                                                 (1133)
                                                 (3311)
                                                 (22112)
                                                 (112211)
		

Crossrefs

The even-length version is A003242, ranked by A351010, partitions A035457.
Without equal relations we have A016116, equal only A001590 (apparently).
The version for partitions is A351005.
The opposite version is A357644, partitions A351006.
A011782 counts compositions.
A357621 gives half-alternating sum of standard compositions, skew A357623.
A357645 counts compositions by half-alternating sum, skew A357646.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]==#[[i+1]],{i,1,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,2,Length[#]-1,2}]&]],{n,0,15}]
  • PARI
    C_x(N) = {my(x='x+O('x^N), h=(1+sum(k=1,N, (x^k)/(1+x^(2*k))))/(1-sum(k=1,N, (x^(2*k))/(1+x^(2*k))))); Vec(h)}
    C_x(50) \\ John Tyler Rascoe, May 28 2024

Formula

G.f.: (1 + Sum_{k>0} (x^k)/(1 + x^(2*k)))/(1 - Sum_{k>0} (x^(2*k))/(1 + x^(2*k))). - John Tyler Rascoe, May 28 2024

Extensions

More terms from Alois P. Heinz, Oct 12 2022

A357644 Number of integer compositions of n into parts that are alternately unequal and equal.

Original entry on oeis.org

1, 1, 1, 3, 4, 7, 8, 13, 17, 25, 30, 44, 58, 77, 98, 142, 176, 245, 311, 426, 548, 758, 952, 1319, 1682, 2308, 2934, 4059, 5132, 7087, 9008, 12395, 15757, 21728, 27552, 38019, 48272, 66515, 84462, 116467, 147812, 203825, 258772, 356686, 452876, 624399, 792578
Offset: 0

Views

Author

Gus Wiseman, Oct 14 2022

Keywords

Examples

			The a(1) = 1 through a(7) = 13 compositions:
  (1)  (2)  (3)   (4)    (5)    (6)     (7)
            (12)  (13)   (14)   (15)    (16)
            (21)  (31)   (23)   (24)    (25)
                  (211)  (32)   (42)    (34)
                         (41)   (51)    (43)
                         (122)  (411)   (52)
                         (311)  (1221)  (61)
                                (2112)  (133)
                                        (322)
                                        (511)
                                        (2113)
                                        (3112)
                                        (12211)
		

Crossrefs

Without equal relations we have A000213, equal only A027383.
Even-length opposite: A003242, ranked by A351010, partitions A035457.
The version for partitions is A351006.
The opposite version is A357643, partitions A351005.
A011782 counts compositions.
A357621 gives half-alternating sum of standard compositions, skew A357623.
A357645 counts compositions by half-alternating sum, skew A357646.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]==#[[i+1]],{i,2,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,1,Length[#]-1,2}]&]],{n,0,10}]

Extensions

More terms from Alois P. Heinz, Oct 19 2022

A351007 Number of even-length integer partitions of n into parts that are alternately unequal and equal.

Original entry on oeis.org

1, 0, 0, 1, 1, 2, 2, 3, 4, 5, 5, 7, 8, 9, 10, 13, 14, 16, 18, 20, 23, 27, 28, 32, 37, 40, 44, 51, 54, 60, 67, 73, 81, 90, 96, 107, 118, 127, 139, 154, 166, 181, 198, 213, 232, 256, 273, 297, 325, 348, 377, 411, 440, 476, 516, 555, 598, 647, 692, 746, 807
Offset: 0

Views

Author

Gus Wiseman, Jan 31 2022

Keywords

Comments

These are partitions whose multiplicities begin with a 1, are followed by any number of 2's, and end with another 1.

Examples

			The a(3) = 1 through a(15) = 13 partitions (A..E = 10..14):
  21  31  32  42  43  53    54    64    65    75    76    86    87
          41  51  52  62    63    73    74    84    85    95    96
                  61  71    72    82    83    93    94    A4    A5
                      3221  81    91    92    A2    A3    B3    B4
                            4221  5221  A1    B1    B2    C2    C3
                                        4331  4332  C1    D1    D2
                                        6221  5331  5332  5441  E1
                                              7221  6331  6332  5442
                                                    8221  7331  6441
                                                          9221  7332
                                                                8331
                                                                A221
                                                                433221
		

Crossrefs

The alternately equal and unequal version is A035457, any length A351005.
This is the even-length case of A351006, odd-length A053251.
Without equalities we have A351008, any length A122129, opposite A122135.
Without inequalities we have A351012, any length A351003, opposite A351004.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],EvenQ[Length[#]]&&And@@Table[#[[i]]==#[[i+1]],{i,2,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,1,Length[#]-1,2}]&]],{n,0,30}]
Showing 1-10 of 18 results. Next