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.

Previous Showing 21-30 of 49 results. Next

A258431 Sum over all peaks of Dyck paths of semilength n of the arithmetic mean of the x and y coordinates.

Original entry on oeis.org

0, 1, 5, 23, 102, 443, 1898, 8054, 33932, 142163, 592962, 2464226, 10209620, 42190558, 173962532, 715908428, 2941192472, 12065310083, 49428043442, 202249741418, 826671597572, 3375609654698, 13771567556012, 56138319705908, 228669994187432, 930803778591278
Offset: 0

Views

Author

Alois P. Heinz, May 29 2015

Keywords

Comments

A Dyck path of semilength n is a (x,y)-lattice path from (0,0) to (2n,0) that does not go below the x-axis and consists of steps U = (1,1) and D = (1,-1). A peak of a Dyck path is any lattice point visited between two consecutive steps UD.

Crossrefs

Programs

  • Magma
    A258431:= func< n | n eq 0 select 0 else (4^(n-1) + Factorial(2*n-1)/Factorial(n-1)^2)/2 >;
    [A258431(n): n in [0..40]]; // G. C. Greubel, Mar 18 2023
    
  • Maple
    a:= proc(n) option remember; `if`(n<3, [0, 1, 5][n+1],
           ((8*n-10)*a(n-1)-(16*n-24)*a(n-2))/(n-1))
        end:
    seq(a(n), n=0..30);
  • Mathematica
    a[0]=0; a[1]=1; a[2]=5;
    a[n_]:= a[n]= (2*(4*n-5)*a[n-1] - 8*(2*n-3)*a[n-2])/(n-1);
    Table[a[n], {n,0,30}] (* Jean-François Alcover, May 31 2018, from Maple *)
  • SageMath
    def A258431(n): return 0 if (n==0) else (4^(n-1) + factorial(2*n-1)/factorial(n-1)^2)/2
    [A258431(n) for n in range(41)] # G. C. Greubel, Mar 18 2023

Formula

G.f.: x*(1 + sqrt(1-4*x))/(2*sqrt(1-4*x)^3).
a(n) = (2*(4*n-5)*a(n-1) - 8*(2*n-3)*a(n-2))/(n-1) for n>2, a(0)=0, a(1)=1, a(2)=5.
a(n) = (4^(n-1) + (2*n-1)!/(n-1)!^2)/2 for n>0, a(0) = 0.
a(n) = (A000302(n-1) + A002457(n-1))/2 for n>0, a(0) = 0.
a(n) = (1/2)*binomial(2*n,n)*( 1 + 2*(n-1)/(n+1) + 3*(n-1)*(n-2)/((n+1)*(n+2)) + 4*(n-1)*(n-2)*(n-3)/((n+1)*(n+2)*(n+3)) + 5*(n-1)*(n-2)*(n-3)*(n-4)/((n+1)*(n+2)*(n+3)*(n+4)) + ...) for n >= 1. - Peter Bala, Feb 17 2022

A038806 Convolution of A008549 with A000302 (powers of 4).

Original entry on oeis.org

0, 1, 10, 69, 406, 2186, 11124, 54445, 259006, 1205790, 5519020, 24918306, 111250140, 492051124, 2159081192, 9409526397, 40766269774, 175707380630, 753876367356, 3221460111958, 13716223138388, 58210889582796
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [(n+3)*4^n -(n+2)*Binomial(2*n+3, n+1)/2: n in [0..25]]; // Vincenzo Librandi, Jun 09 2011
  • Mathematica
    CoefficientList[Series[x ((1 - Sqrt[1 - 4 x])/(2 x)/(1 - 4 x))^2, {x, 0, 40}], x] (* Vincenzo Librandi, Mar 29 2014 *)

Formula

