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.

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

This page as a plain text file.
%I A339642 #16 Jan 04 2021 08:43:44
%S A339642 0,2,10,44,196,876,4020,18766,89322,431758,2116220,10494080,52569504,
%T A339642 265647586,1352621168,6933127446,35745747902,185256755454,
%U A339642 964575991660,5043194697556,26467075595080,139375175511598,736228488297566,3900073083063348,20714052518640904
%N A339642 Number of rooted trees with n nodes colored using exactly 2 colors.
%H A339642 Andrew Howroyd, <a href="/A339642/b339642.txt">Table of n, a(n) for n = 1..500</a>
%F A339642 a(n) = A038055(n) - 2*A000081(n).
%F A339642 a(n) = 2*(A000151(n) - A000081(n)).
%e A339642 a(3) = 10 includes 5 trees and their color complements:
%e A339642    (1(12)), (1(22)), (1(1(2))), (1(2(1))), (1(2(2))).
%p A339642 b:= proc(n, k) option remember; `if`(n<2, k*n, (add(add(b(d, k)*
%p A339642       d, d=numtheory[divisors](j))*b(n-j, k), j=1..n-1))/(n-1))
%p A339642     end:
%p A339642 a:= n-> b(n, 2)-2*b(n, 1):
%p A339642 seq(a(n), n=1..25);  # _Alois P. Heinz_, Dec 11 2020
%t A339642 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 A339642 a[n_] := b[n, 2] - 2*b[n, 1];
%t A339642 Array[a, 25] (* _Jean-François Alcover_, Jan 04 2021, after _Alois P. Heinz_ *)
%o A339642 (PARI) \\ See A141610 for U(N,m)
%o A339642 seq(n)={U(n,2) - 2*U(n,1)}
%Y A339642 Column 2 of A141610.
%Y A339642 Cf. A000081, A000151, A038055, A339643.
%K A339642 nonn
%O A339642 1,2
%A A339642 _Andrew Howroyd_, Dec 11 2020