login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Summation of a sequence of sequential numbers containing the first term as a substring.
1

%I #13 Jan 27 2014 16:24:00

%S 10,20,33,49,35,63,57,38,19,108,116,124,132,140,715,1650,117,1800,819,

%T 2021,1221,1422,923,2425,925,2601,279,288,297,306,315,324,333,342,351,

%U 360,237,3038,1339,3406,4130,2142,1443,4410,4575,2046,1475,4867,4495

%N Summation of a sequence of sequential numbers containing the first term as a substring.

%H Reinhard Zumkeller, <a href="/A130720/b130720.txt">Table of n, a(n) for n = 1..10000</a>

%F 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.

%e a(2)=20 because 2+3+4+5+6=20 and 2 is a substring of 20.

%e a(16)=1650 because 16+17+18+...+59=1650 and 16 is a substring of 1650.

%t 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 *)

%o (Haskell)

%o import Data.List (find, isInfixOf)

%o import Data.Maybe (fromJust)

%o a130720 n = fromJust $ find ((show n `isInfixOf`) . show) $

%o tail $ scanl1 (+) [n..]

%o -- _Reinhard Zumkeller_, Oct 03 2012

%K easy,nice,nonn,look

%O 1,1

%A _Gil Broussard_, Jul 03 2007