login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A141707 Least k>0 such that (2n-1)k is palindromic in base 2. 4
1, 1, 1, 1, 1, 3, 5, 1, 1, 27, 1, 89, 13, 1, 49, 1, 1, 13, 69, 5, 25, 3, 1, 103, 29, 1, 63, 3, 9, 103, 7, 1, 1, 19, 37, 147, 1, 13, 3, 19, 11, 45, 1, 37, 23, 3, 1, 27, 61, 1, 233, 47, 13, 1, 21, 23, 59, 525, 5, 1, 93, 23, 41, 1, 1, 49, 27, 13, 187, 87, 269, 15, 111, 13, 29, 7, 1, 13, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,6
COMMENTS
Even numbers cannot be palindromic in base 2 (unless leading zeros are considered), that's why we search only for odd numbers 2n-1 the k-values such that k(2n-1) is palindromic in base 2. Obviously they are necessarily also odd.
a(A044051(n)) = 1. - Reinhard Zumkeller, Apr 20 2015
LINKS
EXAMPLE
a(1..5)=1 since 1,3,5,7,9 are already palindromic in base 2.
a(6)=3 since 2*6-1=11 and 2*11=22 are not palindromic in base 2, but 3*11=33 is.
MATHEMATICA
lkp[n_]:=Module[{k=1, n2=2n-1}, While[IntegerDigits[k*n2, 2]!= Reverse[ IntegerDigits[ k*n2, 2]], k++]; k]; Array[lkp, 80] (* Harvey P. Dale, Mar 19 2016 *)
PROG
(PARI) A141707(n, L=10^9)={ n=2*n-1; forstep(k=1, L, 2, binary(k*n)-vecextract(binary(k*n), "-1..1") || return(k))}
(Haskell)
a141707 n = head [k | k <- [1, 3 ..], a178225 (k * (2 * n - 1)) == 1]
-- Reinhard Zumkeller, Apr 20 2015
(Python)
def binpal(n): b = bin(n)[2:]; return b == b[::-1]
def a(n):
m = 2*n - 1
km = m
while not binpal(km): km += m
return km//m
print([a(n) for n in range(1, 80)]) # Michael S. Branicky, Mar 20 2022
CROSSREFS
Sequence in context: A016610 A356551 A305470 * A329593 A263490 A190180
KEYWORD
base,easy,nice,nonn
AUTHOR
M. F. Hasler, Jul 17 2008
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 23:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)