OFFSET
1,2
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
n=15=3*5 has two factors; only '11'=3 is contained in '1111'=15, therefore a(15)=3.
MATHEMATICA
a[n_] := Module[{bn, pp, sel}, bn = IntegerDigits[n, 2]; pp = FactorInteger[n][[All, 1]]; sel = Select[pp, MatchQ[bn, {___, Sequence @@ IntegerDigits[#, 2], ___}] &]; If[sel == {}, 1, Max[sel]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Aug 13 2013 *)
PROG
(Haskell)
import Numeric (showIntAtBase)
import Data.List (find, isInfixOf)
import Data.Maybe (fromMaybe)
a078834 n = fromMaybe 1 $ find (\p -> showIntAtBase 2 ("01" !!) p ""
`isInfixOf` showIntAtBase 2 ("01" !!) n "") $
reverse $ a027748_row n
-- Reinhard Zumkeller, Sep 19 2011
CROSSREFS
KEYWORD
nonn,base,nice
AUTHOR
Reinhard Zumkeller, Dec 08 2002
STATUS
approved