This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A166242 Sequence generated from A014577, the dragon curve. 4
 1, 2, 4, 2, 4, 8, 4, 2, 4, 8, 16, 8, 4, 8, 4, 2, 4, 8, 16, 8, 16, 32, 16, 8, 4, 8, 16, 8, 4, 8, 4, 2, 4, 8, 16, 8, 16, 32, 16, 8, 16, 32, 64, 32, 16, 32, 16, 8, 4, 8, 16, 8, 16, 32, 16, 8, 4, 8, 16, 8, 4, 8, 4, 2, 4, 8, 16, 8, 16, 32, 16, 8, 16, 32, 64, 32, 16, 32, 16, 8, 16, 32, 64, 32, 64, 128, 64, 32, 16, 32 (list; graph; refs; listen; history; text; internal format)
 OFFSET -1,2 COMMENTS Rows of A164281 tend to A166242. Subsets of the first 2^n terms can be parsed into a binomial frequency of powers of 2; for example, the first 16 terms has as frequency of (1, 4, 6, 4, 1): (one 1, four 2's, six 4's, four 8's, and one 16.). LINKS Antti Karttunen, Table of n, a(n) for n = -1..8191 FORMULA Let a(-1) = 1, then a(n+1) = 2*a(n) if A014577(n+1) = 1. If A014577(n+1) = 0, then a(n+1) = (1/2)*a(n). As a recursive string in subsets of 2^n terms, the next subset = twice each term of current string, reversed, and appended. EXAMPLE From the Dragon curve, A014577: ...1...1...0...1...1...0...0...1... generates A166242: 1..2...4...2...4...8...4...2...4... given A166242(-1)=1. By recursion, given the first four terms: (1, 2, 4, 2); reverse, double, and append to (1, 2, 4, 2) getting (1, 2, 4, 2, 4, 8, 4, 2,...). MATHEMATICA FoldList[If[EvenQ[((#2 + 1)/2^IntegerExponent[#2 + 1, 2] - 1)/2], 2 #1, #1/2] &, 1, Range[0, 89]] (* Michael De Vlieger, Jul 29 2017, after Jean-François Alcover at A014577 *) PROG (Scheme, with memoization-macro definec) ;; Because definec does not work well with offset -1, we define an offset-0 based version of recurrence: (definec (A166242off0 n) (if (zero? n) 1 (* (expt 2 (- (* 2 (A014577 (- n 1))) 1)) (A166242off0 (- n 1))))) ;; which the offset -1 version will invoke: (define (A166242 n) (A166242off0 (+ 1 n))) (define (A014577 n) (- 1 (A000035 (/ (- (A000265 (+ 1 n)) 1) 2)))) ;; Scheme-code for A000035 and A000265 given under respective entries. ;; Antti Karttunen, Jul 27 2017 CROSSREFS Cf. A014577, A164281. Sequence in context: A296141 A286536 A318768 * A143107 A051638 A286580 Adjacent sequences:  A166239 A166240 A166241 * A166243 A166244 A166245 KEYWORD nonn AUTHOR Gary W. Adamson, Oct 10 2009 EXTENSIONS More terms from Antti Karttunen, Jul 27 2017 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 April 23 09:35 EDT 2019. Contains 322385 sequences. (Running on oeis4.)