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-5 of 5 results.

A167762 a(n) = 2*a(n-1)+3*a(n-2)-6*a(n-3) starting a(0)=a(1)=0, a(2)=1.

Original entry on oeis.org

0, 0, 1, 2, 7, 14, 37, 74, 175, 350, 781, 1562, 3367, 6734, 14197, 28394, 58975, 117950, 242461, 484922, 989527, 1979054, 4017157, 8034314, 16245775, 32491550, 65514541, 131029082, 263652487, 527304974, 1059392917, 2118785834, 4251920575, 8503841150
Offset: 0

Views

Author

Paul Curtz, Nov 11 2009

Keywords

Comments

Inverse binomial transform yields two zeros followed by A077917 (a signed variant of A127864).
a(n) mod 10 is zero followed by a sequence with period length 8: 0, 1, 2, 7, 4, 7, 4, 5 (repeat).
a(n) is the number of length n+1 binary words with some prefix w such that w contains three more 1's than 0's and no prefix of w contains three more 0's than 1's. - Geoffrey Critzer, Dec 13 2013
From Gus Wiseman, Oct 06 2023: (Start)
Also the number of subsets of {1..n} with two distinct elements summing to n + 1. For example, the a(2) = 1 through a(5) = 14 subsets are:
{1,2} {1,3} {1,4} {1,5}
{1,2,3} {2,3} {2,4}
{1,2,3} {1,2,4}
{1,2,4} {1,2,5}
{1,3,4} {1,3,5}
{2,3,4} {1,4,5}
{1,2,3,4} {2,3,4}
{2,4,5}
{1,2,3,4}
{1,2,3,5}
{1,2,4,5}
{1,3,4,5}
{2,3,4,5}
{1,2,3,4,5}
The complement is counted by A038754.
Allowing twins gives A167936, complement A108411.
For n instead of n + 1 we have A365544, complement A068911.
The version for all subsets (not just pairs) is A366130.
(End)

Crossrefs

First differences are A167936, complement A108411.