a(n) = (n+3)*4^n -(n+2)*binomial(2*n+3, n+1)/2.
G.f.: x*(c(x)/(1-4*x))^2, where c(x) = g.f. for Catalan numbers A000108.
a(n+1), n >= 0 is convolution of A000346 with itself; a(n+1), n >= 0 is convolution of Catalan numbers A000108 C(n+1), n >= 0 with A002697; a(-1)=0.
Asymptotics: a(n) ~ 4^n*(n+1-4*sqrt(n/Pi)). - Fung Lam, Mar 28 2014
Recurrence: (n-1)*(n+1)*a(n) = 2*(n+1)*(4*n-3)*a(n-1) - 8*n*(2*n+1)*a(n-2). - Vaclav Kotesovec, Mar 28 2014

A042941 Convolution of Catalan numbers A000108 with A038845.

Original entry on oeis.org

1, 13, 110, 765, 4746, 27314, 149052, 781725, 3975730, 19730150, 95973956, 459145778, 2165937060, 10095323460, 46566906872, 212857023069, 965208806082, 4345780250270, 19442667426420, 86489687956518
Offset: 0

Views

Author

Keywords

Comments

Also convolution of A018218(n+1), n >= 0, with A000302 (powers of 4); also convolution of A000346 with A002697.

Programs

  • Mathematica
    CoefficientList[Series[(1-Sqrt[1-4*x])/(2*x*(1-4*x)^3), {x, 0, 20}], x] (* Vaclav Kotesovec, Apr 16 2014 *)

Formula

a(n) = binomial(n+3, 2)*(4^(n+1) - A000984(n+3)/A000984(2)) / 2.
G.f.: c(x)/(1-4*x)^3, where c(x) is the g.f. for Catalan numbers.
Recurrence: (n+1)*a(n) = 128*(1-2*n)*a(n-4) + 32*(8*n-1)*a(n-3) - 24*(4*n+1)*a(n-2) + 2*(8*n+5)*a(n-1). - Fung Lam, Apr 13 2014
a(n) ~ 2^(2*n)*(n^2 - 8*n^(3/2)/(3*sqrt(Pi))). - Fung Lam, Apr 13 2014
Recurrence: n*(n+1)*a(n) = 2*n*(4*n+9)*a(n-1) - 8*(n+2)*(2*n+3)*a(n-2). - Vaclav Kotesovec, Apr 16 2014

A336952 E.g.f.: 1 / (1 - x * exp(4*x)).

Original entry on oeis.org

1, 1, 10, 102, 1336, 22200, 443664, 10334128, 275060608, 8236914048, 274069953280, 10031110907136, 400520747437056, 17324601073921024, 807023462798608384, 40278407730378332160, 2144307919689898491904, 121291661335680615284736, 7264376142168665821741056
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 08 2020

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 18; CoefficientList[Series[1/(1 - x Exp[4 x]), {x, 0, nmax}], x] Range[0, nmax]!
    Join[{1}, Table[n! Sum[(4 (n - k))^k/k!, {k, 0, n}], {n, 1, 18}]]
    a[0] = 1; a[n_] := a[n] = Sum[Binomial[n, k] k 4^(k - 1) a[n - k], {k, 1, n}]; Table[a[n], {n, 0, 18}]
  • PARI
    seq(n)={ Vec(serlaplace(1 / (1 - x*exp(4*x + O(x^n))))) } \\ Andrew Howroyd, Aug 08 2020

Formula

a(n) = n! * Sum_{k=0..n} (4 * (n-k))^k / k!.
a(0) = 1; a(n) = Sum_{k=1..n} binomial(n,k) * k * 4^(k-1) * a(n-k).
a(n) ~ n! * (4/LambertW(4))^n / (1 + LambertW(4)). - Vaclav Kotesovec, Aug 09 2021

A133224 Let P(A) be the power set of an n-element set A and let B be the Cartesian product of P(A) with itself. Remove (y,x) from B when (x,y) is in B and x <> y and let R35 denote the reduced set B. Then a(n) = the sum of the sizes of the union of x and y for every (x,y) in R35.

Original entry on oeis.org

