login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A225580 The sum of all substrings of n (including n). 4

%I #12 May 16 2013 13:02:45

%S 1,2,3,4,5,6,7,8,9,11,13,15,17,19,21,23,25,27,29,22,24,26,28,30,32,34,

%T 36,38,40,33,35,37,39,41,43,45,47,49,51,44,46,48,50,52,54,56,58,60,62,

%U 55,57,59,61,63,65,67,69,71,73,66,68,70,72,74,76,78,80

%N The sum of all substrings of n (including n).

%C This sequence differs from A071980 beginning with n = 1010, and differs formulaically beginning with n = 1000 (the first four digit number). Where A071980 is calculated as a + ab + abc + abcd + bcd + cd + d for four digit numbers abcd, this sequence also includes the term bc in the sum.

%C Limits: n <= a(n) < 1.73*n. Proof: a(n)/n will be maximized when substrings are as large as possible while n is as small as possible, or for numbers of the form 199999999... The sum of substrings of this number is < 222222... + < 1234567... or < 3456790123.../2000000000... or < 1.728396.

%C The number 111 is the smallest term that occurs twice in the sequence, when n = {96, 100}. The number 2254 is the smallest term that occurs three times in the sequence, when n = {1476, 1510, 2008}.

%H Christian N. K. Anderson, <a href="/A225580/b225580.txt">Table of n, a(n) for n = 1..10000</a>

%H Christian N. K. Anderson, <a href="/A225580/a225580.gif">Ulam spiral</a> of all values of a(n)<10000, color-coded by the number of times they occur.

%F a(n) = A138953(n) + n. (Note the offset in A138953 is zero. - _Zak Seidov_, May 16 2013)

%e For n=1980, a(n) = 1 + 9 + 8 + 0 + 19 + 98 + 80 + 198 + 980 + 1980 = 3373. Note that A071980(1980) = 3258, because it does not include 9, 8, 98 in the sum.

%t Table[s = IntegerDigits[n]; Total[Flatten[Table[FromDigits /@ Partition[s, i, 1], {i, Length[s]}]]], {n, 100}] (* _T. D. Noe_, May 13 2013 *)

%o (R) sapply(1:100,function(n) {tot=0; s=as.character(n); len=nchar(s); for(i in 1:len) for(j in i:len) tot=tot+as.numeric(substr(s,i,j)); tot})

%Y Cf. A071980, A154770.

%K nonn,base

%O 1,2

%A _Christian N. K. Anderson_ and _Kevin L. Schwartz_, May 10 2013

%E Example corrected by _Zak Seidov_, May 16 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 9 15:40 EDT 2024. Contains 375765 sequences. (Running on oeis4.)