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!)
A262522 a(n)=0 if n is in A259934, otherwise the largest term in A045765 from which one can reach n by iterating A049820 zero or more times. 8

%I #16 Oct 04 2015 13:12:21

%S 0,8,0,7,8,7,0,7,8,79,20,79,0,13,20,79,24,79,0,19,20,79,0,79,24,25,40,

%T 79,28,79,0,79,40,33,0,79,36,37,140,79,40,43,0,43,50,79,0,79,140,49,

%U 50,79,52,79,0,55,56,79,0,79,140,79,0,63,64,79,66,67,68,79,0,79,140,79,74,75,123,79,0,79,88,123,98,123,140,85,98,123,88,103,0,123,98,103,0,123

%N a(n)=0 if n is in A259934, otherwise the largest term in A045765 from which one can reach n by iterating A049820 zero or more times.

%C If n is itself in A045765, we iterate 0 times, and thus a(n) = n.

%H Antti Karttunen, <a href="/A262522/b262522.txt">Table of n, a(n) for n = 0..17724</a>

%F If A262693(n) = 1 [when n is in A259934],

%F then a(n) = 0,

%F otherwise, if A060990(n) = 0 [when n is one of the leaves, A045765],

%F then a(n) = n,

%F otherwise:

%F a(n) = Max_{k = A082284(n) .. A262686(n)} [A049820(k) = n] * a(k).

%F (In the last clause [ ] stands for Iverson bracket, giving as its result 1 only when A049820(k) = n, and 0 otherwise).

%F Other identities. For all n >= 1:

%F a(A262511(n)) = a(A262512(n)) = a(A082284(A262511(n))).

%e 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).

%e 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.

%o (Scheme, with memoization-macro definec)

%o (definec (A262522 n) (cond ((= 1 (A262693 n)) 0) ((= 0 (A060990 n)) n) (else (let loop ((m 0) (k (A262686 n))) (cond ((<= k n) m) ((= n (A049820 k)) (loop (max m (A262522 k)) (- k 1))) (else (loop m (- k 1))))))))

%Y Cf. A000005, A045765, A049820, A060990, A082284, A259934, A262511, A262512, A262686, A262693.

%Y Cf. A262679, A262695, A262696, A262697.

%K nonn

%O 0,2

%A _Antti Karttunen_, Oct 04 2015

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 14:05 EDT 2024. Contains 371740 sequences. (Running on oeis4.)