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.

Showing 1-9 of 9 results.

A052404 Numbers without 2 as a digit.

Original entry on oeis.org

0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 88, 89
Offset: 1

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

References

  • M. J. Halm, Word Weirdness, Mpossibilities 66 (Feb. 1998), p. 5.

Crossrefs

Cf. A004177, A004721, A072809, A082831 (Kempner series).
Cf. A052382 (without 0), A052383 (without 1), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052414 (without 6), A052419 (without 7), A052421 (without 8), A007095 (without 9).
See A038604 for the subset of primes. - M. F. Hasler, Jan 11 2020

Programs

  • Haskell
    a052404 = f . subtract 1 where
       f 0 = 0
       f v = 10 * f w + if r > 1 then r + 1 else r  where (w, r) = divMod v 9
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [ n: n in [0..89] | not 2 in Intseq(n) ];  // Bruno Berselli, May 28 2011
    
  • Maple
    a:= proc(n) local l, m; l, m:= 0, n-1;
          while m>0 do l:= (d->
            `if`(d<2, d, d+1))(irem(m, 9, 'm')), l
          od; parse(cat(l))/10
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 01 2016
  • Mathematica
    ban2Q[n_]:=FreeQ[IntegerDigits[n],2]==True; Select[Range[0,89],ban2Q[#] &] (* Jayanta Basu, May 17 2013 *)
    Select[Range[0,100],DigitCount[#,10,2]==0&] (* Harvey P. Dale, Apr 13 2015 *)
  • PARI
    lista(nn, d=2) = {for (n=0, nn, if (!vecsearch(vecsort(digits(n),,8),d), print1(n, ", ")););} \\ Michel Marcus, Feb 21 2015
    
  • PARI
    apply( {A052404(n)=fromdigits(apply(d->d+(d>1),digits(n-1,9)))}, [1..99])
    next_A052404(n, d=digits(n+=1))={for(i=1, #d, d[i]==2&&return((1+n\d=10^(#d-i))*d)); n} \\ least a(k) > n: if there's a digit 2 in n+1, replace the first occurrence by 3 and all following digits by 0.
    (A052404_vec(N)=vector(N, i, N=if(i>1, next_A052404(N))))(99) \\ first N terms
    select( {is_A052404(n)=!setsearch(Set(digits(n)),2)}, [0..99])
    (A052404_upto(N)=select( is_A052404, [0..N]))(99) \\ M. F. Hasler, Jan 11 2020
    
  • Python
    from gmpy2 import digits
    def A052404(n): return int(''.join(str(int(d)+1) if d>'1' else d for d in digits(n-1,9))) # Chai Wah Wu, Aug 30 2024
  • sh
    seq 0 1000 | grep -v 2; # Joerg Arndt, May 29 2011
    

Formula

If the offset were changed to 0: a(0) = 0, a(n+1) = f(a(n)+1,a(n)+1) where f(x,y) = if x<10 and x<>2 then y else if x mod 10 = 2 then f(y+1,y+1) else f(floor(x/10),y). - Reinhard Zumkeller, Mar 02 2008
a(n) = replace digits d > 1 by d + 1 in base-9 representation of n - 1. - Reinhard Zumkeller, Oct 07 2014
Sum_{k>1} 1/a(k) = A082831 = 19.257356... (Kempner series). - Bernard Schott, Jan 12 2020, edited by M. F. Hasler, Jan 14 2020

Extensions

Offset changed by Reinhard Zumkeller, Oct 07 2014

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

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

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

Examples

			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.
		

Crossrefs

See A004176 for another version.
Cf. A004719, A004721, ...

Programs

  • 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 *)
  • 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

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

A004722 Delete all digits 3 from the terms of the sequence of nonnegative integers.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 2, 24, 25, 26, 27, 28, 29, 0, 1, 2, 4, 5, 6, 7, 8, 9, 40, 41, 42, 4, 44, 45, 46, 47, 48, 49, 50, 51, 52, 5, 54, 55, 56, 57, 58, 59, 60, 61, 62, 6, 64, 65, 66, 67, 68, 69, 70, 71, 72, 7, 74, 75, 76
Offset: 0

Views

Author

Keywords

Comments

Very similar to A004178, except that 3-repdigits (A002277) are completely removed from the sequence, whereas A004178 has 0's in their place. It is thus guaranteed that a(n) = n only when n < 3. - Alonso del Arte, Oct 18 2012

Crossrefs

Programs

  • MATLAB
    m=1;
    for u=0:1000
        v=dec2base(u,10)-'0'; v = v(v~=3);
        if length(v)>0;sol(m)=(str2num(strrep(num2str(v), ' ', ''))); m=m+1; end;
    end
    sol % Marius A. Burtea, May 07 2019
    
  • Mathematica
    endAt = 103; Delete[Table[FromDigits[DeleteCases[IntegerDigits[n], 3]], {n, 0, endAt}], Table[{(10^expo - 1)/3 + 1}, {expo, Floor[Log[10, endAt]]}]] (* Alonso del Arte, Apr 29 2019 *)
  • Python
    def A004722(n):
        l = len(str(n))
        m = (10**l-1)//3
        k = n + l - int(n+l < m)
        return 2 if k == m else int(str(k).replace('3','')) # Chai Wah Wu, Apr 20 2021

Formula

a(n) = n for -1 < n < 3;
a(n) = A004178(n + 1) for 2 < n < 32,
a(n) = A004178(n + 2) for 31 < n < 331,
a(n) = A004178(n + 3) for 330 < n < 3330,
a(n) = A004178(n + 4) for 3329 < n < 33329, etc. - Alonso del Arte, Oct 21 2012

Extensions

Sean A. Irvine pointed out erroneous terms in b-file and confirmed correction, Apr 28 2019
Name edited by Felix Fröhlich, Apr 29 2019

A004724 Delete all 5's from the sequence of nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 3, 36, 37, 38, 39, 40, 41, 42, 43, 44, 4, 46, 47, 48, 49, 0, 1, 2, 3, 4, 6, 7, 8, 9, 60, 61, 62, 63, 64, 6, 66, 67, 68, 69, 70, 71, 72, 73, 74, 7, 76
Offset: 0

Views

Author

Keywords

Comments

In contrast to the variant A004180 where a(n) = 0 when all the digits of n are 5's, here a number completely disappears in that case, so that subsequent indices are shifted and for n > 4, a(n) is not the result of deleting 5's from n: see formula. - M. F. Hasler, Jan 13 2020

Examples

			From  _M. F. Hasler_, Jan 13 2020: (Start)
After a(4) = 4 comes a(5) = 6, since the number 5 completely disappears.
a(48) = 49 is followed by 0, 1, 2, 3, 4 (i.e., 50, ..., 54 with the initial digit removed) and then a(54) = 6, because 55 disappears completely.
Illustration of the formula: as long as n < 5 (the first number that completely disappears) we have a(n) = A004180(n). Here n has 1 digit but n+1 does not exceed the (single repdigit) 5 (left hand side in the Iverson bracket), so m = 0. From n = 5 on, n+1 > 5, so m = 1.
Then, when n has L(n) = 2 digits, we still have n = 2 - 1 = 1 as long as n+2 <= 55 or n <= 53, but m = 3 for n > 55 - 2 = 53, i.e., from n = 54 on (where the term 55 has disappeared, see above).
Similarly, m = 3 for n > 555 - 3, i.e., from n >= 553 on, etc. (End)
		

Crossrefs

Cf. A004180 (delete digits 5 in n), A052413 (numbers with no digit 5).

Programs

  • MATLAB
    m=1; for u=0:76 v=dec2base(u, 10)-'0'; v = v(v~=5);  if length(v)>0; sol(m)=(str2num(strrep(num2str(v), ' ', ''))); m=m+1; end; end; sol % Marius A. Burtea, Jan 16 2020
    
  • PARI
    apply( {A004724(n,L=logint(n+!n,10)+1)=A004180(n+L-(10^L\9*5-L>=n))}, [0..99])
    A004724_upto(N)={[fromdigits(v)|v<-[[d|d<-digits(n+!n*50),d!=5]|n<-[0..N]],#v]} \\ M. F. Hasler, Jan 13 2020
    
  • Python
    def A004724(n):
        l = len(str(n))
        m = 5*(10**l-1)//9
        k = n + l - int(n+l < m)
        return 4 if k == m else int(str(k).replace('5','')) # Chai Wah Wu, Apr 20 2021

Formula

a(n) = A004180(n + m) where m = L(n) - [ (10^L(n)-1)/9*5 >= n + L(n) ], L(n) = floor(log_10(max(n,1)) + 1), the number of digits of n, and [...] is the Iverson bracket (1 if true, 0 else). - M. F. Hasler, Jan 13 2020

A004723 Delete all 4's from the sequence of nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 2, 25, 26, 27, 28, 29, 30, 31, 32, 33, 3, 35, 36, 37, 38, 39, 0, 1, 2, 3, 5, 6, 7, 8, 9, 50, 51, 52, 53, 5, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 65, 66, 67, 68, 69, 70, 71, 72, 73, 7, 75
Offset: 0

Views

Author

Keywords

Comments

Differs from A004179 where A004179(4) = A004179(44) = A004179(444) = ... = 0. - Michel Marcus, May 17 2019

Crossrefs

Programs

  • MATLAB
    m=1;
    for u=0:150
    v=dec2base(u, 10)-'0'; v = v(v~=4);
      if length(v)>0;sol(m)=(str2num(strrep(num2str(v), ' ', ''))); m=m+1; end;
    end;
    sol % Marius A. Burtea, May 17 2019
    
  • Maple
    f:= proc(n) local L,i;
      L:= subs(4=NULL, convert(n,base,10));
      if L = [] then return NULL fi;
      add(L[i]*10^(i-1),i=1..nops(L))
    end proc:
    map(f, [$0..100]); # Robert Israel, May 17 2019
  • Python
    def A004723(n):
        l = len(str(n))
        m = 4*(10**l-1)//9
        k = n + l - int(n+l < m)
        return 3 if k == m else int(str(k).replace('4','')) # Chai Wah Wu, Apr 20 2021

A004725 Delete all 6's from the sequence of nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 2, 27, 28, 29, 30, 31, 32, 33, 34, 35, 3, 37, 38, 39, 40, 41, 42, 43, 44, 45, 4, 47, 48, 49, 50, 51, 52, 53, 54, 55, 5, 57, 58, 59, 0, 1, 2, 3, 4, 5, 7, 8, 9, 70, 71, 72, 73, 74, 75, 7
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    d6[n_]:=Module[{c=DeleteCases[IntegerDigits[n],6]},If[c=={},Nothing, FromDigits[ c]]]; Array[d6,80,0] (* Harvey P. Dale, Oct 09 2017 *)
  • Python
    def A004725(n):
        l = len(str(n))
        m = 2*(10**l-1)//3
        k = n + l - int(n+l < m)
        return 5 if k == m else int(str(k).replace('6','')) # Chai Wah Wu, Apr 20 2021

A004726 Delete all 7's from the sequence of nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 2, 28, 29, 30, 31, 32, 33, 34, 35, 36, 3, 38, 39, 40, 41, 42, 43, 44, 45, 46, 4, 48, 49, 50, 51, 52, 53, 54, 55, 56, 5, 58, 59, 60, 61, 62, 63, 64, 65, 66, 6, 68, 69, 0, 1, 2
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Delete[Table[FromDigits[IntegerDigits[n]/.(7->Nothing)],{n,0,80}],8] (* Harvey P. Dale, Jul 13 2025 *)
  • Python
    def A004726(n):
        l = len(str(n))
        m = 7*(10**l-1)//9
        k = n + l - int(n+l < m)
        return 6 if k == m else int(str(k).replace('7','')) # Chai Wah Wu, Apr 20 2021

A004727 Delete all 8's from the sequence of nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1, 19, 20, 21, 22, 23, 24, 25, 26, 27, 2, 29, 30, 31, 32, 33, 34, 35, 36, 37, 3, 39, 40, 41, 42, 43, 44, 45, 46, 47, 4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 5, 59, 60, 61, 62, 63, 64, 65, 66, 67, 6, 69, 70, 71
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Python
    def A004727(n):
        l = len(str(n))
        m = 8*(10**l-1)//9
        k = n + l - int(n+l < m)
        return 7 if k == m else int(str(k).replace('8','')) # Chai Wah Wu, Apr 20 2021

A004728 Delete all 9's from the sequence of nonnegative integers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 2, 30, 31, 32, 33, 34, 35, 36, 37, 38, 3, 40, 41, 42, 43, 44, 45, 46, 47, 48, 4, 50, 51, 52, 53, 54, 55, 56, 57, 58, 5, 60, 61, 62, 63, 64, 65, 66, 67, 68, 6, 70, 71
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Join[{0},Table[FromDigits[IntegerDigits[n]/.(9->Nothing)],{n,90}]/.(0-> Nothing)] (* Harvey P. Dale, Aug 10 2019 *)
  • Python
    def A004728(n):
        l = len(str(n))
        m = 10**l-1
        k = n + l - int(n+l < m)
        return 8 if k == m else int(str(k).replace('9','')) # Chai Wah Wu, Apr 20 2021
Showing 1-9 of 9 results.