On 25/06/2026 22:37, Georg Fischer wrote:
> In
>
> "A273050 Numbers k such that (rol(k) XOR ror(k)) = k"
>
> a recurrence with signature (0, 9, 0, -8) is conjectured,
> while in
>
> "A273180 Numbers n such that ror(n) + rol(n) is a power of 2"
>
> a recurrence with signature (0,0,17,0,0,-16) is given
> without the "conjectured" attribute.
>
> I would be interested in a proof or disproof for both cases.
Let's take a look at the first one. We're looking for n such that rol(n)
XOR n XOR ror(n) is zero. Obviously we want to think of n not as a
binary number but as a mere sequence of bits, with the restriction that
the most significant bit is a 1.
That is, we have bits a0, a1, ..., ak (corresponding to the 1, 2, 4,
..., 2^k places in the binary expansion of n), we require ak = 1, and
the further constraint is that a(i-1) + a(i) + a(i+1) = 0 mod 2, where
all the indices are mod k+1.
Once we have two consecutive bits, all the others are forced, so the
only possible bit-patterns besides all-zero are 110110110... and
101101101..., and so k+1 must be a multiple of 3 to make things line up
nicely as we wrap between 0 and k.
That is, in binary our sequence goes:
0
101 110
101101 110110
101101101 110110110
and so on. Or, to write it a bit differently: 0, 5*1, 6*1, 5*(1+8),
6*(1+8), 5*(1+8+8^2), 6*(1+8+8^2), 5*(1+8+8^2+8^3), etc.
The claimed recurrence relations have "period 2", which means that what
we're really trying to verify is that the sequences
0, 5*1, 5*(1+8), 5*(1+8+8^2), 5*(1+8+8^2+8^3), ... and
0, 6*1, 6*(1+8), 6*(1+8+8^2), 6*(1+8+8^2+8^3), ...
satisfy the recurrence a(n) = 9 a(n-1) - 8 a(n-2). Well, the values in
either of those sequence are constant linear combinations of (8^n) and
(1^n), so we need the recurrence corresponding to the quadratic equation
(t-8)(t-1)=0, which is indeed t^2 - 9t + 8 = 0. So indeed the claimed
recurrence is correct.
The explicit expressions for the odd and even cases conjectured by Colin
Barker definitely have the right shape; I haven't checked that they are
actually correct but if they aren't it's probably because someone's made
a typo. The unified expression for both cases might for all I know be
correct, but it seems like an ugly kludge whose only purpose is to
combine two separate formulae into one. I would suggest a cleaner
unified expression would be a(n) = (8^floor(n/2)-1)/7 * (5 if n even, 6
if n odd) or a(n) = (8^floor(n/2)-1)/7 * (5 + (n rem 2)), and I think
trying to remove the floor / rem 2 stuff obscures rather than enlightens.
--
g