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

A027649 a(n) = 2*(3^n) - 2^n.

Original entry on oeis.org

1, 4, 14, 46, 146, 454, 1394, 4246, 12866, 38854, 117074, 352246, 1058786, 3180454, 9549554, 28665046, 86027906, 258149254, 774578834, 2323998646, 6972520226, 20918609254, 62757924914, 188277969046, 564842295746, 1694543664454, 5083664547794, 15251060752246
Offset: 0

Views

Author

Keywords

Comments

Poly-Bernoulli numbers B_n^(k) with k=-2.
Binomial transform of A007051, if both sequences start at 0. Binomial transform of A000225(n+1). - Paul Barry, Mar 24 2003
Euler expands (1-z)/(1-5z+6z^2) and finds the general term. Section 226 of the Introductio indicates that he could have written down the recursion relation: a(n) = 5 a(n-1)-6 a(n-2). - V. Frederick Rickey (fred-rickey(AT)usma.edu), Feb 10 2006
Let R be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xRy if x is a subset of y or y is a subset of x. Then a(n) = |R|. - Ross La Haye, Dec 22 2006
With regard to the comment by Ross La Haye: For proper subsets see A056182. - For nonempty subsets see A091344. - For nonempty proper subsets see a(n+1) in A260217. - Manfred Boergens, Aug 02 2023
If x, y are two n-bit binary strings then a(n) gives the number of pairs (x,y) such that XOR(x, y) = ABS(x - y). - Ramasamy Chandramouli, Feb 15 2009
Equals row sums of the triangular version of A038573. - Gary W. Adamson, Jun 04 2009
Inverse binomial transform of A085350. - Paul Curtz, Nov 14 2009
Related to the number of even a's in a nontrivial cycle (should one exist) in the 3x+1 Problem, where a <= floor(log_2(2*(3^n) - 2^n)). The value n correlates to the number of odds in such a nontrivial cycle. See page 1288 of Crandall's paper. Also, this relation gives another proof that the number of odds divided by the number of evens in a nontrivial cycle is bounded by log 2 / log 3 (this observation does not resolve the finite cycles conjecture as the value could be arbitrarily close to this bound). However, the same argument gives that log 2 / log 3 is less than or equal to the number of odds divided by the number of evens in a divergent sequence (should one exist), as log 2 / log 3 is the limit value for a cycle of an arbitrarily large length, where the length is given by the value n. - Jeffrey R. Goodwin, Aug 04 2011
Row sums of Riordan triangle A106516. - Wolfdieter Lang, Jan 09 2015
Number of restricted barred preferential arrangements having 3 bars in which the sections are all restricted sections such that (for fixed sections i and j) section i or section j is empty. - Sithembele Nkonkobe, Oct 12 2015
This is also row 2 of A281891: for n >= 1, when consecutive positive integers are written as a product of primes in nondecreasing order, a factor of 2 or 3 occurs in n-th position a(n) times out of every 6^n. - Peter Munn, May 18 2017
Also row sums of A124929. - Omar E. Pol, Jun 15 2017
This is the sum of A318921(n) for n in the range 2^(k+1) to 2^(k+2)-1. See A318921 for proof. - N. J. A. Sloane, Sep 25 2018
a(n) is also the number of acyclic orientations of the complete bipartite graph K_{2,n}. - Vincent Pilaud, Sep 15 2020
a(n-1) is also the number of n-digit numbers whose largest decimal digit is 2. - Stefano Spezia, Nov 15 2023

References

  • Leonhard Euler, Introductio in analysin infinitorum (1748), section 216.

Crossrefs

Row n = 2 of array A099594.
Also occurs as a row, column, diagonal or as row sums in A038573, A085870, A090888, A106516, A217764, A281891.