0, 2, 14, 78, 400, 1960, 9312, 43232, 197120, 885888, 3934720, 17307136, 75509760, 327182336, 1409343488, 6039920640, 25770065920, 109522223104, 463857647616, 1958507577344, 8246342451200
Offset: 0

Views

Author

Ross La Haye, Dec 30 2007, Jan 03 2008

Keywords

Comments

A082134 is the analogous sequence if "union" is replaced by "intersection" and A002697 is the analogous sequence if "union" is replaced by "symmetric difference". Here, X union Y = Y union X are considered as the same Cartesian product [Relation (37): U_Q(n) in document of Ross La Haye in reference], if we want to consider that X Union Y and Y Union X are two distinct Cartesian products, see A212698. [Bernard Schott, Jan 11 2013]

Examples

			a(2) = 14 because for P(A) = {{},{1},{2},{1,2}} |{} union {1}| = 1, |{} union {2}| = 1, |{} union {1,2}| = 2, |{1} union {2}| = 2, |{1} union {1,2}| = 2 and |{2} union {1,2}| = 2, |{} union {}| = 0, |{1} union {1}| = 1, |{2} union {2}| = 1, |{1,2} union {1,2}| = 2, which sums to 14.
		

Crossrefs

Programs

  • Magma
    [n*(2^(n-2) + 3*2^(2*n-3)): n in [0..30]]; // Vincenzo Librandi, Jun 10 2011
  • Mathematica
    LinearRecurrence[{12,-52,96,-64},{0,2,14,78},30] (* Harvey P. Dale, Jan 24 2019 *)

Formula

a(n) = n*(2^(n-2) + 3*2^(2*n-3)).
G.f.: 2*x*(7*x^2-5*x+1) / ((2*x-1)^2*(4*x-1)^2). [Colin Barker, Dec 10 2012]
E.g.f.: exp(2*x)*(1 + 3*exp(2*x))*x. - Stefano Spezia, Aug 04 2022

A300332 Integers of the form Sum_{j in 0:p-1} x^j*y^(p-j-1) where x and y are positive integers with max(x, y) >= 2 and p is some prime.

Original entry on oeis.org

3, 4, 7, 12, 13, 19, 21, 27, 28, 31, 37, 39, 43, 48, 49, 52, 57, 61, 63, 67, 73, 75, 76, 79, 80, 84, 91, 93, 97, 103, 108, 109, 111, 112, 117, 121, 124, 127, 129, 133, 139, 147, 148, 151, 156, 157, 163, 169, 171, 172, 175, 181, 183, 189, 192, 193, 196, 199
Offset: 1

Views

Author

Peter Luschny, Mar 03 2018

Keywords

Comments

Equivalently these are the integers represented by a cyclotomic binary form Phi_p(x,y) where p is prime and x and y are positive integers with max(x,y) >= 2. A cyclotomic binary form (over Z) is a homogeneous polynomial in two variables of the form f(x, y) = y^phi(k)*Phi(k, x/y) where Phi(k, z) is a cyclotomic polynomial of index k and phi is Euler's totient function.
An efficient and safe calculation of this sequence requires a precise knowledge of the range of possible solutions of the associated Diophantine equations. The bounds used in the Julia program below were specified by Fouvry, Levesque and Waldschmidt.

Examples

			Let p denote an odd prime. Subsequences are numbers of the form
2^p - 1,         (A001348) (x = 1, y = 2) (Mersenne numbers),
p*2^(p - 1),     (A299795) (x = 2, y = 2),
(3^p - 1)/2,     (A003462) (x = 1, y = 3),
3^p - 2^p,       (A135171) (x = 2, y = 3),
p*3^(p - 1),     (A027471) (x = 3, y = 3),
(4^p - 1)/3,     (A002450) (x = 1, y = 4),
2^(p-1)*(2^p-1), (A006516) (x = 2, y = 4),
4^p - 3^p,       (A005061) (x = 3, y = 4),
p*4^(p - 1),     (A002697) (x = 4, y = 4),
(p^p-1)/(p-1),   (A023037),
p^p,             (A000312, A051674).
.
The generalized cuban primes A007645 are a subsequence, as are the quintan primes A002649, the septan primes and so on.
All primes in this sequence less than 1031 are generalized cuban primes. 1031 is an element because 1031 = f(5,2) where f(x,y) = x^4 + y*x^3 + y^2*x^2 + y^3*x + y^4, however 1031 is not a cuban prime because 1030 is not divisible by 6.
		

