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!)
A093882 Sum of all the numbers formed by deleting one digit from n. 5

%I #22 Oct 27 2023 09:41:25

%S 0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,2,3,4,5,6,7,8,9,10,11,3,4,5,

%T 6,7,8,9,10,11,12,4,5,6,7,8,9,10,11,12,13,5,6,7,8,9,10,11,12,13,14,6,

%U 7,8,9,10,11,12,13,14,15,7,8,9,10,11,12,13,14,15,16,8,9,10,11,12,13,14,15

%N Sum of all the numbers formed by deleting one digit from n.

%C Subsidiary sequence: Sum of the numbers formed by deleting all possible strings touching one end ( containing at least one of the LSB or MSB). A071980(123) = 123 + 12 + 1 + 23 + 3 = 162. A071980(1234) = 1 + 12 + 123 + 1234 + 234 + 34 + 4 = 1642.

%C This allows leading zeros are after deletion. If these are forbidden, the first change would be a(101) = 21 instead of 22. - _Franklin T. Adams-Watters_, Jul 27 2006

%H Alois P. Heinz, <a href="/A093882/b093882.txt">Table of n, a(n) for n = 0..20000</a>

%e a(123) = 12 + 13 + 23 = 48. [corrected by _Harvey P. Dale_, Jul 24 2017]

%p read("transforms"):

%p A093882 := proc(n)

%p local a,dgs,d,dgsred ;

%p a := 0 ;

%p dgs := convert(n,base,10) ;

%p for d from 1 to nops(dgs) do

%p [op(1..d-1,dgs),op(d+1..nops(dgs),dgs)] ;

%p a := a+digcatL(%) ;

%p end do:

%p a ;

%p end proc: # _R. J. Mathar_, May 06 2019

%p # second Maple program:

%p a:= n-> (s-> add(parse(cat("0", s[..i-1],

%p s[i+1..])), i=1..length(s)))(""||n):

%p seq(a(n), n=0..123); # _Alois P. Heinz_, May 06 2019

%t sn[n_]:=Module[{idn=IntegerDigits[n]},Total[FromDigits/@Table[ Delete[ idn,i],{i,Length[idn]}]]]; Array[sn,90,0] (* _Harvey P. Dale_, Jul 24 2017 *)

%o (Python)

%o def a(n): s=str(n); return sum(int(s[:i]+s[i+1:]) for i in range(len(s))) if n > 9 else 0

%o print([a(n) for n in range(88)]) # _Michael S. Branicky_, Oct 27 2023

%Y Cf. A007953.

%K base,nonn,look

%O 0,12

%A _Amarnath Murthy_, Apr 22 2004

%E Corrected and extended by _Franklin T. Adams-Watters_, Jul 27 2006

%E Offset corrected by _Alois P. Heinz_, May 06 2019

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 17 11:02 EDT 2024. Contains 375987 sequences. (Running on oeis4.)