The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A319864 Exponents of the final nontrivial entry of the iterated Stern sequence; a(n) = log_2 min{s^k(n) : k > 0, s^k(n) > 1}, where s(n) = A002487(n). 0
 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 2, 4, 1, 2, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 5, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 2, 1, 1, 6, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2, 1, 1, 1, 1, 1, 4, 2, 1, 1, 1, 2, 4, 1, 1, 1, 1, 1, 2, 1, 3, 3, 1, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 2,3 COMMENTS Let s(n) = A002487(n). Since s(n) < n for n > 1, iterating A002487 from any starting point eventually yields the fixed point 1 = s(1). Since s^-1(1) consists of the powers of 2, min{s^k(n) : k > 0, s^k(n) > 1} is a nontrivial power of 2 for any n > 1. Hence, the entries of this sequence are integers. Since a(2^m) = m, every positive integer appears in this sequence. Question: What is the asymptotic density of the number 1 in this sequence? Of the first 10^6 entries, more than 74% are 1. LINKS EXAMPLE Letting s(m) = A002487(m), we have s(7) = 3, s(3) = 2, and s(2) = 1. Hence, a(7) = log_2(2) = 1. MATHEMATICA s[n_] := If[n<2, n, If[EvenQ[n], s[n/2], s[(n-1)/2] + s[(n+1)/2]]];  a[n_] := Module[{nn = s[n]}, If[nn==1, Log2[n], a[nn]]]; Array[a, 100, 2] (* Amiram Eldar, Nov 22 2018 *) PROG (Python) from math import log def s(n): return n if n<2 else s(n//2) if n%2==0 else s((n-1)//2)+s((n+1)//2) def a(n): nn = s(n); return int(log(n, 2)) if nn==1 else a(nn) print([a(n) for n in range(2, 100)]) (PARI) s(n) = if( n<2, n>0, s(n\2) + if( n%2, s(n\2 + 1))); \\ A002487 a(n) = while((nn = s(n)) != 1, n = nn); valuation(n, 2); \\ Michel Marcus, Nov 23 2018 CROSSREFS Cf. A002487. Sequence in context: A070012 A071178 A326515 * A072776 A077481 A278113 Adjacent sequences:  A319861 A319862 A319863 * A319865 A319866 A319867 KEYWORD nonn AUTHOR Oliver Pechenik, Sep 29 2018 STATUS approved

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

Last modified June 1 20:49 EDT 2020. Contains 334765 sequences. (Running on oeis4.)