Crossrefs

Programs

  • Julia
    using Primes
    function isA300332(n)
        logn = log(n)^1.161
        K = Int(floor(5.383*logn))
        M = Int(floor(2*(n/3)^(1/2)))
        k = 2
        while k <= K
            if k == 7
                K = Int(floor(4.864*logn))
                M = Int(ceil(2*(n/11)^(1/4)))
            end
            for y in 2:M, x in 1:y
                r = x == y ? k*y^(k - 1) : div(x^k - y^k, x - y)
                n == r && return true
            end
            k = nextprime(k+1)
        end
        return false
    end
    A300332list(upto) = [n for n in 1:upto if isA300332(n)]
    println(A300332list(200))

A104002 Triangle T(n,k) read by rows: number of permutations in S_n avoiding all k-length patterns that start with 1 except one fixed pattern and containing it exactly once.

Original entry on oeis.org

1, 2, 1, 3, 4, 1, 4, 12, 6, 1, 5, 32, 27, 8, 1, 6, 80, 108, 48, 10, 1, 7, 192, 405, 256, 75, 12, 1, 8, 448, 1458, 1280, 500, 108, 14, 1, 9, 1024, 5103, 6144, 3125, 864, 147, 16, 1, 10, 2304, 17496, 28672, 18750, 6480, 1372, 192, 18, 1, 11, 5120, 59049, 131072
Offset: 2

Views

Author

Ralf Stephan, Feb 26 2005

Keywords

Comments

T(n+k,k+1) = total number of occurrences of any given letter in all possible n-length words on a k-letter alphabet. For example, with the 2 letter alphabet {0,1} there are 4 possible 2-length words: {00,01,10,11}. The letter 0 occurs 4 times altogether, as does the letter 1. T(4,3) = 4. - Ross La Haye, Jan 03 2007
Table T(n,k) = k*n^(k-1) n,k > 0 read by antidiagonals. - Boris Putievskiy, Dec 17 2012

Examples

			Triangle begins:
  1;
  2,   1;
  3,   4,    1;
  4,  12,    6,    1;
  5,  32,   27,    8,   1;
  6,  80,  108,   48,  10,   1;
  7, 192,  405,  256,  75,  12,  1;
  8, 448, 1458, 1280, 500, 108, 14, 1;
		

Crossrefs

Programs

  • Mathematica
    Table[(n - k + 1) (k - 1)^(n - k), {n, 2, 12}, {k, 2, n}] // Flatten (* Michael De Vlieger, Aug 22 2018 *)

Formula

T(n, k) = (n-k+1) * (k-1)^(n-k), k<=n.
As a linear array, the sequence is a(n) = A004736(n)*A002260(n)^(A004736(n)-1) or a(n) = ((t*t+3*t+4)/2-n)*(n-(t*(t+1)/2))^((t*t+3*t+4)/2-n-1), where t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 17 2012

A119733 Offsets of the terms of the nodes of the reverse Collatz function.

Original entry on oeis.org

0, 1, 2, 5, 4, 7, 10, 19, 8, 11, 14, 23, 20, 29, 38, 65, 16, 19, 22, 31, 28, 37, 46, 73, 40, 49, 58, 85, 76, 103, 130, 211, 32, 35, 38, 47, 44, 53, 62, 89, 56, 65, 74, 101, 92, 119, 146, 227, 80, 89, 98, 125, 116, 143, 170, 251, 152, 179, 206, 287, 260, 341, 422, 665, 64, 67
Offset: 0

Views