Programs

  • Haskell
    a027649 n = a027649_list !! n
    a027649_list = map fst $ iterate (\(u, v) -> (3 * u + v, 2 * v)) (1, 1)
    -- Reinhard Zumkeller, Jun 09 2013
    
  • Magma
    [2*(3^n)-2^n: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    a(n, k):= (-1)^n*sum( (-1)^'m'*'m'!*Stirling2(n,'m')/('m'+1)^k,'m'=0..n);
    seq(a(n, -2), n=0..30);
  • Mathematica
    Table[2(3^n)-2^n,{n,0,30}] (* or *) LinearRecurrence[ {5,-6},{1,4},31]  (* Harvey P. Dale, Apr 22 2011 *)
  • PARI
    a(n)=2*(3^n)-2^n \\ Charles R Greathouse IV, Jul 16 2011
    
  • PARI
    Vec((1-x)/((1-2*x)*(1-3*x)) + O(x^50)) \\ Altug Alkan, Oct 12 2015
    
  • SageMath
    [2*(3^n - 2^(n-1)) for n in (0..30)] # G. C. Greubel, Aug 01 2022

Formula

G.f.: (1-x)/((1-2*x)*(1-3*x)).
a(n) = 3*a(n-1) + 2^(n-1), with a(0) = 1.
a(n) = Sum_{k=0..n} binomial(n, k)*(2^(k+1) - 1). - Paul Barry, Mar 24 2003
Partial sums of A053581. - Paul Barry, Jun 26 2003
Main diagonal of array (A085870) defined by T(i, 1) = 2^i - 1, T(1, j) = 2^j - 1, T(i, j) = T(i-1, j) + T(i-1, j-1). - Benoit Cloitre, Aug 05 2003
a(n) = A090888(n, 3). - Ross La Haye, Sep 21 2004
a(n) = Sum_{k=0..n} binomial(n+2, k+1)*Sum_{j=0..floor(k/2)} A001045(k-2j). - Paul Barry, Apr 17 2005
a(n) = Sum_{k=0..n} Sum_{j=0..n} binomial(n,j)*binomial(j+1,k+1). - Paul Barry, Sep 18 2006
a(n) = A166060(n+1)/6. - Philippe Deléham, Oct 21 2009
a(n) = 5*a(n-1) - 6*a(n-2), a(0)=1, a(1)=4. - Harvey P. Dale, Apr 22 2011
a(n) = A217764(n,2). - Ross La Haye, Mar 27 2013
For n>0, a(n) = 3 * a(n-1) + 2^(n-1) = 2 * (a(n-1) + 3^(n-1)). - J. Conrad, Oct 29 2015
for n>0, a(n) = 2 * (1 + 2^(n-2) + Sum_{x=1..n-2} Sum_{k=0..x-1} (binomial(x-1,k)*(2^(k+1) + 2^(n-x+k)))). - J. Conrad, Dec 10 2015
E.g.f.: exp(2*x)*(2*exp(x) - 1). - Stefano Spezia, May 18 2024

Extensions

Better formulas from David W. Wilson and Michael Somos
Incorrect formula removed by Charles R Greathouse IV, Mar 18 2010
Duplications (due to corrections to A numbers) removed by Peter Munn, Jun 15 2017

A193649 Q-residue of the (n+1)st Fibonacci polynomial, where Q is the triangular array (t(i,j)) given by t(i,j)=1. (See Comments.)

Original entry on oeis.org

1, 1, 3, 5, 15, 33, 91, 221, 583, 1465, 3795, 9653, 24831, 63441, 162763, 416525, 1067575, 2733673, 7003971, 17938661, 45954543, 117709185, 301527355, 772364093, 1978473511
Offset: 0

Views

Author

Clark Kimberling, Aug 02 2011

Keywords

Comments

Suppose that p=p(0)*x^n+p(1)*x^(n-1)+...+p(n-1)*x+p(n) is a polynomial of positive degree and that Q is a sequence of polynomials: q(k,x)=t(k,0)*x^k+t(k,1)*x^(k-1)+...+t(k,k-1)*x+t(k,k), for k=0,1,2,... The Q-downstep of p is the polynomial given by D(p)=p(0)*q(n-1,x)+p(1)*q(n-2,x)+...+p(n-1)*q(0,x)+p(n).
Since degree(D(p))
Example: let p(x)=2*x^3+3*x^2+4*x+5 and q(k,x)=(x+1)^k.
D(p)=2(x+1)^2+3(x+1)+4(1)+5=2x^2+7x+14
D(D(p))=2(x+1)+7(1)+14=2x+23
D(D(D(p)))=2(1)+23=25;
the Q-residue of p is 25.
We may regard the sequence Q of polynomials as the triangular array formed by coefficients:
t(0,0)
t(1,0)....t(1,1)
t(2,0)....t(2,1)....t(2,2)
t(3,0)....t(3,1)....t(3,2)....t(3,3)
and regard p as the vector (p(0),p(1),...,p(n)). If P is a sequence of polynomials [or triangular array having (row n)=(p(0),p(1),...,p(n))], then the Q-residues of the polynomials form a numerical sequence.
Following are examples in which Q is the triangle given by t(i,j)=1 for 0<=i<=j:
Q.....P...................Q-residue of P
1.....1...................A000079, 2^n
1....(x+1)^n..............A007051, (1+3^n)/2
1....(x+2)^n..............A034478, (1+5^n)/2
1....(x+3)^n..............A034494, (1+7^n)/2
1....(2x+1)^n.............A007582
1....(3x+1)^n.............A081186
1....(2x+3)^n.............A081342
1....(3x+2)^n.............A081336
1.....A040310.............A193649
1....(x+1)^n+(x-1)^n)/2...A122983
1....(x+2)(x+1)^(n-1).....A057198
1....(1,2,3,4,...,n)......A002064
1....(1,1,2,3,4,...,n)....A048495
1....(n,n+1,...,2n).......A087323
1....(n+1,n+2,...,2n+1)...A099035
1....p(n,k)=(2^(n-k))*3^k.A085350
1....p(n,k)=(3^(n-k))*2^k.A090040
1....A008288 (Delannoy)...A193653
1....A054142..............A101265
1....cyclotomic...........A193650
1....(x+1)(x+2)...(x+n)...A193651
1....A114525..............A193662
More examples:
Q...........P.............Q-residue of P
(x+1)^n...(x+1)^n.........A000110, Bell numbers
(x+1)^n...(x+2)^n.........A126390
(x+2)^n...(x+1)^n.........A028361
(x+2)^n...(x+2)^n.........A126443
(x+1)^n.....1.............A005001
(x+2)^n.....1.............A193660
A094727.....1.............A193657
(k+1).....(k+1)...........A001906 (even-ind. Fib. nos.)
(k+1).....(x+1)^n.........A112091
(x+1)^n...(k+1)...........A029761
(k+1)......A049310........A193663
(In these last four, (k+1) represents the triangle t(n,k)=k+1, 0<=k<=n.)
A051162...(x+1)^n.........A193658
A094727...(x+1)^n.........A193659
A049310...(x+1)^n.........A193664
Changing the notation slightly leads to the Mathematica program below and the following formulation for the Q-downstep of p: first, write t(n,k) as q(n,k). Define r(k)=Sum{q(k-1,i)*r(k-1-i) : i=0,1,...,k-1} Then row n of D(p) is given by v(n)=Sum{p(n,k)*r(n-k) : k=0,1,...,n}.

