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

A302698 Number of integer partitions of n into relatively prime parts that are all greater than 1.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 3, 2, 5, 4, 13, 7, 23, 18, 32, 33, 65, 50, 104, 92, 148, 153, 252, 226, 376, 376, 544, 570, 846, 821, 1237, 1276, 1736, 1869, 2552, 2643, 3659, 3887, 5067, 5509, 7244, 7672, 10086, 10909, 13756, 15168, 19195, 20735, 26237, 28708, 35418, 39207
Offset: 1

Views

Author

Gus Wiseman, Apr 11 2018

Keywords

Comments

Two or more numbers are relatively prime if they have no common divisor other than 1. A single number is not considered relatively prime unless it is equal to 1 (which is impossible in this case).
The Heinz numbers of these partitions are given by A302697.

Examples

			The a(5) = 1 through a(12) = 7 partitions (empty column indicated by dot):
  (32)  .  (43)   (53)   (54)    (73)    (65)     (75)
           (52)   (332)  (72)    (433)   (74)     (543)
           (322)         (432)   (532)   (83)     (552)
                         (522)   (3322)  (92)     (732)
                         (3222)          (443)    (4332)
                                         (533)    (5322)
                                         (542)    (33222)
                                         (632)
                                         (722)
                                         (3332)
                                         (4322)
                                         (5222)
                                         (32222)
		

Crossrefs

A000837 is the version allowing 1's.
A002865 does not require relative primality.
A302697 gives the Heinz numbers of these partitions.
A337450 is the ordered version.
A337451 is the ordered strict version.
A337452 is the strict version.
A337485 is the pairwise coprime instead of relatively prime version.
A000740 counts relatively prime compositions.
A078374 counts relatively prime strict partitions.
A212804 counts compositions with no 1's.
A291166 appears to rank relatively prime compositions.
A332004 counts strict relatively prime compositions.
A337561 counts pairwise coprime strict compositions.
A338332 is the case of length 3, with strict case A338333.