Author

William Entriken, Jun 14 2006

Keywords

Comments

Create a binary tree starting with x. To follow 0 from the root, apply f(x)=2x. To follow 1, apply g(x)=(2x-1)/3. For example, starting with x, the string 010 {also known as f(g(f(x)))}, you would get (8x-2)/3. These expressions represent the reverse Collatz function and will provide numbers whose Collatz path may include x. These expressions will all be of the form (2^a*x-b)/3^c. This sequence concerns b. What makes b interesting is that if you draw the tree, each level of the tree will have the same sequence of values for b. The root of the tree x, can be written as (2^0*x-0)/3^0, which has the first value for b. Each subsequent level contains twice as many values of b.
This sequence is 0 followed by a permutation of A213539, and therefore consists of 0 plus the elements of A116640 multiplied by 2^k, where k >= 0. E.g., 1, 5, 7, 19 becomes 0, 2^0*1, 2^1*1, 2^0*5, 2^2*1, 2^0*7, 2^1*5, 2^0*19, ... - Joe Slater, Dec 19 2016
When this sequence is arranged as an irregular triangle the sum of each row a(2^k)...a(2^(k+1)-1) equals A081039(2^k). The cumulative sum from a(0) to a(2^k-1) equals A002697(k). - Joe Slater, Apr 12 2018

