cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A004720 Delete all digits '1' from the sequence of nonnegative integers.

This page as a plain text file.
%I A004720 #63 Apr 20 2021 22:39:46
%S A004720 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,
%T A004720 3,32,33,34,35,36,37,38,39,40,4,42,43,44,45,46,47,48,49,50,5,52,53,54,
%U A004720 55,56,57,58,59,60,6,62,63,64,65,66,67,68,69,70,7,72,73,74,75
%N A004720 Delete all digits '1' from the sequence of nonnegative integers.
%C A004720 Similar to A004176. - _R. J. Mathar_, Oct 28 2008
%C A004720 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
%H A004720 Sean A. Irvine, <a href="/A004720/b004720.txt">Table of n, a(n) for n = 1..1000</a>
%e A004720 The first nonnegative integer, 0, remains as a(1).
%e A004720 The second nonnegative integer, 1, completely disappears upon removal of the digit 1.
%e A004720 The third nonnegative integer, 2, remains as a(2).
%e A004720 The number 10 becomes a(10)=0.
%e A004720 The number 11 completely disappears upon removal of both its digits '1'.
%e A004720 The number 12 becomes a(11)=2.
%p A004720 f:= proc(n) local L,i;
%p A004720      L:= subs(1=NULL, convert(n,base,10));
%p A004720      if L = [] then NULL
%p A004720      else add(L[i]*10^(i-1),i=1..nops(L))
%p A004720      fi
%p A004720 end proc:
%p A004720 map(f, [$0..100]); # _Robert Israel_, Feb 07 2016
%t A004720 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 *)
%o A004720 (PARI) for(n=0,99,if(t=select(d->d!="1",Vec(Str(n))),print1(concat(t)","))) \\ _M. F. Hasler_, Feb 01 2016
%o A004720 (Python)
%o A004720 def A004720(n):
%o A004720     l = len(str(n-1))
%o A004720     m = (10**l-1)//9
%o A004720     k = n + l - 2 + int(n+l-1 >= m)
%o A004720     return 0 if k == m else int(str(k).replace('1','')) # _Chai Wah Wu_, Apr 20 2021
%Y A004720 See A004176 for another version.
%Y A004720 Cf. A004719, A004721, ...
%K A004720 base,nonn,nice,look
%O A004720 1,2
%A A004720 _N. J. A. Sloane_
%E A004720 Corrected by _T. D. Noe_, Sep 19 2008
%E A004720 Entry revised by _N. J. A. Sloane_ and _M. F. Hasler_ following a suggestion from _Sean A. Irvine_, Feb 01 2016