0,12

Antti Karttunen, Table of n, a(n) for n = 0..65537

Index entries for sequences related to binary expansion of n

a(n) = n - A206913(n).

The largest binary palindrome that doesn't exceed 30 is 27 (11011 r2). 30 - 27 = 3, so a(30) = 3.

(PARI) isA006995(n) = Vecrev(n=binary(n))==n;

a(n) = {my(k=0); while(!isA006995(n-k), k++); k; } \\ Altug Alkan, Apr 25 2018

A006995 lists the binary palindromes.

A206913 gives the largest binary palindrome that does not exceed n.

Cf. also A261424 (analog in base 10), A280506, A303536.

Sequence in context: A037884 A347728 A336206 * A030567 A049265 A010875

Adjacent sequences: A303531 A303532 A303533 * A303535 A303536 A303537

nonn,easy,base,look

Allan C. Wechsler, Apr 25 2018

More terms from Altug Alkan, Apr 25 2018

approved