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

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

Original entry on oeis.org

1, 4, 4, 16, 16, 64, 64, 256, 256, 1024, 1024, 4096, 4096, 16384, 16384, 65536, 65536, 262144, 262144, 1048576, 1048576, 4194304, 4194304, 16777216, 16777216, 67108864, 67108864, 268435456, 268435456, 1073741824, 1073741824, 4294967296
Offset: 0

Views

Author

Keywords

Comments

Number of palindromes of length n using a maximum of four different symbols.
Number of achiral rows of n colors using up to four colors. - Robert A. Russell, Nov 09 2018
Interleaving of A000302 and 4*A000302.
Unsigned version of A141125.
Binomial transform is A164907. Second binomial transform is A164908. Third binomial transform is A057651. Fourth binomial transform is A016129.

Examples

			At length n=1 there are a(1)=4 palindromes, A, B, C, D.
At length n=2, there are a(2)=4 palindromes, AA, BB, CC, DD.
At length n=3, there are a(3)=16 palindromes, AAA, BBB, CCC, DDD, ABA, BAB, ... , CDC, DCD.
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column k=4 of A321391.
Cf. A016116.
Essentially the same as A213173.
Cf. A000302 (oriented), A032121 (unoriented), A032087(n>1) (chiral).

Programs

  • Magma
    [ (3*2^n-(-2)^n)/2: n in [0..31] ];
    
  • Magma
    [4^Floor((n+1)/2): n in [0..40]]; // Vincenzo Librandi, Aug 16 2011
    
  • Mathematica
    Table[4^Ceiling[n/2], {n,0,40}] (* or *)
    CoefficientList[Series[(1 + 4 x)/((1 + 2 x) (1 - 2 x)), {x, 0, 31}], x] (* or *)
    LinearRecurrence[{0, 4}, {1, 4}, 40] (* Robert A. Russell, Nov 07 2018 *)
  • PARI
    a(n)=4^((n+1)\2) \\ Charles R Greathouse IV, Apr 08 2012
    
  • PARI
    a(n)=(3*2^n-(-2)^n)/2 \\ Charles R Greathouse IV, Oct 03 2016

Formula

a(n) = 4^floor((n+1)/2).
a(n) = 4*a(n-2) for n > 1; a(0) = 1, a(1) = 4.
G.f.: (1+4*x) / (1-4*x^2). - R. J. Mathar, Jan 19 2011 [Adapted to offset 0 by Robert A. Russell, Nov 07 2018]
a(n+3) = a(n+2)*a(n+1)/a(n). - Reinhard Zumkeller, Mar 04 2011
a(n) = 4*abs(A164111(n-1)). - R. J. Mathar, Jan 19 2011
a(n) = C(4,0)*A000007(n) + C(4,1)*A057427(n) + C(4,2)*A056453(n) + C(4,3)*A056454(n) + C(4,4)*A056455(n). - Robert A. Russell, Nov 08 2018

Extensions

a(0)=1 prepended by Robert A. Russell, Nov 07 2018
Edited by N. J. A. Sloane, Sep 29 2019

