OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
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
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on a message from Guy Steele and Don Knuth, Mar 01 2008
STATUS
approved