OFFSET
0,11
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
EXAMPLE
a(98) = #{98, 10*9+8, 2*9+10*8} = 3;
a(99) = #{99, 11*9} = 2;
a(100) = #{100, 10*10, 9*10+10*1, 8*10+20*1, 7*10+30*1, 6*10+40*1, 5*10+50*1, 4*10+60*1, 3*10+70*1, 2*10+80*1, 10+90*1, 100*1} = 12;
a(101) = #{101, 10*10+1, 9*10+11*1, 8*10+21*1, 7*10+31*1, 6*10+41*1, 5*10+51*1, 4*10+61*1, 3*10+71*1, 2*10+81*1, 10+91*1, 101*1} = 12;
a(102) = #{102, 10*10+2, 10*10+2*1, 9*10+6*2, ...} = 298.
PROG
(Haskell)
import Data.List (isInfixOf)
a119999 n = p (filter ((`isInfixOf` show n) . show) [1..n]) n where
p _ 0 = 1
p [] _ = 0
p ks'@(k:ks) m | m < k = 0
| otherwise = p ks' (m - k) + p ks m
-- Reinhard Zumkeller, Aug 14 2011
CROSSREFS
KEYWORD
AUTHOR
Reinhard Zumkeller, Jun 13 2006
STATUS
approved