Programs

  • Maple
    b:= proc(n, i, g) option remember; `if`(n=0, `if`(g=1, 1, 0),
          `if`(i<2, 0, b(n, i-1, g)+b(n-i, min(n-i, i), igcd(g, i))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=1..60);  # Alois P. Heinz, Apr 12 2018
  • Mathematica
    Table[Length[Select[IntegerPartitions[n],FreeQ[#,1]&&GCD@@#===1&]],{n,30}]
    (* Second program: *)
    b[n_, i_, g_] := b[n, i, g] = If[n == 0, If[g == 1, 1, 0], If[i < 2, 0, b[n, i - 1, g] + b[n - i, Min[n - i, i], GCD[g, i]]]];
    a[n_] := b[n, n, 0];
    Array[a, 60] (* Jean-François Alcover, May 10 2021, after Alois P. Heinz *)

Formula

a(n) = A002865(n) - A018783(n).

Extensions

Extended by Gus Wiseman, Oct 29 2020

A022340 Even Fibbinary numbers (A003714); also 2*Fibbinary(n).

Original entry on oeis.org

0, 2, 4, 8, 10, 16, 18, 20, 32, 34, 36, 40, 42, 64, 66, 68, 72, 74, 80, 82, 84, 128, 130, 132, 136, 138, 144, 146, 148, 160, 162, 164, 168, 170, 256, 258, 260, 264, 266, 272, 274, 276, 288, 290, 292, 296, 298, 320, 322, 324, 328, 330, 336, 338, 340, 512
Offset: 0

Views

Author

Keywords

Comments

Positions of ones in binomial(3k+2,k+1)/(3k+2) modulo 2 (A085405). - Paul D. Hanna, Jun 29 2003
Construction: start with strings S(0)={0}, S(1)={2}; for k>=2, concatenate all prior strings excluding S(k-1) and add 2^k to each element in the resulting string to obtain S(k); this sequence is the concatenation of all such generated strings: {S(0),S(1),S(2),...}. Example: for k=5, concatenate {S(0),S(1),S(2),S(3)} = {0, 2, 4, 8,10}; add 2^5 to each element to obtain S(5)={32,34,38,40,42}. - Paul D. Hanna, Jun 29 2003
From Gus Wiseman, Apr 08 2020: (Start)
The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions. This sequence lists all numbers k such that the k-th composition in standard order has no ones. For example, the sequence together with the corresponding compositions begins:
0: () 80: (2,5) 260: (6,3)
2: (2) 82: (2,3,2) 264: (5,4)
4: (3) 84: (2,2,3) 266: (5,2,2)
8: (4) 128: (8) 272: (4,5)
10: (2,2) 130: (6,2) 274: (4,3,2)
16: (5) 132: (5,3) 276: (4,2,3)
18: (3,2) 136: (4,4) 288: (3,6)
20: (2,3) 138: (4,2,2) 290: (3,4,2)
32: (6) 144: (3,5) 292: (3,3,3)
34: (4,2) 146: (3,3,2) 296: (3,2,4)
36: (3,3) 148: (3,2,3) 298: (3,2,2,2)
40: (2,4) 160: (2,6) 320: (2,7)
42: (2,2,2) 162: (2,4,2) 322: (2,5,2)
64: (7) 164: (2,3,3) 324: (2,4,3)
66: (5,2) 168: (2,2,4) 328: (2,3,4)
68: (4,3) 170: (2,2,2,2) 330: (2,3,2,2)
72: (3,4) 256: (9) 336: (2,2,5)
74: (3,2,2) 258: (7,2) 338: (2,2,3,2)
(End)

Crossrefs

Equals 2 * A003714.
Compositions with no ones are counted by A212804.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without terms > 2 are A003754.
- Compositions without ones are A022340 (this sequence).
- Sum is A070939.
- Compositions with no twos are A175054.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Runs-resistance is A333628.

Programs

  • Haskell
    a022340 = (* 2) . a003714 -- Reinhard Zumkeller, Feb 03 2015
    
  • Mathematica
    f[n_Integer] := Block[{k = Ceiling[ Log[ GoldenRatio, n*Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k-- ]; FromDigits[fr, 2]]; Select[f /@ Range[0, 95], EvenQ[ # ] &] (* Robert G. Wilson v, Sep 18 2004 *)
    Select[Range[2, 512, 2], BitAnd[#, 2#] == 0 &] (* Alonso del Arte, Jun 18 2012 *)
  • Python
    from itertools import count, islice
    def A022340_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:not n&(n>>1),count(max(0,startvalue+(startvalue&1)),2))
    A022340_list = list(islice(A022340_gen(),30)) # Chai Wah Wu, Sep 07 2022
    
  • Python
    def A022340(n):
        tlist, s = [1,2], 0
        while tlist[-1]+tlist[-2] <= n: tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            if d <= n:
                s += 1
                n -= d
            s <<= 1
        return s # Chai Wah Wu, Apr 24 2025

Formula

For n>0, a(F(n))=2^n, a(F(n)-1)=A001045(n+2)-1, where F(n) is the n-th Fibonacci number with F(0)=F(1)=1.
a(n) + a(n)/2 = a(n) XOR a(n)/2, see A106409. - Reinhard Zumkeller, May 02 2005

Extensions

Edited by Ralf Stephan, Sep 01 2004

A331683 One and all numbers of the form 2^k * prime(j) for k > 0 and j already in the sequence.

Original entry on oeis.org

1, 4, 8, 14, 16, 28, 32, 38, 56, 64, 76, 86, 106, 112, 128, 152, 172, 212, 214, 224, 256, 262, 304, 326, 344, 424, 428, 448, 512, 524, 526, 608, 622, 652, 688, 766, 848, 856, 886, 896, 1024, 1048, 1052, 1154, 1216, 1226, 1244, 1304, 1376, 1438, 1532, 1696
Offset: 1

Views

Author

Gus Wiseman, Jan 30 2020

Keywords

Comments

Also Matula-Goebel numbers of lone-child-avoiding rooted trees at with at most one non-leaf branch under any given vertex. A rooted tree is lone-child-avoiding if there are no unary branchings. The Matula-Goebel number of a rooted tree is the product of primes indexed by the Matula-Goebel numbers of the branches of the root, which gives a bijective correspondence between positive integers and unlabeled rooted trees.
Also Matula-Goebel numbers of lone-child-avoiding locally disjoint semi-identity trees. Locally disjoint means no branch of any vertex overlaps a different (unequal) branch of the same vertex. In a semi-identity tree, all non-leaf branches of any given vertex are distinct.

Examples

			The sequence of all lone-child-avoiding rooted trees with at most one non-leaf branch under any given vertex together with their Matula-Goebel numbers begins:
    1: o
    4: (oo)
    8: (ooo)
   14: (o(oo))
   16: (oooo)
   28: (oo(oo))
   32: (ooooo)
   38: (o(ooo))
   56: (ooo(oo))
   64: (oooooo)
   76: (oo(ooo))
   86: (o(o(oo)))
  106: (o(oooo))
  112: (oooo(oo))
  128: (ooooooo)
  152: (ooo(ooo))
  172: (oo(o(oo)))
  212: (oo(oooo))
  214: (o(oo(oo)))
  224: (ooooo(oo))
		

Crossrefs

These trees counted by number of vertices are A212804.
The semi-lone-child-avoiding version is A331681.
The non-semi-identity version is A331871.
Lone-child-avoiding rooted trees are counted by A001678.
Matula-Goebel numbers of lone-child-avoiding rooted trees are A291636.
Unlabeled semi-identity trees are counted by A306200, with Matula-Goebel numbers A306202.
Locally disjoint rooted trees are counted by A316473.
Matula-Goebel numbers of locally disjoint rooted trees are A316495.
Lone-child-avoiding locally disjoint rooted trees by leaves are A316697.

Programs

  • Maple
    N:= 10^4: # for terms <= N
    S:= {1}:
    with(queue):
    Q:= new(1):
    while not empty(Q) do
      r:= dequeue(Q);
      p:= ithprime(r);
      newS:= {seq(2^i*p,i=1..ilog2(N/p))} minus S;
      S:= S union newS;
      for s in newS do enqueue(Q,s) od:
    od:
    sort(convert(S,list)); # Robert Israel, Feb 05 2020
  • Mathematica
    uryQ[n_]:=n==1||MatchQ[FactorInteger[n],({{2,},{p,1}}/;uryQ[PrimePi[p]])|({{2,k_}}/;k>1)];
    Select[Range[100],uryQ]

Formula

Intersection of A291636, A316495, and A306202.

A105809 Riordan array (1/(1 - x - x^2), x/(1 - x)).

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 3, 4, 3, 1, 5, 7, 7, 4, 1, 8, 12, 14, 11, 5, 1, 13, 20, 26, 25, 16, 6, 1, 21, 33, 46, 51, 41, 22, 7, 1, 34, 54, 79, 97, 92, 63, 29, 8, 1, 55, 88, 133, 176, 189, 155, 92, 37, 9, 1, 89, 143, 221, 309, 365, 344, 247, 129, 46, 10, 1, 144, 232, 364, 530, 674, 709, 591
Offset: 0

Views

Author

Paul Barry, May 04 2005

Keywords

Comments

Previous name was: A Fibonacci-Pascal matrix.
From Wolfdieter Lang, Oct 04 2014: (Start)
In the column k of this triangle (without leading zeros) is the k-fold iterated partial sums of the Fibonacci numbers, starting with 1. A000045(n+1), A000071(n+3), A001924(n+1), A014162(n+1), A014166(n+1), ..., n >= 0. See the Riordan property.
For a combinatorial interpretation of these iterated partial sums see the H. Belbachir and A. Belkhir link. There table 1 shows in the rows these columns. In their notation (with r = k) f^(k)(n) = T(k, n+k).
The A-sequence of this Riordan triangle is [1, 1] (see the recurrence for T(n, k), k >= 1, given in the formula section). The Z-sequence is A165326 = [1, repeat(1, -1)]. See the W. Lang link under A006232 for Riordan A- and Z-sequences. (End)

Examples

			The triangle T(n,k) begins:
n\k   0   1   2    3    4    5    6    7    8   9  10 11 12 13 ...
0:    1
1:    1   1
2:    2   2   1
3:    3   4   3    1
4:    5   7   7    4    1
5:    8  12  14   11    5    1
6:   13  20  26   25   16    6    1
7:   21  33  46   51   41   22    7    1
8:   34  54  79   97   92   63   29    8    1
9:   55  88 133  176  189  155   92   37    9   1
10:  89 143 221  309  365  344  247  129   46  10   1
11: 144 232 364  530  674  709  591  376  175  56  11  1
12: 233 376 596  894 1204 1383 1300  967  551 231  67 12  1
13: 377 609 972 1490 2098 2587 2683 2267 1518 782 298 79 13  1
... reformatted and extended - _Wolfdieter Lang_, Oct 03 2014
------------------------------------------------------------------
Recurrence from Z-sequence (see a comment above): 8 = T(0,5) = (+1)*5 + (+1)*7 + (-1)*7 + (+1)*4 + (-1)*1 = 8. - _Wolfdieter Lang_, Oct 04 2014
		

Crossrefs

Cf. A165326 (Z-sequence), A027934 (row sums), A010049(n+1) (antidiagonal sums), A212804 (alternating row sums), inverse is A105810.
Some other Fibonacci-Pascal triangles: A027926, A036355, A037027, A074829, A109906, A111006, A114197, A162741, A228074.

Programs

  • Haskell
    a105809 n k = a105809_tabl !! n !! k
    a105809_row n = a105809_tabl !! n
    a105809_tabl = map fst $ iterate
       (\(u:_, vs) -> (vs, zipWith (+) ([u] ++ vs) (vs ++ [0]))) ([1], [1,1])
    -- Reinhard Zumkeller, Aug 15 2013
  • Maple
    T := (n,k) -> `if`(n=0,1,binomial(n,k)*hypergeom([1,k/2-n/2,k/2-n/2+1/2], [k+1,-n], -4)); for n from 0 to 13 do seq(simplify(T(n,k)),k=0..n) od; # Peter Luschny, Oct 10 2014
  • Mathematica
    T[n_, k_] := Sum[Binomial[n-j, k+j], {j, 0, n}]; Table[T[n, k], {n, 0, 11}, {k, 0, n}] (* Jean-François Alcover, Jun 11 2019 *)

Formula

Riordan array (1/(1-x-x^2), x/(1-x)).
Triangle T(n, k) = Sum_{j=0..n} binomial(n-j, k+j); T(n, 0) = A000045(n+1);
T(n, m) = T(n-1, m-1) + T(n-1, m).
T(n, k) = Sum_{j=0..n} binomial(j, n+k-j). - Paul Barry, Oct 23 2006
G.f. of row polynomials Sum_{k=0..n} T(n, k)*x^k is (1 - z)/((1 - z - z^2)*(1 - (1 + x)*z)) (Riordan property). - Wolfdieter Lang, Oct 04 2014
T(n, k) = binomial(n, k)*hypergeom([1, k/2 - n/2, k/2 - n/2 + 1/2],[k + 1, -n], -4) for n > 0. - Peter Luschny, Oct 10 2014
From Wolfdieter Lang, Feb 13 2025: (Start)
Array A(k, n) = Sum_{j=0..n} F(j+1)*binomial(k-1+n-j, k-1), k >= 0, n >= 0, with F = A000045, (from Riordan triangle k-th convolution in columns without leading 0s).
A(k, n) = F(n+1+2*k) - Sum_{j=0..k-1} F(2*(k-j)-1) * binomial(n+1+j, j), (from iteration of partial sums).
Triangle T(n, k) = A(k, n-k) = Sum_{j=k..n} F(n-j+1) * binomial(j-1, k-1), 0 <= k <= n.
T(n, k) = F(n+1+k) - Sum_{j=0..k-1} F(2*(k-j)-1) * binomial(n - (k-1-j), j). (End)
T(n, k) = A027926(n, n+k), for 0 <= k <= n. - Wolfdieter Lang, Mar 08 2025

Extensions

Use first formula as a more descriptive name, Joerg Arndt, Jun 08 2021

A316694 Number of lone-child-avoiding locally disjoint rooted identity trees whose leaves form an integer partition of n.

Original entry on oeis.org

1, 1, 2, 3, 6, 13, 28, 62, 143, 338, 804, 1948, 4789, 11886, 29796, 75316, 191702, 491040, 1264926, 3274594, 8514784, 22229481, 58243870
Offset: 1

Views

Author

Gus Wiseman, Jul 10 2018

Keywords

Comments

A rooted tree is lone-child-avoiding if every non-leaf node has at least two branches. It is locally disjoint if no branch overlaps any other (unequal) branch of the same root. It is an identity tree if no branch appears multiple times under the same root.

Examples

			The a(7) = 28 rooted trees:
  7,
  (16),
  (25),
  (1(15)),
  (34),
  (1(24)), (2(14)), (4(12)), (124),
  (1(1(14))),
  (3(13)),
  (2(23)),
  (1(1(23))), (1(2(13))), (1(3(12))), (1(123)), (2(1(13))), (3(1(12))), (12(13)), (13(12)),
  (1(1(1(13)))),
  (2(2(12))),
  (1(1(2(12)))), (1(2(1(12)))), (1(12(12))), (2(1(1(12)))), (12(1(12))),
  (1(1(1(1(12))))).
Missing from this list but counted by A300660 are ((12)(13)) and ((12)(1(12))).
		

Crossrefs

The semi-identity tree version is A212804.
Not requiring local disjointness gives A300660.
The non-identity tree version is A316696.
This is the case of A331686 where all leaves are singletons.
Rooted identity trees are A004111.
Locally disjoint rooted identity trees are A316471.
Lone-child-avoiding locally disjoint rooted trees are A331680.
Locally disjoint enriched identity p-trees are A331684.

Programs

  • Mathematica
    disjointQ[u_]:=Apply[And,Outer[#1==#2||Intersection[#1,#2]=={}&,u,u,1],{0,1}];
    nms[n_]:=nms[n]=Prepend[Join@@Table[Select[Union[Sort/@Tuples[nms/@ptn]],And[UnsameQ@@#,disjointQ[#]]&],{ptn,Rest[IntegerPartitions[n]]}],{n}];
    Table[Length[nms[n]],{n,10}]

Extensions

a(21)-a(23) from Robert Price, Sep 16 2018
Updated with corrected terminology by Gus Wiseman, Feb 06 2020

A331686 Number of lone-child-avoiding locally disjoint rooted identity trees whose leaves are integer partitions whose multiset union is an integer partition of n.

Original entry on oeis.org

1, 2, 4, 8, 17, 41, 103, 280, 793, 2330, 6979, 21291
Offset: 1

Views

Author

Gus Wiseman, Jan 31 2020

Keywords

Comments

A rooted tree is locally disjoint if no child of any vertex has branches overlapping the branches of any other (unequal) child of the same vertex. Lone-child-avoiding means there are no unary branchings. In an identity tree, all branches of any given vertex are distinct.

Examples

			The a(1) = 1 through a(5) = 17 trees:
  (1)  (2)   (3)       (4)            (5)
       (11)  (12)      (13)           (14)
             (111)     (22)           (23)
             ((1)(2))  (112)          (113)
                       (1111)         (122)
                       ((1)(3))       (1112)
                       ((2)(11))      (11111)
                       ((1)((1)(2)))  ((1)(4))
                                      ((2)(3))
                                      ((1)(22))
                                      ((3)(11))
                                      ((2)(111))
                                      ((1)((1)(3)))
                                      ((2)((1)(2)))
                                      ((11)((1)(2)))
                                      ((1)((2)(11)))
                                      ((1)((1)((1)(2))))
		

Crossrefs

The non-identity version is A331678.
The case where the leaves are all singletons is A316694.
Identity trees are A004111.
Locally disjoint identity trees are A316471.
Locally disjoint enriched identity p-trees are A331684.
Lone-child-avoiding locally disjoint rooted semi-identity trees are A212804.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    disjointQ[u_]:=Apply[And,Outer[#1==#2||Intersection[#1,#2]=={}&,u,u,1],{0,1}];
    mpti[m_]:=Prepend[Join@@Table[Select[Union[Sort/@Tuples[mpti/@p]],UnsameQ@@#&&disjointQ[#]&],{p,Select[mps[m],Length[#]>1&]}],m];
    Table[Sum[Length[mpti[m]],{m,Sort/@IntegerPartitions[n]}],{n,8}]

A006367 Number of binary vectors of length n+1 beginning with 0 and containing just 1 singleton.

Original entry on oeis.org

1, 0, 2, 2, 5, 8, 15, 26, 46, 80, 139, 240, 413, 708, 1210, 2062, 3505, 5944, 10059, 16990, 28646, 48220, 81047, 136032, 228025, 381768, 638450, 1066586, 1780061, 2968040, 4944519, 8230370, 13689118, 22751528, 37786915, 62716752, 104028245
Offset: 0

Views

Author

David M. Bloom

Keywords

Comments

Number of compositions of n+1 containing exactly one 1. - Emeric Deutsch, Mar 08 2002
Number of permutations with one fixed point avoiding 231 and 321.
A singleton is a run of length 1. - Michael Somos, Nov 29 2014
Second column of A105422. - Michael Somos, Nov 29 2014
Number of weak compositions of n with one 0 and no 1's. Example: Combine one 0 with the compositions of 5 without 1 to get a(5) = 8 weak compositions: 0,5; 5,0; 0,2,3; 0,3,2; 2,0,3; 3,0,2; 2,3,0; 3,2,0. - Gregory L. Simay, Mar 21 2018

Examples

			a(4) = 5 because among the 2^4 compositions of 5 only 4+1,1+4,2+2+1,2+1+2,1+2+2 contain exactly one 1.
a(4) = 5 because the binary vectors of length 4+1 beginning with 0 and with exactly one singleton are: 00001, 00100, 00110, 01100, 01111. - _Michael Somos_, Nov 29 2014
G.f. = 1 + 2*x^2 + 2*x^3 + 5*x^4 + 8*x^5 + 15*x^6 + 26*x^7 + 46*x^8 + ...
		

Crossrefs

Programs

  • Magma
    I:=[1,0]; [n le 2 select I[n] else Self(n-1)+Self(n-2)+Fibonacci(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 20 2014
    
  • Mathematica
    nn=36; CoefficientList[Series[1/(1 -x/(1-x) +x)^2, {x, 0, nn}], x] (* Geoffrey Critzer, Feb 18 2014 *)
    a[n_]:= If[ n<0, SeriesCoefficient[((1-x)/(1+x-x^2))^2, {x, 0, -2-n}], SeriesCoefficient[((1-x)/(1-x-x^2))^2, {x, 0, n}]]; (* Michael Somos, Nov 29 2014 *)
  • PARI
    Vec( (1-x)^2/(1-x-x^2)^2 + O(x^66) ) \\ Joerg Arndt, Feb 20 2014
    
  • PARI
    {a(n) = if( n<0, n = -2-n; polcoeff( (1 - x)^2 / (1 + x - x^2)^2 + x * O(x^n), n), polcoeff( (1 - x)^2 / (1 - x - x^2)^2 + x * O(x^n), n))}; /* Michael Somos, Nov 29 2014 */
    
  • Python
    from sympy import fibonacci
    from sympy.core.cache import cacheit
    @cacheit
    def a(n): return 1 if n==0 else 0 if n==1 else a(n - 1) + a(n - 2) + fibonacci(n - 3)
    print([a(n) for n in range(51)]) # Indranil Ghosh, Jul 20 2017
    
  • SageMath
    def A006367(n): return (1/5)*(n*lucas_number2(n-2, 1, -1) + fibonacci(n+1) + 4*fibonacci(n-1))
    [A006367(n) for n in (0..40)] # G. C. Greubel, Apr 06 2022

Formula

a(n) = a(n-1) + a(n-2) + Fibonacci(n-3).
G.f.: (1-x)^2/(1-x-x^2)^2. - Emeric Deutsch, Mar 08 2002
a(n) = A010049(n+1) - A010049(n). - R. J. Mathar, May 30 2014
Convolution square of A212804. - Michael Somos, Nov 29 2014
a(n) = -(-1)^n * A004798(-1-n) for all n in Z. - Michael Somos, Nov 29 2014
0 = a(n)*(-2*a(n) - 7*a(n+1) + 2*a(n+2) + a(n+3)) + a(n+1)*(-4*a(n+1) + 10*a(n+2) - 2*a(n+3)) + a(n+2)*(+4*a(n+2) - 7*a(n+3)) + a(n+3)*(+2*a(n+3)) for all n in Z. - Michael Somos, Nov 29 2014
a(n) = (n*Lucas(n-2) + Fibonacci(n))/5 + Fibonacci(n-1). - Ehren Metcalfe, Jul 29 2017

A118658 a(n) = 2*F(n-1) = L(n) - F(n), where F(n) and L(n) are Fibonacci and Lucas numbers respectively.

Original entry on oeis.org

2, 0, 2, 2, 4, 6, 10, 16, 26, 42, 68, 110, 178, 288, 466, 754, 1220, 1974, 3194, 5168, 8362, 13530, 21892, 35422, 57314, 92736, 150050, 242786, 392836, 635622, 1028458, 1664080, 2692538, 4356618, 7049156, 11405774, 18454930, 29860704, 48315634, 78176338
Offset: 0

Views

Author

Bill Jones (b92057(AT)yahoo.com), May 18 2006

Keywords

Comments

Essentially the same as A006355, A047992, A054886, A055389, A068922, A078642, A090991. - Philippe Deléham, Sep 20 2006 and Georg Fischer, Oct 07 2018
Also the number of matchings in the (n-2)-pan graph. - Eric W. Weisstein, Jun 30 2016
Also the number of maximal independent vertex sets (and minimal vertex covers) in the (n-1)-ladder graph. - Eric W. Weisstein, Jun 30 2017

Crossrefs

Programs

Formula

From Philippe Deléham, Sep 20 2006: (Start)
a(0)=2, a(1)=0; for n > 1, a(n) = a(n-1) + a(n-2).
G.f. (2 - 2*x)/(1 - x - x^2).
a(0)=2 and a(n) = 2*A000045(n-1) for n > 0. (End)
a(n) = A006355(n) + 0^n. - M. F. Hasler, Nov 05 2014
a(n) = Lucas(n-2) + Fibonacci(n-2). - Bruno Berselli, May 27 2015
a(n) = 3*Fibonacci(n-2) + Fibonacci(n-5). - Bruno Berselli, Feb 20 2017
a(n) = 2*A212804(n). - Bruno Berselli, Feb 21 2017
E.g.f.: 2*exp(x/2)*(5*cosh(sqrt(5)*x/2) - sqrt(5)*sinh(sqrt(5)*x/2))/5. - Stefano Spezia, Apr 18 2022

Extensions

More terms from Philippe Deléham, Sep 20 2006
Corrected by T. D. Noe, Nov 01 2006

A331966 Number of lone-child-avoiding rooted semi-identity trees with n vertices.

Original entry on oeis.org

1, 0, 1, 1, 2, 3, 5, 9, 16, 30, 55, 105, 200, 388, 754, 1483, 2923, 5807, 11575, 23190, 46608, 94043, 190287, 386214, 785831, 1602952, 3276845, 6712905, 13778079, 28330583, 58350582, 120370731, 248676129, 514459237, 1065696295, 2210302177, 4589599429, 9540623926
Offset: 1

Views

Author

Gus Wiseman, Feb 05 2020

Keywords

Comments

Lone-child-avoiding means there are no unary branchings.
In a semi-identity tree, the non-leaf branches of any given vertex are distinct.

Examples

			The a(1) = 1 through a(9) = 16 trees (empty column shown as dot):
  o  .  (oo)  (ooo)  (oooo)   (ooooo)   (oooooo)    (ooooooo)    (oooooooo)
                     (o(oo))  (o(ooo))  (o(oooo))   (o(ooooo))   (o(oooooo))
                              (oo(oo))  (oo(ooo))   (oo(oooo))   (oo(ooooo))
                                        (ooo(oo))   (ooo(ooo))   (ooo(oooo))
                                        (o(o(oo)))  (oooo(oo))   (oooo(ooo))
                                                    ((oo)(ooo))  (ooooo(oo))
                                                    (o(o(ooo)))  ((oo)(oooo))
                                                    (o(oo(oo)))  (o(o(oooo)))
                                                    (oo(o(oo)))  (o(oo)(ooo))
                                                                 (o(oo(ooo)))
                                                                 (o(ooo(oo)))
                                                                 (oo(o(ooo)))
                                                                 (oo(oo(oo)))
                                                                 (ooo(o(oo)))
                                                                 ((oo)(o(oo)))
                                                                 (o(o(o(oo))))
		

Crossrefs

The non-semi case is A000007.
Lone-child-avoiding rooted trees are A001678.
The locally disjoint case is A212804.
Not requiring lone-child-avoidance gives A306200.
Matula-Goebel numbers of these trees are A331965.
The semi-lone-child-avoiding version is A331993.

Programs

  • Mathematica
    ssb[n_]:=If[n==1,{{}},Join@@Function[c,Select[Union[Sort/@Tuples[ssb/@c]],UnsameQ@@DeleteCases[#,{}]&]]/@Rest[IntegerPartitions[n-1]]];
    Table[Length[ssb[n]],{n,10}]
  • PARI
    WeighT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v,n,(-1)^(n-1)/n))))-1,-#v)}
    seq(n)={my(v=[0, 0]); for(n=2, n-1, v=concat(v, 1 + vecsum(WeighT(v)) - v[n])); v[1]=1; v} \\ Andrew Howroyd, Feb 09 2020

Extensions

Terms a(31) and beyond from Andrew Howroyd, Feb 09 2020

A005207 a(n) = (F(2*n-1) + F(n+1))/2 where F(n) is a Fibonacci number.

Original entry on oeis.org

1, 1, 2, 4, 9, 21, 51, 127, 322, 826, 2135, 5545, 14445, 37701, 98514, 257608, 673933, 1763581, 4615823, 12082291, 31628466, 82798926, 216761547, 567474769, 1485645049, 3889431721, 10182603746, 26658304492, 69792188337, 182718064101, 478361686155, 1252366480135
Offset: 0

Views

Author

Keywords

Comments

Number of block fountains with exactly n coins in the base when mirror image fountains are identified. - Michael Woltermann (mwoltermann(AT)washjeff.edu), Oct 06 2010
a(n) = C(F(n+1)+1,2) + C(F(n)+1,2) = pairwise sums of A033192. - Ralf Stephan, Jul 06 2003
Number of (3412,54312)- and (3412,45321)-avoiding involutions in S_{n+1}. - Ralf Stephan, Jul 06 2003
Number of (s(0), s(1), ..., s(n)) such that 0 < s(i) < 5 and |s(i) - s(i-1)| <= 1 for i = 1,2,...,n, s(0) = 1, s(n) = 1. - Herbert Kociemba, May 31 2004
The sequence 1,1,2,4,9,... has g.f. 1/(1-x-x^2/(1-x-x^2/(1-x-x^2/(1-x))))=(1-3*x+x^2+x^2)/(1-4*x+3*x^2+2*x^3-x^4), and general term (A001519(n)+A000045(n+1))/2. It is the binomial transform of A001519 aerated. - Paul Barry, Dec 17 2009
The Kn3 and Kn4 sums, see A180662 for their definitions, of Losanitsch's triangle A034851 lead to this sequence. - Johannes W. Meijer, Jul 14 2011
Convolution of [1,1,1,2,5,...], which is A001519 with another leading 1, and A212804. - R. J. Mathar, Apr 14 2018
a(n) is the number of Motzkin n-paths of height <= 3. - Alois P. Heinz, Nov 24 2023

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    A005207:=-(1-2*z-z^2+z^3)/(z^2-3*z+1)/(z^2+z-1); # Simon Plouffe in his 1992 dissertation with offset 0
    a:= n-> (Matrix([[1,1,1,3]]). Matrix(4, (i,j)-> if i=j-1 then 1 elif j=1 then [4,-3,-2,1][i] else 0 fi)^n)[1,2]: seq(a(n), n=0..34); # Alois P. Heinz, Sep 06 2008
  • Mathematica
    LinearRecurrence[{4, -3, -2, 1}, {1, 2, 4, 9}, 30] (* Jean-François Alcover, Jan 31 2016 *)
  • PARI
    a(n)=(fibonacci(2*n-1)+fibonacci(n+1))/2
    
  • PARI
    x='x+O('x^50); Vec(-x*(1-2*x-x^2+x^3)/((x^2+x-1)*(x^2-3*x+1))) \\ G. C. Greubel, Mar 05 2017

Formula

G.f.: 1-x*(1-2*x-x^2+x^3)/((x^2+x-1)*(x^2-3*x+1)).
a(n) = 4*a(n-1) - 3*a(n-2) - 2*a(n-3) + a(n-4).
a(n) = (w^(2*n-1) + w^(1-2*n) + w^(n+1) - (-w)^(-1-n))/(4*w-2) where w = (1+sqrt(5))/2.
a(n) = (2/5)*Sum_{k=1..4} ( sin(Pi*k/5)^2*(1 + 2*cos(Pi*k/5))^n ). - Herbert Kociemba, May 31 2004
a(-1-2*n) = A027994(2*n); a(-2*n)=A059512(2*n+1).
Let M = an infinite tridiagonal matrix with all 1's in the super and main diagonals and [1,1,1,0,0,0,...] in the subdiagonal. Let V = vector [1,0,0,0,...]. The sequence is generated as leftmost column of M*V iterates. - Gary W. Adamson, Jun 07 2011
2*a(n) = A000045(n+1) + A001519(n). - R. J. Mathar, Apr 14 2018
a(n) mod 2 = A131719(n+3). - Alois P. Heinz, Nov 24 2023

Extensions

a(0)=1 prepended by Alois P. Heinz, Nov 24 2023
Showing 1-10 of 37 results. Next