A152815 Triangle T(n,k), read by rows given by [1,0,-1,0,0,0,0,0,0,...] DELTA [0,1,-1,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 2, 1, 0, 0, 1, 2, 1, 0, 0, 0, 1, 3, 3, 1, 0, 0, 0, 1, 3, 3, 1, 0, 0, 0, 0, 1, 4, 6, 4, 1, 0, 0, 0, 0, 1, 4, 6, 4, 1, 0, 0, 0, 0, 0, 1, 5, 10, 10, 5, 1, 0, 0, 0, 0, 0, 1, 5, 10, 10, 5, 1, 0, 0, 0, 0, 0, 0, 1, 6, 15, 20, 15, 6, 1, 0, 0, 0, 0, 0, 0, 1, 6, 15, 20, 15, 6, 1, 0, 0, 0
Offset: 0

Views

Author

Philippe Deléham, Dec 13 2008

Keywords

Comments

Triangle read by rows, Pascal's triangle (A007318) rows repeated.
Riordan array (1/(1-x), x^2/(1-x^2)). - Philippe Deléham, Feb 27 2012

Examples

			Triangle begins:
  1;
  1, 0;
  1, 1, 0;
  1, 1, 0, 0;
  1, 2, 1, 0, 0;
  1, 2, 1, 0, 0, 0;
  1, 3, 3, 1, 0, 0, 0;
  1, 3, 3, 1, 0, 0, 0, 0;
  1, 4, 6, 4, 1, 0, 0, 0, 0; ...
		

Crossrefs

Cf. A007318, A064861, A152198 (another version), A000931 (diagonal sums), A016116 (row sums).

Programs

  • Haskell
    a152815 n k = a152815_tabl !! n !! k
    a152815_row n = a152815_tabl !! n
    a152815_tabl = [1] : [1,0] : t [1,0] where
       t ys = zs : zs' : t zs' where
         zs' = zs ++ [0]; zs = zipWith (+) ([0] ++ ys) (ys ++ [0])
    -- Reinhard Zumkeller, Feb 28 2012
    
  • Mathematica
    m = 13;
    (* DELTA is defined in A084938 *)
    DELTA[Join[{1, 0, -1}, Table[0, {m}]], Join[{0, 1, -1}, Table[0, {m}]], m] // Flatten (* Jean-François Alcover, Feb 19 2020 *)
    T[n_, k_] := If[n<0, 0, Binomial[Floor[n/2], k]]; (* Michael Somos, Oct 01 2022 *)
  • PARI
    {T(n, k) = if(n<0, 0, binomial(n\2, k))}; /* Michael Somos, Oct 01 2022 */

Formula

T(n,k) = T(n-1,k) + ((1+(-1)^n)/2)*T(n-1,k-1).
G.f.: (1+x)/(1-(1+y)*x^2).
Sum_{k=0..n} T(n,k)*x^k = A000012(n), A016116(n), A108411(n), A213173(n), A074872(n+1) for x = 0,1,2,3,4 respectively. - Philippe Deléham, Nov 26 2011, Apr 22 2013

Extensions

Example corrected by Philippe Deléham, Dec 13 2008

A362558 Number of integer partitions of n without a nonempty initial consecutive subsequence summing to n/2.

Original entry on oeis.org

1, 1, 1, 3, 2, 7, 6, 15, 11, 30, 27, 56, 44, 101, 93, 176, 149, 297, 271, 490, 432, 792, 744, 1255, 1109, 1958, 1849, 3010, 2764, 4565, 4287, 6842, 6328, 10143, 9673, 14883, 13853, 21637, 20717, 31185, 29343, 44583, 42609, 63261, 60100, 89134, 85893, 124754
Offset: 0

Views

Author

Gus Wiseman, Apr 24 2023

Keywords

Comments

Also the number of n-multisets of positive integers that (1) have integer median, (2) cover an initial interval, and (3) have weakly decreasing multiplicities.

Examples

			The a(1) = 1 through a(7) = 15 partitions:
  (1)  (2)  (3)    (4)   (5)      (6)     (7)
            (21)   (31)  (32)     (42)    (43)
            (111)        (41)     (51)    (52)
                         (221)    (222)   (61)
                         (311)    (411)   (322)
                         (2111)   (2211)  (331)
                         (11111)          (421)
                                          (511)
                                          (2221)
                                          (3211)
                                          (4111)
                                          (22111)
                                          (31111)
                                          (211111)
                                          (1111111)
The partition y = (3,2,1,1,1) has nonempty initial consecutive subsequences (3,2,1,1,1), (3,2,1,1), (3,2,1), (3,2), (3), with sums 8, 7, 6, 5, 3. Since 4 is missing, y is counted under a(8).
		

Crossrefs

The odd bisection is A058695.
The version for compositions is A213173.
The complement is counted by A322439 aerated.
The even bisection is A362051.
For mean instead of median we have A362559.
A000041 counts integer partitions, strict A000009.
A325347 counts partitions with integer median, complement A307683.
A359893/A359901/A359902 count partitions by median.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],!MemberQ[Accumulate[#],n/2]&]],{n,0,15}]

A362051 Number of integer partitions of 2n without a nonempty initial consecutive subsequence summing to n.

Original entry on oeis.org

1, 1, 2, 6, 11, 27, 44, 93, 149, 271, 432, 744, 1109, 1849, 2764, 4287, 6328, 9673, 13853, 20717, 29343, 42609, 60100, 85893, 118475, 167453, 230080, 318654, 433763, 595921, 800878, 1090189, 1456095, 1957032, 2600199, 3465459, 4558785, 6041381, 7908681
Offset: 0

Views

Author

Gus Wiseman, Apr 24 2023

Keywords

Comments

Even bisection of A362558.
a(0) = 1; a(n) = A000041(2n) - A322439(n). - Alois P. Heinz, Apr 27 2023

Examples

			The a(1) = 1 through a(4) = 11 partitions:
  (2)  (4)   (6)     (8)
       (31)  (42)    (53)
             (51)    (62)
             (222)   (71)
             (411)   (332)
             (2211)  (521)
                     (611)
                     (3221)
                     (3311)
                     (5111)
                     (32111)
The partition y = (3,2,1,1,1) has nonempty initial consecutive subsequences (3,2,1,1,1), (3,2,1,1), (3,2,1), (3,2), (3), with sums 8, 7, 6, 5, 3. Since 4 is missing, y is counted under a(4).
		

Crossrefs

The version for compositions is A000302, bisection of A213173.
The complement is counted by A322439.
Even bisection of A362558.
A000041 counts integer partitions, strict A000009.
A304442 counts partitions with all equal run-sums.
A325347 counts partitions with integer median, complement A307683.
A353836 counts partitions by number of distinct run-sums.
A359893/A359901/A359902 count partitions by median.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[2n],!MemberQ[Accumulate[#],n]&]],{n,0,15}]

A380110 In the base 4 expansion of n: map 0->0, 1->1, 2->1, 3->2.

Original entry on oeis.org

0, 1, 1, 2, 4, 5, 5, 6, 4, 5, 5, 6, 8, 9, 9, 10, 16, 17, 17, 18, 20, 21, 21, 22, 20, 21, 21, 22, 24, 25, 25, 26, 16, 17, 17, 18, 20, 21, 21, 22, 20, 21, 21, 22, 24, 25, 25, 26, 32, 33, 33, 34, 36, 37, 37, 38, 36, 37, 37, 38, 40, 41, 41, 42, 64, 65, 65, 66, 68, 69
Offset: 0

Views

Author

Darío Clavijo, Feb 14 2025

Keywords

Comments

This is essentialy the mapping of the half adder where the inputs A,B maps to outputs: C_out and S as in binary: 00->00, 01->01, 10->01, 11->10, where C_out is the carry out bit and S is the sum bit.
The fixed points for this sequence are in the Moser-de Bruijn sequence (A000695).

Examples

			Half adder truth table:
 A | B | C_out | S
---+---+-------+------
 0 | 0 | 0     | 0
 0 | 1 | 0     | 1
 1 | 0 | 0     | 1
 1 | 1 | 1     | 0
For n = 25 a(25) = 21 because:
25 = 121_4 and 121_4 maps to 111_4 which is 21.
		

Crossrefs

Programs

  • Mathematica
    A380110[n_] := FromDigits[ReplaceAll[IntegerDigits[n, 4], {2 -> 1, 3 -> 2}], 4];
    Array[A380110, 100, 0] (* Paolo Xausa, Feb 27 2025 *)
  • Python
    def a(n):
        r,p = 0,1
        while n:
            ps = (n & 1) + ((n >> 1) & 1)
            r += ps * p
            n >>= 2
            p <<= 2
        return r
    print([a(n) for n in range(70)])

Formula

a(n) = n iff n in A000695.
a(2^k) = A213173(n).
a(n) = a(n-1)+1 if n odd.
a(n) = n-A063695(n)/2.

A384604 Expansion of (1-x^2) / (1-x-4*x^2+2*x^3).

Original entry on oeis.org

1, 1, 4, 6, 20, 36, 104, 208, 552, 1176, 2968, 6568, 16088, 36424, 87640, 201160, 478872, 1108232, 2621400, 6096584, 14365720, 33509256, 78778968, 184084552, 432181912, 1010962184, 2371520728, 5551005640, 13015164184, 30476145288, 71434790744, 167309043528
Offset: 0

Views

Author

Sean A. Irvine, Jun 04 2025

Keywords

Comments

Number of walks of length n starting at vertex 0 in the following graph:
0 2
\ /|
1 |
/ \|
4 3.
Also, for n >= 1, the number of walks of length n-1 starting at vertex 1 in the same graph.

Examples

			a(3)=6 because we have the walks 0-1-0-1, 0-1-2-1, 0-1-2-3, 0-1-3-1, 0-1-3-2, 0-1-4-1.
		

Crossrefs

Cf. A384605 (vertex 2), A213173 (missing edge {2,3}), A382683 (missing edge {1,4}).

Programs

  • Maple
    a:= n-> (<<0|1|0|0|0>, <1|0|1|1|1>, <0|1|0|1|0>, <0|1|1|0|0>, <0|1|0|0|0>>^n. <<1,1,1,1,1>>)[1,1]:
    seq(a(n), n=0..32);
  • Mathematica
    CoefficientList[Series[(1 - x^2)/(1 - x - 4*x^2 + 2*x^3), {x, 0, 32}], x]

A242763 a(n) = 1 for n <= 7; a(n) = a(n-5) + a(n-7) for n>7.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 7, 7, 8, 9, 9, 12, 12, 15, 16, 17, 21, 21, 27, 28, 32, 37, 38, 48, 49, 59, 65, 70, 85, 87, 107, 114, 129, 150, 157, 192, 201, 236, 264, 286, 342, 358, 428, 465, 522, 606, 644, 770, 823, 950, 1071, 1166, 1376
Offset: 1

Views

Author

Keywords

Comments

Generalized Fibonacci growth sequence using i = 2 as maturity period, j = 5 as conception period, and k = 2 as growth factor.
Maturity period is the number of periods that a Fibonacci tree node needs for being able to start developing branches. Conception period is the number of periods in a Fibonacci tree node needed to develop new branches since its maturity. Growth factor is the number of additional branches developed by a Fibonacci tree node, plus 1, and equals the base of the exponential series related to the given tree if maturity factor would be zero. Standard Fibonacci would use 1 as maturity period, 1 as conception period, and 2 as growth factor as the series becomes equal to 2^n with a maturity period of 0. Related to Lucas sequences.

Examples

			For n = 13 the a(13) = a(8) + a(6) = 2 + 1 = 3.
		

Crossrefs

Cf. A000079 (i = 0, j = 1, k = 2), A000244 (i = 0, j = 1, k = 3), A000302 (i = 0, j = 1, k = 4), A000351 (i = 0, j = 1, k = 5), A000400 (i = 0, j = 1, k = 6), A000420 (i = 0, j = 1, k = 7), A001018 (i = 0, j = 1, k = 8), A001019 (i = 0, j = 1, k = 9), A011557 (i = 0, j = 1, k = 10), A001020 (i = 0, j = 1, k = 11), A001021 (i = 0, j = 1, k = 12), A016116 (i = 0, j = 2, k = 2), A108411 (i = 0, j = 2, k = 3), A213173 (i = 0, j = 2, k = 4), A074872 (i = 0, j = 2, k = 5), A173862 (i = 0, j = 3, k = 2), A127975 (i = 0, j = 3, k = 3), A200675 (i = 0, j = 4, k = 2), A111575 (i = 0, j = 4, k = 3), A000045 (i = 1, j = 1, k = 2), A001045 (i = 1, j = 1, k = 3), A006130 (i = 1, j = 1, k = 4), A006131 (i = 1, j = 1, k = 5), A015440 (i = 1, j = 1, k = 6), A015441 (i = 1, j = 1, k = 7), A015442 (i = 1, j = 1, k = 8), A015443 (i = 1, j = 1, k = 9), A015445 (i = 1, j = 1, k = 10), A015446 (i = 1, j = 1, k = 11), A015447 (i = 1, j = 1, k = 12), A000931 (i = 1, j = 2, k = 2), A159284 (i = 1, j = 2, k = 3), A238389 (i = 1, j = 2, k = 4), A097041 (i = 1, j = 2, k = 10), A079398 (i = 1, j = 3, k = 2), A103372 (i = 1, j = 4, k = 2), A103373 (i = 1, j = 5, k = 2), A103374 (i = 1, j = 6, k = 2), A000930 (i = 2, j = 1, k = 2), A077949 (i = 2, j = 1, k = 3), A084386 (i = 2, j = 1, k = 4), A089977 (i = 2, j = 1, k = 5), A178205 (i = 2, j = 1, k = 11), A103609 (i = 2, j = 2, k = 2), A077953 (i = 2, j = 2, k = 3), A226503 (i = 2, j = 3, k = 2), A122521 (i = 2, j = 6, k = 2), A003269 (i = 3, j = 1, k = 2), A052942 (i = 3, j = 1, k = 3), A005686 (i = 3, j = 2, k = 2), A237714 (i = 3, j = 2, k = 3), A238391 (i = 3, j = 2, k = 4), A247049 (i = 3, j = 3, k = 2), A077886 (i = 3, j = 3, k = 3), A003520 (i = 4, j = 1, k = 2), A108104 (i = 4, j = 2, k = 2), A005708 (i = 5, j = 1, k = 2), A237716 (i = 5, j = 2, k = 3), A005709 (i = 6, j = 1, k = 2), A122522 (i = 6, j = 2, k = 2), A005710 (i = 7, j = 1, k = 2), A237718 (i = 7, j = 2, k = 3), A017903 (i = 8, j = 1, k = 2).

Programs

  • Magma
    [n le 7 select 1 else Self(n-5)+Self(n-7): n in [1..70]]; // Vincenzo Librandi, Nov 30 2016
    
  • Mathematica
    LinearRecurrence[{0, 0, 0, 0, 1, 0, 1}, {1, 1, 1, 1, 1, 1, 1}, 70] (*  or *)
    CoefficientList[ Series[(1+x+x^2+x^3+x^4)/(1-x^5-x^7), {x, 0, 70}], x] (* Robert G. Wilson v, Nov 25 2016 *)
    nxt[{a_,b_,c_,d_,e_,f_,g_}]:={b,c,d,e,f,g,a+c}; NestList[nxt,{1,1,1,1,1,1,1},70][[;;,1]] (* Harvey P. Dale, Oct 22 2024 *)
  • PARI
    Vec(x*(1+x+x^2+x^3+x^4)/((1-x+x^2)*(1+x-x^3-x^4-x^5)) + O(x^100)) \\ Colin Barker, Oct 27 2016
    
  • SageMath
    @CachedFunction # a = A242763
    def a(n): return 1 if n<8 else a(n-5) +a(n-7)
    [a(n) for n in range(1,76)] # G. C. Greubel, Oct 23 2024

Formula

Generic a(n) = 1 for n <= i+j; a(n) = a(n-j) + (k-1)*a(n-(i+j)) for n>i+j where i = maturity period, j = conception period, k = growth factor.
G.f.: x*(1+x+x^2+x^3+x^4) / ((1-x+x^2)*(1+x-x^3-x^4-x^5)). - Colin Barker, Oct 09 2016
Generic g.f.: x*(Sum_{l=0..j-1} x^l) / (1-x^j-(k-1)*x^(i+j)), with i > 0, j > 0 and k > 1.

A384605 Expansion of (1+x) / (1-x-4*x^2+2*x^3).

Original entry on oeis.org

1, 2, 6, 12, 32, 68, 172, 380, 932, 2108, 5076, 11644, 27732, 64156, 151796, 352956, 831828, 1940060, 4561460, 10658044, 25023764, 58533020, 137311988, 321396540, 753578452, 1764540636, 4136061364, 9687067004, 22702231188, 53178376476, 124613167220
Offset: 0

Views

Author

Sean A. Irvine, Jun 04 2025

Keywords

Comments

Number of walks of length n starting at vertex 2 in the following graph:
0 2
\ /|
1 |
/ \|
4 3.

Examples

			a(3)=6 because we have the walks 0-1-0-1, 0-1-2-1, 0-1-2-3, 0-1-3-1, 0-1-3-2, 0-1-4-1.
		

Crossrefs

Cf. A384604 (vertices 0, 1, 4), A213173 (missing edge {2,3}), A382683 (missing edge {1,4}).

Programs

  • Maple
    a:= n-> (<<0|1|0|0|0>, <1|0|1|1|1>, <0|1|0|1|0>, <0|1|1|0|0>, <0|1|0|0|0>>^n. <<1,1,1,1,1>>)[3,1]:
    seq(a(n), n=0..32);
  • Mathematica
    CoefficientList[Series[(1 + x)/(1 - x - 4*x^2 + 2*x^3), {x, 0, 32}], x]
Showing 1-8 of 8 results.