A141709 Least positive multiple of n which is palindromic in base 2, allowing for leading zeros (or: ignoring trailing zeros).
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 33, 12, 65, 14, 15, 16, 17, 18, 513, 20, 21, 66, 2047, 24, 325, 130, 27, 28, 1421, 30, 31, 32, 33, 34, 455, 36, 2553, 1026, 195, 40, 1025, 42, 129, 132, 45, 4094, 4841, 48, 1421, 650, 51, 260, 3339, 54, 165, 56, 513, 2842, 6077, 60, 427, 62
Offset: 1
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Haskell
a141709 n = until ((== 1) . a178225 . a000265) (+ n) n -- Reinhard Zumkeller, Nov 06 2012
-
Mathematica
notpalbinQ[i_]:=Module[{id=IntegerDigits[i,2]},While[Last[id]==0,id=Most[id]];id!= Reverse[id]]; lm[n_]:=Module[{k=1},While[notpalbinQ[k n],k++];k n]; Array[lm,70] (* Harvey P. Dale, Dec 28 2011 *)
-
PARI
A141709(n)=forstep(k=n,10^9,n,vecextract(t=binary(k>>valuation(k,2)),"-1..1")-t || return(k))
Comments