login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A339642 Number of rooted trees with n nodes colored using exactly 2 colors. 3

%I #16 Jan 04 2021 08:43:44

%S 0,2,10,44,196,876,4020,18766,89322,431758,2116220,10494080,52569504,

%T 265647586,1352621168,6933127446,35745747902,185256755454,

%U 964575991660,5043194697556,26467075595080,139375175511598,736228488297566,3900073083063348,20714052518640904

%N Number of rooted trees with n nodes colored using exactly 2 colors.

%H Andrew Howroyd, <a href="/A339642/b339642.txt">Table of n, a(n) for n = 1..500</a>

%F a(n) = A038055(n) - 2*A000081(n).

%F a(n) = 2*(A000151(n) - A000081(n)).

%e a(3) = 10 includes 5 trees and their color complements:

%e (1(12)), (1(22)), (1(1(2))), (1(2(1))), (1(2(2))).

%p b:= proc(n, k) option remember; `if`(n<2, k*n, (add(add(b(d, k)*

%p d, d=numtheory[divisors](j))*b(n-j, k), j=1..n-1))/(n-1))

%p end:

%p a:= n-> b(n, 2)-2*b(n, 1):

%p seq(a(n), n=1..25); # _Alois P. Heinz_, Dec 11 2020

%t b[n_, k_] := b[n, k] = If[n < 2, k*n, (Sum[Sum[b[d, k]*d, {d, Divisors[j]}]*b[n - j, k], {j, 1, n - 1}])/(n - 1)];

%t a[n_] := b[n, 2] - 2*b[n, 1];

%t Array[a, 25] (* _Jean-François Alcover_, Jan 04 2021, after _Alois P. Heinz_ *)

%o (PARI) \\ See A141610 for U(N,m)

%o seq(n)={U(n,2) - 2*U(n,1)}

%Y Column 2 of A141610.

%Y Cf. A000081, A000151, A038055, A339643.

%K nonn

%O 1,2

%A _Andrew Howroyd_, Dec 11 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 11:35 EDT 2024. Contains 371711 sequences. (Running on oeis4.)