

A135533


Guy Steele's sequence GS(4,6) (see A135416).


6



1, 2, 3, 3, 5, 4, 7, 4, 7, 6, 11, 5, 9, 8, 15, 5, 9, 8, 15, 7, 13, 12, 23, 6, 11, 10, 19, 9, 17, 16, 31, 6, 11, 10, 19, 9, 17, 16, 31, 8, 15, 14, 27, 13, 25, 24, 47, 7, 13, 12, 23, 11, 21, 20, 39, 10, 19, 18, 35, 17, 33, 32, 63, 7, 13, 12, 23, 11, 21, 20, 39, 10, 19, 18, 35, 17, 33, 32, 63
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS

G. C. Greubel, Table of n, a(n) for n = 1..1000


FORMULA

From Don Knuth, Mar 01 2008: (Start)
a(n) = Sum_{k=0..A000523(n)} 2^A000120(n mod 2^k).
a(n) = 1 + A000523(n) * 2^A000120(n)  A135586(n). (End)


MAPLE

GS(4, 6, 200); [see A135416].


MATHEMATICA

i = 4; j = 6; Clear[a]; a[1] = 1; a[n_?EvenQ] := a[n] = {0, 1, a[n/2], a[n/2]+1, 2*a[n/2], 2*a[n/2]+1}[[i]]; a[n_?OddQ] := a[n] = {0, 1, a[(n1)/2], a[(n1)/2]+1, 2*a[(n1)/2], 2*a[(n1)/2]+1}[[j]]; Array[a, 79] (* JeanFrançois Alcover, Sep 12 2013 *)


PROG

(PARI) a(n)=if(n<4, return(n)); (1+n%2)*a(n\2) + 1 \\ Charles R Greathouse IV, Oct 17 2016


CROSSREFS

Cf. A135416.
Sequence in context: A143089 A275314 A161857 * A296075 A318678 A119674
Adjacent sequences: A135530 A135531 A135532 * A135534 A135535 A135536


KEYWORD

nonn,easy


AUTHOR

N. J. A. Sloane, based on a message from Guy Steele and Don Knuth, Mar 01 2008


STATUS

approved