Examples

			a(1) = 1 = 2 * 0 + 3^0 since 0 written in binary contains no 1's.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) `if`(n=0, 0, `if`(irem(n, 2, 'r')=0, 0,
          3^add(i, i=convert(r, base, 2)))+2*a(r))
        end:
    seq(a(n), n=0..127);  # Alois P. Heinz, Aug 13 2017
  • Mathematica
    a[0] := 0; a[n_?OddQ] := 2a[(n - 1)/2] + 3^Plus@@IntegerDigits[(n - 1)/2, 2]; a[n_?EvenQ] := 2a[n/2]; Table[a[n], {n, 0, 65}] (* Alonso del Arte, Apr 21 2011 *)
  • PARI
    a(n) = my(ret=0); if(n, for(i=0,logint(n,2), if(bittest(n,i), ret=3*ret+1<Kevin Ryde, Oct 22 2021
  • Perl
    # call with n to get 2^n values
    $depth=shift; sub funct { my ($i, $b, $c) = @_; if ($i < $depth) { funct($i+1, $b*2, $c); funct($i+1, 2*$b+$c, $c*3); } else { print "$b, "; } } funct(0, 0, 1); print " ";
    
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def a(n): return 0 if n==0 else 2*a((n - 1)//2) + 3**bin((n - 1)//2).count('1') if n%2 else 2*a(n//2)
    print([a(n) for n in range(131)]) # Indranil Ghosh, Aug 13 2017
    

Formula

a(0) = 0, a(2*n + 1) = 2*a(n) + 3^wt(n) = 2*a(n) + A048883(n), a(2*n) = 2*a(n), where wt(n) = A000120(n) = the number 1's in the binary representation of n.
a(k) = [z^k] 1 + (1/(1-z)) * Sum_{s=0..n-1} 2^s*z^(2^s)*(1 - z^(2^s)) * Product_{r=s+1..n-1} (1 + 3*z^(2^r)), for 0 < k <= 2^n-1. - Wolfgang Hintze, Jul 28 2017
a(n) = Sum_{i=0..k} 2^e[i] * 3^i where binary expansion n = 2^e[0] + 2^e[1] + ... + 2^e[k] with descending e[0] > e[1] > ... > e[k] (A272011). [Martín Chabrera lemma 6.1, adapting index i] - Kevin Ryde, Oct 22 2021

A128235 Triangle read by rows: T(n,k) is the number of sequences of length n on the alphabet {0,1,2,3}, containing k subsequences 00 (0<=k<=n-1).

Original entry on oeis.org

1, 4, 15, 1, 57, 6, 1, 216, 33, 6, 1, 819, 162, 36, 6, 1, 3105, 756, 189, 39, 6, 1, 11772, 3402, 945, 216, 42, 6, 1, 44631, 14931, 4536, 1143, 243, 45, 6, 1, 169209, 64314, 21168, 5778, 1350, 270, 48, 6, 1, 641520, 273051, 96633, 28323, 7128, 1566, 297, 51
Offset: 0

Views

Author

Emeric Deutsch, Feb 27 2007

Keywords

Comments

Row n has n terms (n>=1). T(n,0) = A125145(n). Sum(k*T(n,k), k=0..n-1) = (n-1)*4^(n-2) = A002697(n-1).

Examples

			T(4,2) = 6 because we have 0001, 0002, 0003, 1000, 2000 and 3000.
Triangle starts:
1;
4;
15,    1;
57,    6,  1;
216,  33,  6, 1;
819, 162, 36, 6, 1;
		

Crossrefs

Programs

  • Maple
    G:=(1+z-t*z)/(1-3*z-3*z^2-t*z+3*t*z^2): Gser:=simplify(series(G,z=0,14)): for n from 0 to 11 do P[n]:=sort(coeff(Gser,z,n)) od: 1; for n from 1 to 11 do seq(coeff(P[n],t,j),j=0..n-1) od; # yields sequence in triangular form

Formula

G.f.: (1+z-tz)/(1-3z-3z^2-tz+3tz^2).

A174720 Triangle T(n, k, q) = (1-q^n)*( binomial(n, k) - 1 ) + 1, with q = 4, read by rows.

Original entry on oeis.org

1, 1, 1, 1, -14, 1, 1, -125, -125, 1, 1, -764, -1274, -764, 1, 1, -4091, -9206, -9206, -4091, 1, 1, -20474, -57329, -77804, -57329, -20474, 1, 1, -98297, -327659, -557021, -557021, -327659, -98297, 1, 1, -458744, -1769444, -3604424, -4521914, -3604424, -1769444, -458744, 1
Offset: 0

Views

Author

Roger L. Bagula, Mar 28 2010

Keywords

Comments

The row sums of this class of sequences, for varying q, is given by Sum_{k=0..n} T(n, k, q) = q^n * (n+1) + 2^n * (1 - q^n). - G. C. Greubel, Feb 09 2021

Examples

			Triangle begins as:
  1;
  1,       1;
  1,     -14,        1;
  1,    -125,     -125,        1;
  1,    -764,    -1274,     -764,        1;
  1,   -4091,    -9206,    -9206,    -4091,        1;
  1,  -20474,   -57329,   -77804,   -57329,   -20474,        1;
  1,  -98297,  -327659,  -557021,  -557021,  -327659,   -98297,       1;
  1, -458744, -1769444, -3604424, -4521914, -3604424, -1769444, -458744, 1;
		

Crossrefs

Cf. A000012 (q=1), A174718 (q=2), A174719 (q=3), this sequence (q=4).

Programs

  • Magma
    T:= func< n,k,q | 1 + (1-q^n)*(Binomial(n,k) -1) >;
    [T(n,k,4): k in [0..n], n in [0..12]]; // G. C. Greubel, Feb 09 2021
  • Mathematica
    T[n_, k_, q_]:= 1 +(1-q^n)*(Binomial[n, k] -1);
    Table[T[n,k,4], {n,0,12}, {k,0,n}]//Flatten
  • Sage
    def T(n,k,q): return 1 + (1-q^n)*(binomial(n,k) - 1)
    flatten([[T(n,k,4) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 09 2021
    

Formula

T(n, k, q) = (1-q^n)*( binomial(n, k) - 1 ) + 1, with q=4.
Sum_{k=0..n} T(n, k, 4) = 4^n*(n+1) + 2^n*(1 - 4^n) = A002697(n+1) - A248217(n). - G. C. Greubel, Feb 09 2021

Extensions

Edited by G. C. Greubel, Feb 09 2021
Previous Showing 21-30 of 49 results. Next