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”).

A135533
Guy Steele's sequence GS(4,6) (see A135416).
7
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
OFFSET
1,2
LINKS
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[(n-1)/2], a[(n-1)/2]+1, 2*a[(n-1)/2], 2*a[(n-1)/2]+1}[[j]]; Array[a, 79] (* Jean-Franç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
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on a message from Guy Steele and Don Knuth, Mar 01 2008
STATUS
approved