[seqfan] Re: For bit fiddlers only

Peter Luschny peter.luschny at gmail.com
Wed Jan 1 13:19:47 CET 2014


http://oeis.org/search?q=id%3AA018900%7Cid%3AA057168

MLB> Is this not essentially HAKMEM Item 175, applied to an
initial starting value x=3?

Yes (I was not aware of it). In fact it is A018900.

HAKMEM Item 175 (Gosper) reads: "To get the next higher
number (in A) with the same number of 1 bits"

MLB> If so I guess it should be endowed with the formula
a(0)=3, a(n+1)=A057168(a(n)), n>0 and appropriate references.

I will supply a link to
http://w3.pppl.gov/~hammett/work/2009/AIM-239-ocr.pdf
although very few people still work with a PDP-10 and
36-bit data registers:

HAKMEM Item 175 original:

MOVE B,A
MOVN C,B
AND C,B
ADD A,C
MOVE D,A
XOR D,B
LSH D,-2
IDIVM D,C
IOR A,C

MLB> a(0)=3, a(n+1)=A057168(a(n))

Yes, which can also be written
a(1) = 3; A018900(n) = A057168(A018900(n-1)) for n>1;

Peter



More information about the SeqFan mailing list