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!)
A004720 Delete all digits '1' from the sequence of nonnegative integers. 11
0, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 3, 4, 5, 6, 7, 8, 9, 20, 2, 22, 23, 24, 25, 26, 27, 28, 29, 30, 3, 32, 33, 34, 35, 36, 37, 38, 39, 40, 4, 42, 43, 44, 45, 46, 47, 48, 49, 50, 5, 52, 53, 54, 55, 56, 57, 58, 59, 60, 6, 62, 63, 64, 65, 66, 67, 68, 69, 70, 7, 72, 73, 74, 75 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Similar to A004176. - R. J. Mathar, Oct 28 2008
More precisely, in A004176 the term becomes 0 if no digit remains, e.g., for 1 or 11, whereas here in such a case the integer is completely skipped (as in A004719, A004721, ... which are the analogs for deleting 0, 2, ...). - M. F. Hasler, Feb 01 2016
LINKS
EXAMPLE
The first nonnegative integer, 0, remains as a(1).
The second nonnegative integer, 1, completely disappears upon removal of the digit 1.
The third nonnegative integer, 2, remains as a(2).
The number 10 becomes a(10)=0.
The number 11 completely disappears upon removal of both its digits '1'.
The number 12 becomes a(11)=2.
MAPLE
f:= proc(n) local L, i;
L:= subs(1=NULL, convert(n, base, 10));
if L = [] then NULL
else add(L[i]*10^(i-1), i=1..nops(L))
fi
end proc:
map(f, [$0..100]); # Robert Israel, Feb 07 2016
MATHEMATICA
f[n_] := Block[{a = DeleteCases[ IntegerDigits[n], 1]}, If[a != {}, FromDigits@ a, b]]; DeleteCases[ Array[f, 75, 0], b] (* Robert G. Wilson v, Feb 05 2016 *)
PROG
(PARI) for(n=0, 99, if(t=select(d->d!="1", Vec(Str(n))), print1(concat(t)", "))) \\ M. F. Hasler, Feb 01 2016
(Python)
def A004720(n):
l = len(str(n-1))
m = (10**l-1)//9
k = n + l - 2 + int(n+l-1 >= m)
return 0 if k == m else int(str(k).replace('1', '')) # Chai Wah Wu, Apr 20 2021
CROSSREFS
See A004176 for another version.
Cf. A004719, A004721, ...
Sequence in context: A309590 A169931 A141022 * A088118 A330633 A257850
KEYWORD
base,nonn,nice,look
AUTHOR
EXTENSIONS
Corrected by T. D. Noe, Sep 19 2008
Entry revised by N. J. A. Sloane and M. F. Hasler following a suggestion from Sean A. Irvine, Feb 01 2016
STATUS
approved

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 April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)