Programs

  • Mathematica
    LinearRecurrence[{2,3,-6},{0,0,1},40] (* Harvey P. Dale, Sep 17 2013 *)
    CoefficientList[Series[x^2/((2 x - 1) (3 x^2 - 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 17 2013 *)
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Subsets[#,{2}],n+1]&]],{n,0,10}] (* Gus Wiseman, Oct 06 2023 *)

Formula

a(n) mod 9 = A153130(n), n>3 (essentially the same as A154529, A146501 and A029898).
a(n+1)-2*a(n) = 0 if n even, = A000244((1+n)/2) if n odd.
a(2*n) = A005061(n). a(2*n+1) = 2*A005061(n).
G.f.: x^2/((2*x-1)*(3*x^2-1)). a(n) = 2^n - A038754(n). - R. J. Mathar, Nov 12 2009
G.f.: x^2/(1-2*x-3*x^2+6*x^3). - Philippe Deléham, Nov 11 2009

Extensions

Edited and extended by R. J. Mathar, Nov 12 2009

A117855 Number of nonzero palindromes of length n (in base 3).

Original entry on oeis.org

2, 2, 6, 6, 18, 18, 54, 54, 162, 162, 486, 486, 1458, 1458, 4374, 4374, 13122, 13122, 39366, 39366, 118098, 118098, 354294, 354294, 1062882, 1062882, 3188646, 3188646, 9565938, 9565938, 28697814, 28697814, 86093442, 86093442, 258280326, 258280326, 774840978
Offset: 1

Views

Author

Martin Renner, May 02 2006

Keywords

Comments

See A225367 for the sequence that counts all base 3 palindromes, including 0 (and thus also the number of n-digit terms in A006072). -- A nonzero palindrome of length L=2k-1 or of length L=2k is determined by the first k digits, which then determine the last k digits by symmetry. Since the first digit cannot be 0, there are 2*3^(k-1) possibilities. - M. F. Hasler, May 05 2013
From Gus Wiseman, Oct 18 2023: (Start)
Also the number of subsets of {1..n} with n not the sum of two subset elements (possibly the same). For example, the a(0) = 1 through a(4) = 6 subsets are:
{} {} {} {} {}
{1} {2} {1} {1}
{2} {3}
{3} {4}
{1,3} {1,4}
{2,3} {3,4}
For subsets with no subset summing to n we have A365377.
Requiring pairs to be distinct gives A068911, complement A365544.
The complement is counted by A366131.
(End) [Edited by Peter Munn, Nov 22 2023]

Examples

			The a(3)=6 palindromes of length 3 are: 101, 111, 121, 202, 212, and 222. - _M. F. Hasler_, May 05 2013
		

Crossrefs

Cf. A050683 and A070252.
Bisections are both A025192.
A093971/A088809/A364534 count certain types of sum-full subsets.
A108411 lists powers of 3 repeated, complement A167936.

Programs

  • Mathematica
    With[{c=NestList[3#&,2,20]},Riffle[c,c]] (* Harvey P. Dale, Mar 25 2018 *)
    Table[Length[Select[Subsets[Range[n]],!MemberQ[Total/@Tuples[#,2],n]&]],{n,0,10}] (* Gus Wiseman, Oct 18 2023 *)
  • PARI
    A117855(n)=2*3^((n-1)\2) \\ - M. F. Hasler, May 05 2013
    
  • Python
    def A117855(n): return 3**(n-1>>1)<<1 # Chai Wah Wu, Oct 28 2024

Formula

a(n) = 2*3^floor((n-1)/2).
a(n) = 2*A108411(n-1).
From Colin Barker, Feb 15 2013: (Start)
a(n) = 3*a(n-2).
G.f.: -2*x*(x+1)/(3*x^2-1). (End)

Extensions

More terms from Colin Barker, Feb 15 2013

A366131 Number of subsets of {1..n} with two elements (possibly the same) summing to n.

Original entry on oeis.org

0, 0, 2, 2, 10, 14, 46, 74, 202, 350, 862, 1562, 3610, 6734, 14926, 28394, 61162, 117950, 249022, 484922, 1009210, 1979054, 4076206, 8034314, 16422922, 32491550, 66045982, 131029082, 265246810, 527304974, 1064175886, 2118785834, 4266269482, 8503841150, 17093775742, 34101458042, 68461196410, 136664112494
Offset: 0

Views

Author

Gus Wiseman, Oct 07 2023

Keywords

Examples

			The a(0) = 0 through a(5) = 14 subsets:
  .  .  {1}    {1,2}    {2}        {1,4}
        {1,2}  {1,2,3}  {1,2}      {2,3}
                        {1,3}      {1,2,3}
                        {2,3}      {1,2,4}
                        {2,4}      {1,3,4}
                        {1,2,3}    {1,4,5}
                        {1,2,4}    {2,3,4}
                        {1,3,4}    {2,3,5}
                        {2,3,4}    {1,2,3,4}
                        {1,2,3,4}  {1,2,3,5}
                                   {1,2,4,5}
                                   {1,3,4,5}
                                   {2,3,4,5}
                                   {1,2,3,4,5}
		

Crossrefs

The complement is counted by A117855.
For pairs summing to n + 1 we have A167936.
A068911 counts subsets of {1..n} w/o two distinct elements summing to n.
A093971/A088809/A364534 count certain types of sum-full subsets.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Tuples[#,2],n]&]],{n,0,10}]
  • Python
    def A366131(n): return (1<>1)<<1) if n else 0 # Chai Wah Wu, Nov 14 2023

Formula

From Chai Wah Wu, Nov 14 2023: (Start)
a(n) = 2*a(n-1) + 3*a(n-2) - 6*a(n-3) for n > 3.
G.f.: 2*x^2*(1 - x)/((2*x - 1)*(3*x^2 - 1)). (End)

A191582 Riordan matrix (1/(1-3*x^2),x/(1-x)).

Original entry on oeis.org

1, 0, 1, 3, 1, 1, 0, 4, 2, 1, 9, 4, 6, 3, 1, 0, 13, 10, 9, 4, 1, 27, 13, 23, 19, 13, 5, 1, 0, 40, 36, 42, 32, 18, 6, 1, 81, 40, 76, 78, 74, 50, 24, 7, 1, 0, 121, 116, 154, 152, 124, 74, 31, 8, 1, 243, 121, 237, 270, 306, 276, 198, 105, 39, 9, 1, 0, 364, 358, 507, 576, 582, 474, 303, 144, 48, 10, 1, 729, 364, 722, 865, 1083, 1158, 1056, 777, 447, 192, 58, 11, 1
Offset: 0

Views

Author

Emanuele Munarini, Jun 07 2011

Keywords

Comments

Row sums = A167936(n+1).
Diagonal sums = A191584.
Central coefficients = A191585.
Alternated row sums: Sum_{k=0..n} (-1)^(n-k)*T(n,k) = 3^floor(n/2) (A167936).
Binomial row sums: Sum_{k=0..n} binomial(n,k)*T(n,k) = central coefficients.

Examples

			Triangle begins:
1
0, 1
3, 1, 1
0, 4, 2, 1
9, 4, 6, 3, 1
0, 13, 10, 9, 4, 1
27, 13, 23, 19, 13, 5, 1
0, 40, 36, 42, 32, 18, 6, 1
81, 40, 76, 78, 74, 50, 24, 7, 1
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Sum[Binomial[n-2i-1,n-k-2i]3^i,{i,0,((n-k))/2}],{n,0,20},{k,0,n}]]
  • Maxima
    create_list(sum(binomial(n-2*i-1,n-k-2*i)*3^i,i,0,(n-k)/2),n,0,20,k,0,n);

Formula

T(n,k) = Sum_{i=0..(n-k)/2} binomial(n-2*i-1,n-k-2*i)*3^i.
Recurrence: T(n+1,k+1) = T(n,k) + T(n,k+1).

A167784 a(n) = 2^n - (1 - (-1)^n)*3^((n-1)/2).

Original entry on oeis.org

1, 0, 4, 2, 16, 14, 64, 74, 256, 350, 1024, 1562, 4096, 6734, 16384, 28394, 65536, 117950, 262144, 484922, 1048576, 1979054, 4194304, 8034314, 16777216, 32491550, 67108864, 131029082, 268435456, 527304974, 1073741824, 2118785834, 4294967296, 8503841150
Offset: 0

Views

Author

Paul Curtz, Nov 12 2009

Keywords

Comments

Binomial transform of A077917, the signed variant of A127864.

Crossrefs

Cf. A154383.

Programs

  • Maple
    seq(2^n - (1 - (-1)^n)*3^((n-1)/2), n=0..100); # Robert Israel, Apr 11 2019
  • Mathematica
    LinearRecurrence[{2, 3, -6}, {1, 0, 4}, 40] (* Harvey P. Dale, Nov 29 2011 *)

Formula

a(n) = A167936(n+1) - A167936(n).
a(2n) = A000302(n). a(2n+1) = 2*A005061(n).
a(n) = 2*a(n-1) + 3*a(n-2) - 6*a(n-3).
G.f.: (x-1)^2/((2*x-1)*(3*x^2-1)).
a(n+4) mod 9 = A153130(n+4) = A146501(n+2), n>=0.
E.g.f.: exp(2*x) - (2/sqrt(3))*sinh(sqrt(3)*x). - G. C. Greubel, Jun 27 2016

Extensions

Edited and extended by R. J. Mathar, Feb 27 2010
Incorrect b-file corrected by Robert Israel, Apr 11 2019
Showing 1-5 of 5 results.