Examples

			First five rows of Q, coefficients of Fibonacci polynomials (A049310):
1
1...0
1...0...1
1...0...2...0
1...0...3...0...1
To obtain a(4)=15, downstep four times:
D(x^4+3*x^2+1)=(x^3+x^2+x+1)+3(x+1)+1: (1,1,4,5) [coefficients]
DD(x^4+3*x^2+1)=D(1,1,4,5)=(1,2,11)
DDD(x^4+3*x^2+1)=D(1,2,11)=(1,14)
DDDD(x^4+3*x^2+1)=D(1,14)=15.
		

Crossrefs

Cf. A192872 (polynomial reduction), A193091 (polynomial augmentation), A193722 (the upstep operation and fusion of polynomial sequences or triangular arrays).

Programs

  • Mathematica
    q[n_, k_] := 1;
    r[0] = 1; r[k_] := Sum[q[k - 1, i] r[k - 1 - i], {i, 0, k - 1}];
    f[n_, x_] := Fibonacci[n + 1, x];
    p[n_, k_] := Coefficient[f[n, x], x, k]; (* A049310 *)
    v[n_] := Sum[p[n, k] r[n - k], {k, 0, n}]
    Table[v[n], {n, 0, 24}]    (* A193649 *)
    TableForm[Table[q[i, k], {i, 0, 4}, {k, 0, i}]]
    Table[r[k], {k, 0, 8}]  (* 2^k *)
    TableForm[Table[p[n, k], {n, 0, 6}, {k, 0, n}]]

Formula

Conjecture: G.f.: -(1+x)*(2*x-1) / ( (x-1)*(4*x^2+x-1) ). - R. J. Mathar, Feb 19 2015

A167936 a(n) = 2^n - A108411(n).

Original entry on oeis.org

0, 1, 1, 5, 7, 23, 37, 101, 175, 431, 781, 1805, 3367, 7463, 14197, 30581, 58975, 124511, 242461, 504605, 989527, 2038103, 4017157, 8211461, 16245775, 33022991, 65514541, 132623405, 263652487, 532087943, 1059392917, 2133134741, 4251920575, 8546887871
Offset: 0

