login
A130720
Summation of a sequence of sequential numbers containing the first term as a substring.
1
10, 20, 33, 49, 35, 63, 57, 38, 19, 108, 116, 124, 132, 140, 715, 1650, 117, 1800, 819, 2021, 1221, 1422, 923, 2425, 925, 2601, 279, 288, 297, 306, 315, 324, 333, 342, 351, 360, 237, 3038, 1339, 3406, 4130, 2142, 1443, 4410, 4575, 2046, 1475, 4867, 4495
OFFSET
1,1
LINKS
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
Sequence in context: A274051 A345069 A187712 * A046285 A048030 A048011
KEYWORD
easy,nice,nonn,look
AUTHOR
Gil Broussard, Jul 03 2007
STATUS
approved