OFFSET
0,2
COMMENTS
If n is itself in A045765, we iterate 0 times, and thus a(n) = n.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..17724
FORMULA
then a(n) = 0,
then a(n) = n,
otherwise:
(In the last clause [ ] stands for Iverson bracket, giving as its result 1 only when A049820(k) = n, and 0 otherwise).
Other identities. For all n >= 1:
EXAMPLE
For n=1, its transitive closure (as defined by edge-relation A049820(child) = parent) is the union of {1} itself together with all its descendants: {1, 3, 4, 5, 7, 8}. We see that there are no other nodes in a subtree whose root is 1, because A049820(3) = 3 - d(3) = 1, A049820(4) = 1, A049820(5) = 3, A049820(7) = 5, A049820(8) = 4 and of these only 7 and 8 are terms of A045765. The largest term (which by necessity is always a term of A045765) is here 8, thus a(1) = 8. Note however that it is not always the largest leaf from which starts the longest path leading back to n. (In this case it is 7 instead of 8, see the example in A262695).
For n=9, its transitive closure is {9, 11, 13, 15, 16, 17, 19, 21, 23, 24, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 51, 53, 55, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 77, 79}. The largest term is 79, thus a(9) = 79.
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 04 2015
STATUS
approved