OFFSET
1,3
COMMENTS
Guy Steele defines a family of 36 integer sequences, denoted here by GS(i,j) for 1 <= i, j <= 6, as follows. a[1]=1; a[2n] = i-th term of {0,1,a[n],a[n]+1,2a[n],2a[n]+1}; a[2n+1] = j-th term of {0,1,a[n],a[n]+1,2a[n],2a[n]+1}. The present sequence is GS(1,5).
The full list of 36 sequences:
GS(1,1) = A000007
GS(1,2) = A000035
GS(1,3) = A036987
GS(1,4) = A007814
GS(1,5) = A135416 (the present sequence)
GS(1,6) = A135481
GS(2,1) = A135528
GS(2,2) = A000012
GS(2,3) = A000012
GS(2,4) = A091090
GS(2,5) = A135517
GS(2,6) = A135521
GS(3,1) = A036987
GS(3,2) = A000012
GS(3,3) = A000012
GS(3,4) = A000120
GS(3,5) = A048896
GS(3,6) = A038573
GS(4,1) = A135523
GS(4,2) = A001511
GS(4,3) = A008687
GS(4,4) = A070939
GS(4,5) = A135529
GS(4,6) = A135533
GS(5,1) = A048298
GS(5,2) = A006519
GS(5,3) = A080100
GS(5,4) = A087808
GS(5,5) = A053644
GS(5,6) = A000027
GS(6,1) = A135534
GS(6,2) = A038712
GS(6,3) = A135540
GS(6,4) = A135542
GS(6,5) = A054429
GS(6,6) = A003817
(with a(0)=1): Moebius transform of A038712.
LINKS
FORMULA
G.f.: sum{k>=1, 2^(k-1)*x^(2^k-1) }.
Recurrence: a(2n+1) = 2a(n), a(2n) = 0, starting a(1) = 1.
MAPLE
GS:=proc(i, j, M) local a, n; a:=array(1..2*M+1); a[1]:=1;
for n from 1 to M do
a[2*n] :=[0, 1, a[n], a[n]+1, 2*a[n], 2*a[n]+1][i];
a[2*n+1]:=[0, 1, a[n], a[n]+1, 2*a[n], 2*a[n]+1][j];
od: a:=convert(a, list); RETURN(a); end;
GS(1, 5, 200):
MATHEMATICA
i = 1; j = 5; 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, 105] (* Jean-François Alcover, Sep 12 2013 *)
PROG
(PARI)
A048298(n) = if(!n, 0, if(!bitand(n, n-1), n, 0));
(Python)
def A135416(n): return int(not(n&(n+1)))*(n+1)>>1 # Chai Wah Wu, Jul 06 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, based on a message from Guy Steele and Don Knuth, Mar 01 2008
EXTENSIONS
Formulae and comments by Ralf Stephan, Jun 20 2014
STATUS
approved