login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A166242
Sequence generated from A014577, the dragon curve.
6
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
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.).
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.
Apparently, a(n) = 2^A000120(A003188(n+1)). - Rémy Sigrist, Feb 21 2021
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
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Oct 10 2009
EXTENSIONS
More terms from Antti Karttunen, Jul 27 2017
STATUS
approved