OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
For each counting number i, what is the next number N such that N is the sum of i and the next consecutive counting numbers until N contains i as a substring.
EXAMPLE
a(2)=20 because 2+3+4+5+6=20 and 2 is a substring of 20.
a(16)=1650 because 16+17+18+...+59=1650 and 16 is a substring of 1650.
MATHEMATICA
f[n_]:=Module[{idn=IntegerDigits[n], len=IntegerLength[n], cl = Rest[ Accumulate[ Range[n, n+100]]]}, Select[cl, MemberQ[Partition[ IntegerDigits[ #], len, 1], idn]&, 1]]; Flatten[Array[f, 50]] (* Harvey P. Dale, Jan 18 2012 *)
PROG
(Haskell)
import Data.List (find, isInfixOf)
import Data.Maybe (fromJust)
a130720 n = fromJust $ find ((show n `isInfixOf`) . show) $
tail $ scanl1 (+) [n..]
-- Reinhard Zumkeller, Oct 03 2012
CROSSREFS
KEYWORD
AUTHOR
Gil Broussard, Jul 03 2007
STATUS
approved