login
A059127
A hierarchical sequence (W2{3} - see A059126).
4
1, 2, 1, 3, 1, 2, 1, 4, 5, 4, 6, 4, 5, 4, 1, 2, 1, 3, 1, 2, 1, 7, 8, 7, 9, 7, 8, 7, 1, 2, 1, 3, 1, 2, 1, 4, 5, 4, 6, 4, 5, 4, 1, 2, 1, 3, 1, 2, 1, 10, 11, 10, 12, 10, 11, 10, 1, 2, 1, 3, 1, 2, 1, 4, 5, 4, 6, 4, 5, 4, 1, 2, 1, 3, 1, 2, 1, 7, 8, 7, 9, 7, 8, 7, 1, 2, 1, 3, 1, 2, 1, 4, 5, 4, 6, 4, 5, 4, 1, 2, 1
OFFSET
0,2
LINKS
FORMULA
a(7n+3) = 3*A001511(1+n), a(7n) = a(7n+2) = a(7n+4) = a(7n+6) = a(7n+3)-2, a(7n+1) = a(7n+5) = a(7n+3)-1. - Antti Karttunen, May 28 2017
MATHEMATICA
Block[{m = 3, i = 7, a}, a = IntegerExponent[2 Range@ i, 2]; Array[IntegerExponent[2 #, 2] /. k_ :> (a + m k - m) &, 15]] // Flatten (* Michael De Vlieger, Nov 02 2018 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A059127 n) (case (modulo n 7) ((3) (* 3 (A001511 (/ (+ 4 n) 7)))) ((0) (+ -2 (A059127 (+ 3 n)))) ((2 4 6) (A059127 (- n (modulo n 7)))) ((1 5) (+ 1 (A059127 (- n 1))))))
;; Antti Karttunen, May 28 2017
KEYWORD
easy,nonn
AUTHOR
Jonas Wallgren, Jan 19 2001
STATUS
approved