OFFSET
0,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..12287
J. Wallgren, Hierarchical sequences
FORMULA
a(3n+1) = 2*A001511(1+n), a(3n) = a(3n+2) = a(3n+1) - 1. - Antti Karttunen, May 28 2017
MATHEMATICA
Array[IntegerExponent[2 #, 2] /. k_ :> ({# - 1, #, # - 1} &[2 k]) &, 36] // Flatten (* Michael De Vlieger, Nov 02 2018 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A059126 n) (cond ((zero? (modulo n 3)) (- (A059126 (+ 1 n)) 1)) ((= 1 (modulo n 3)) (* 2 (A001511 (/ (+ 2 n) 3)))) (else (- (A059126 (+ -1 n)) 1))))
;; Antti Karttunen, May 28 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonas Wallgren, Jan 19 2001
STATUS
approved