Author

Paul Curtz, Nov 15 2009

Keywords

Comments

The binomial transform of (0 followed by A077917).

Programs

  • Magma
    I:=[0,1,1]; [n le 3 select I[n] else 2*Self(n-1) +3*Self(n-2) -6*Self(n-3): n in [1..40]]; // G. C. Greubel, Sep 10 2023
    
  • Mathematica
    LinearRecurrence[{2,3,-6}, {0,1,1}, 50] (* G. C. Greubel, Jul 01 2016 *)
  • Python
    def A167936(n): return (1<>1) # Chai Wah Wu, Nov 14 2023
  • SageMath
    def A167936(n): return 2^n - ((n+1)%2)*3^(n//2) - (n%2)*3^((n-1)//2)
    [A167936(n) for n in range(41)] # G. C. Greubel, Sep 10 2023
    

Formula

a(n) = A167762(n+1) - A167762(n).
a(n+1) - a(n) = A167784(n).
a(n) = 2*a(n-1) + 3*a(n-2) - 6*a(n-3).
G.f.: x*(1-x)/((1-2*x)*(1-3*x^2)).
a(2n) = A005061(n), a(2n+1) = A085350(n).
a(n) - 2*a(n-1) = (-1)^(n+1)*A083658(n+1).
From G. C. Greubel, Sep 10 2023: (Start)
a(n) = (1/2)*(2^(n+1) - (1+(-1)^n)*3^(n/2) - (1-(-1)^n)*3^((n-1)/2)).
E.g.f.: exp(2*x) - cosh(sqrt(3)*x) - (1/sqrt(3))*sinh(sqrt(3)*x). (End)

Extensions

Edited and extended by R. J. Mathar, Feb 27 2010

A317825 a(1) = 1, a(n) = 3*a(n/2) if n is even, a(n) = n - a(n-1) if n is odd.

Original entry on oeis.org

1, 3, 0, 9, -4, 0, 7, 27, -18, -12, 23, 0, 13, 21, -6, 81, -64, -54, 73, -36, 57, 69, -46, 0, 25, 39, -12, 63, -34, -18, 49, 243, -210, -192, 227, -162, 199, 219, -180, -108, 149, 171, -128, 207, -162, -138, 185, 0, 49, 75, -24, 117, -64, -36, 91, 189, -132, -102, 161, -54, 115, 147, -84, 729, -664, -630, 697, -576
Offset: 1

Author

Altug Alkan and Antti Karttunen, Aug 22 2018

Keywords

Comments

Sequence has an elegant fractal-like scatter plot, situated (approximately) symmetrically over X-axis.
This sequence can also be generalized with some modifications. Let f_k(1) = 1. f_k(n) = floor(k*a(n/2)) if n is even, f_k(n) = n - f_k(n-1) if n is odd. This sequence is a(n) = f_k(n) where k = 3. For example, if k is e (A001113), then recurrence also provides a curious fractal-like structure that has some similarities with a(n). See Links section for their plots.
A scatterplot of (Sum_{i = 1..2*n} a(i)) - n^2 gives a similar plot as for a(n). - A.H.M. Smeets, Sep 01 2018

Crossrefs

Programs

  • Magma
    [n eq 1 select 1 else IsEven(n) select 3*Self(n div 2) else n- Self(n-1): n in [1..80]]; // Vincenzo Librandi, Sep 03 2018
  • Mathematica
    Nest[Append[#1, If[EvenQ[#2], 3 #1[[#2/2]], #2 - #1[[-1]] ]] & @@ {#, Length@ # + 1} &, {1}, 67] (* Michael De Vlieger, Aug 22 2018 *)
  • PARI
    A317825(n) = if(1==n,n,if(!(n%2),3*A317825(n/2),n-A317825(n-1)));
    
  • Python
    aa = [0]
    a,n = 0,0
    while n < 16383:
        n = n+1
        if n%2 == 0:
            a = 3*aa[n//2]
        else:
            a = n-a
        aa = aa+[a]
        print(n,a) # A.H.M. Smeets, Sep 01 2018
    

Formula

From A.H.M. Smeets, Sep 01 2018: (Start)
Sum_{i = 1..2*n-1} a(i) = n^2 for n >= 0.
Sum_{i = 1..2*n} a(i) = 3*a(n) + n^2 for n >= 0, a(0) = 0.
Sum_{i = 1..36*2^n} a(i) = 162*A085350(n) for n >= 0.
Lim_{n -> infinity} a(n)/n^2 = 0.
Lim_{n -> infinity} (Sum_{i = 1..n} a(i))/n^2 = 1/4. (End)

A085351 Expansion of (1-3*x)/((1-4*x)*(1-5*x)).

Original entry on oeis.org

1, 6, 34, 186, 994, 5226, 27154, 139866, 715714, 3644106, 18482674, 93461946, 471504034, 2374297386, 11938595794, 59961414426, 300880813954, 1508699037066, 7560675054514, 37872094749306, 189635351653474
Offset: 0

Author

Paul Barry, Jun 24 2003

Keywords

Comments

Binomial transform of A085350. Second binomial transform of poly-Bernoulli numbers A027649.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1-3x)/((1-4x)(1-5x)),{x,0,20}],x] (* or *) LinearRecurrence[{9,-20},{1,6},30] (* Harvey P. Dale, Jan 07 2022 *)
  • PARI
    Vec((1 - 3*x) / ((1 - 4*x)*(1 - 5*x)) + O(x^25)) \\ Colin Barker, Jun 25 2020

Formula

G.f.: (1-3*x)/((1-4*x)*(1-5*x)).
a(n) = 2*5^n - 4^n.
a(n) = 9*a(n-1) - 20*a(n-2) for n>1. - Colin Barker, Jun 25 2020

A081674 Generalized Poly-Bernoulli numbers.

Original entry on oeis.org

0, 1, 6, 29, 130, 561, 2366, 9829, 40410, 164921, 669526, 2707629, 10919090, 43942081, 176565486, 708653429, 2841788170, 11388676041, 45619274246, 182670807229, 731264359650, 2926800830801, 11712433499806, 46865424529029, 187508769705530, 750176293590361, 3001128818666166
Offset: 0

Author

Paul Barry, Mar 28 2003

Keywords

Comments

Binomial transform of A027649. Inverse binomial transform of A081675.
With offset 1, partial sums of A085350. - Paul Barry, Jun 24 2003
Number of walks of length 2n+2 between two nodes at distance 4 in the cycle graph C_12. - Herbert Kociemba, Jul 05 2004

Crossrefs

Programs

  • Magma
    [((4^(n+1)-1)/3-3^n)/2: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
  • Mathematica
    Join[{a=0,b=1},Table[c=7*b-12*a-1;a=b;b=c,{n,60}]] (* Vladimir Joseph Stephan Orlovsky, Jan 19 2011 *)
    CoefficientList[Series[(x(1-2x))/((1-x)(1-3x)(1-4x)),{x,0,30}],x] (* or *) LinearRecurrence[{8,-19,12},{0,1,6},30] (* Harvey P. Dale, Nov 28 2018 *)

Formula

a(n) = ((4^(n+1) - 1)/3 - 3^n)/2 = (4*4^n - 3*3^n - 1)/6.
a(n) = (A002450(n+1) + A000244(n))/2.
G.f.: x*(1-2*x)/((1-x)*(1-3*x)*(1-4*x)).
From Elmo R. Oliveira, Aug 29 2024: (Start)
E.g.f.: exp(x)*(4*exp(3*x) - 3*exp(2*x) - 1)/6.
a(n) = 8*a(n-1) - 19*a(n-2) + 12*a(n-3) for n > 2. (End)

A093834 Expansion of (1-2x)^2/((1-3x)(1-4x)).

Original entry on oeis.org

1, 3, 13, 55, 229, 943, 3853, 15655, 63349, 255583, 1028893, 4135255, 16600069, 66577423, 266841133, 1068958855, 4280618389, 17136822463, 68590336573, 274490486455, 1098349366309, 4394559726703, 17581725691213, 70337363118055
Offset: 0

Author

Paul Barry, Apr 17 2004

Keywords

Comments

Binomial transform of A093833.

Crossrefs

Cf. A085350.

Programs

  • Mathematica
    CoefficientList[Series[(1-2x)^2/((1-3x)(1-4x)),{x,0,30}],x] (* or *) Join[{1},LinearRecurrence[{7,-12},{3,13},30]] (* Harvey P. Dale, Dec 27 2011 *)

Formula

a(n)=4^n-3^n/3-0^n/3. a(n+1)=4^(n+1)-3^n, n>0.
a(0)=1, a(1)=3, a(2)=13, a(n)=7*a(n-1)-12*a(n-2) [From Harvey P. Dale, Dec 27 2011]
Showing 1-7 of 7 results.