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-5 of 5 results.

A014263 Numbers that contain even digits only.

Original entry on oeis.org

0, 2, 4, 6, 8, 20, 22, 24, 26, 28, 40, 42, 44, 46, 48, 60, 62, 64, 66, 68, 80, 82, 84, 86, 88, 200, 202, 204, 206, 208, 220, 222, 224, 226, 228, 240, 242, 244, 246, 248, 260, 262, 264, 266, 268, 280, 282, 284, 286, 288, 400, 402, 404, 406, 408, 420, 422, 424
Offset: 1

Views

Author

Keywords

Comments

The set of real numbers between 0 and 1 that contain no odd digits in their decimal expansion has Hausdorff dimension log 5 / log 10.
Integers written in base 5 and then doubled (in base 10). - Franklin T. Adams-Watters, Mar 15 2006
The carryless mod 10 "even" numbers (cf. A004529) sorted and duplicates removed. - N. J. A. Sloane, Aug 03 2010.
Complement of A007957; A196564(a(n)) = 0; A103181(a(n)) = 0. - Reinhard Zumkeller, Oct 04 2011
If n-1 is represented as a base-5 number (see A007091) according to n-1 = d(m)d(m-1)…d(3)d(2)d(1)d(0) then a(n)= Sum_{j=0..m} c(d(j))*10^j, where c(k)=0,2,4,6,8 for k=0..4. - Hieronymus Fischer, Jun 03 2012

Examples

			a(1000) = 24888.
a(10^4) = 60888.
a(10^5) = 22288888.
a(10^6) = 446888888.
		

References

  • K. J. Falconer, The Geometry of Fractal Sets, Cambridge, 1985; p. 19.

Crossrefs

Programs

  • Haskell
    a014263 n = a014263_list !! (n-1)
    a014263_list = filter (all (`elem` "02468") . show) [0,2..]
    -- Reinhard Zumkeller, Jul 05 2011
    
  • Magma
    [n: n in [0..424] | Set(Intseq(n)) subset [0..8 by 2]];  // Bruno Berselli, Jul 19 2011
    
  • Maple
    a:= proc(m) local L,i;
      L:= convert(m-1,base,5);
      2*add(L[i]*10^(i-1),i=1..nops(L))
    end proc:
    seq(a(i),i=1..100); # Robert Israel, Apr 07 2016
  • Mathematica
    Select[Range[450], And@@EvenQ[IntegerDigits[#]]&] (* Harvey P. Dale, Jan 30 2011 *)
    FromDigits/@Tuples[{0,2,4,6,8},3] (* Harvey P. Dale, Jul 07 2025 *)
  • PARI
    a(n) = 2*fromdigits(digits(n-1, 5), 10); \\ Michel Marcus, Nov 04 2022
    
  • PARI
    is(n)=#setminus(Set(digits(n)), [0,2,4,6,8])==0 \\ Charles R Greathouse IV, Mar 03 2025
  • Python
    from sympy.ntheory.digits import digits
    def a(n): return int(''.join(str(2*d) for d in digits(n, 5)[1:]))
    print([a(n) for n in range(58)]) # Michael S. Branicky, Jan 13 2022
    
  • Python
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield 0
        for d in count(1):
            for first in "2468":
                for rest in product("02468", repeat=d-1):
                    yield int(first + "".join(rest))
    print(list(islice(agen(), 58))) # Michael S. Branicky, Jan 13 2022
    

Formula

A045888(a(n)) = 0. - Reinhard Zumkeller, Aug 25 2009
a(n) = A179082(n) for n <= 25. - Reinhard Zumkeller, Jun 28 2010
From Hieronymus Fischer, Jun 06 2012: (Start)
a(n) = ((2*b_m(n)) mod 8 + 2)*10^m + Sum_{j=0..m-1} ((2*b_j(n)) mod 10)*10^j, where n>1, b_j(n) = floor((n-1-5^m)/5^j), m = floor(log_5(n-1)).
a(1*5^n+1) = 2*10^n.
a(2*5^n+1) = 4*10^n.
a(3*5^n+1) = 6*10^n.
a(4*5^n+1) = 8*10^n.
a(n) = 2*10^log_5(n-1) for n=5^k+1,
a(n) < 2*10^log_5(n-1), else.
a(n) > (8/9)*10^log_5(n-1) n>1.
a(n) = 2*A007091(n-1), iff the digits of A007091(n-1) are 0 or 1.
G.f.: g(x) = (x/(1-x))*Sum_{j>=0} 10^j*x^5^j *(1-x^5^j)* (2+4x^5^j+ 6(x^2)^5^j+ 8(x^3)^5^j)/(1-x^5^(j+1)).
Also: g(x) = 2*(x/(1-x))*Sum_{j>=0} 10^j*x^5^j * (1-4x^(3*5^j)+3x^(4*5^j))/((1-x^5^j)(1-x^5^(j+1))).
Also: g(x) = 2*(x/(1-x))*(h_(5,1)(x) + h_(5,2)(x) + h_(5,3)(x) + h_(5,4)(x) - 4*h_(5,5)(x)), where h_(5,k)(x) = Sum_{j>=0} 10^j*(x^5^j)^k/(1-(x^5^j)^5). (End)
a(5*n+i-4) = 10*a(n) + 2*i for n >= 1, i=0..4. - Robert Israel, Apr 07 2016
Sum_{n>=2} 1/a(n) = A194182. - Bernard Schott, Jan 13 2022

Extensions

Examples and crossrefs added by Hieronymus Fischer, Jun 06 2012

A045887 Number of distinct even numbers visible as proper subsequences of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 2, 4, 2, 4
Offset: 0

Views

Author

Keywords

Examples

			a(10)=1 because we can form 0.
a(24)=2 because we can form 2, 4.
a(102)=4 because we can form 0, 2, 10, 12.
a(124)=5 because we can form the following even numbers: 2, 4, 12, 14, 24.
		

Crossrefs

Programs

  • Python
    from itertools import combinations
    def a(n):
      s, eset = str(n), set()
      for i in range(len(s)):
        for j in range(i+1, len(s)+1):
          if s[j-1] in "02468":
            if len(s[i:j]) <= 2 and j-i < len(s):
              eset.add(int(s[i:j]))
            else:
              middle = s[i+1:j-1]
              for k in range(len(middle)+1):
                for c in combinations(middle, k):
                  t = s[i] + "".join(c) + s[j-1]
                  if len(t) < len(s):
                    eset.add(int(t))
      return len(eset)
    print([a(n) for n in range(105)]) # Michael S. Branicky, Mar 24 2021

Extensions

More terms from Fabian Rothelius, Feb 08 2001
a(102) and a(104) corrected by Reinhard Zumkeller, Jul 19 2011
a(102) and a(104) reverted to original values by Sean A. Irvine, Mar 23 2021

A342845 Number of distinct even numbers visible as proper substrings of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 2, 3, 2, 3
Offset: 0

Views

Author

Sean A. Irvine, Mar 24 2021

Keywords

Comments

Here substrings must be contiguous.

Examples

			a(10)=1 because we can form 0.
a(24)=2 because we can form 2, 4.
a(102)=3 because we can form 0, 2, 10.
a(124)=4 because we can form the following even numbers: 2, 4, 12, 24.
		

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a045887 n = length $ filter (`isInfixOf` (show n)) $ map show [0, 2..n-1]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Python
    def a(n):
      s, eset = str(n), set()
      for i in range(len(s)):
        for j in range(i+1, len(s)+1):
          if s[j-1] in "02468" and j-i < len(s): # even and proper substring
            eset.add(int(s[i:j]))
      return len(eset)
    print([a(n) for n in range(105)]) # Michael S. Branicky, Mar 23 2021

A342846 Number of distinct odd numbers visible as proper substrings of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2
Offset: 1

Views

Author

Sean A. Irvine, Mar 24 2021

Keywords

Comments

Here substrings are contiguous.
a(A164766(n)) = n and a(m) <> n for m < A164766(n); a(A014263(n)) = 0. - Reinhard Zumkeller, Aug 25 2009

Examples

			a(10)=1 since we can see 1 as a proper substring of 10.
a(105)=2 since we can see 1, 5.
a(132)=3 because we can see 1, 3, 13.
		

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a045888 n = length $ filter (`isInfixOf` (show n)) $ map show [1, 3..n-1]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Python
    def a(n):
      s, eset = str(n), set()
      for i in range(len(s)):
        for j in range(i+1, len(s)+1):
          if s[j-1] in "13579" and j-i < len(s): # odd and proper substring
            eset.add(int(s[i:j]))
      return len(eset)
    print([a(n) for n in range(1, 105)]) # Michael S. Branicky, Mar 24 2021

A164766 Smallest number m such that exactly n odd numbers can be seen as proper subsequences of m in decimal representation.

Original entry on oeis.org

1, 10, 13, 103, 113, 131, 135, 1013, 1031, 1035, 1135, 1231, 1235, 1351, 1357, 10325, 10213, 10135, 10235, 10315, 10351, 10357, 11357, 12431, 12135, 13251, 12315, 12351, 12357, 13571, 13579, 101315, 101235, 103057, 101351, 102431, 102353, 101357, 102135, 103257
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 25 2009

Keywords

Comments

For any term first occurrences of positive even digits (2, 4, 6, 8) are in order. First 2 (if any) before first 4. Any number with an even digit d has all positive even digits < d. Same goes for odd digits (1, 3, 5, 7, 9). - David A. Corneth, Apr 12 2025

Examples

			a(6) = 135 as 135 is the smallest number such that exactly 6 numbers can be seen as proper subsequences of digits of 135 (namely 1, 3, 5, 13, 15, 35). Note that 135 is no proper substring of 135. - _David A. Corneth_, Apr 12 2025
153 is no term as the first 5 is before the first 3 and 5 is a larger odd digit than 3. - _David A. Corneth_, Apr 12 2025
		

Crossrefs

Cf. A045888.

Programs

  • Mathematica
    f[n_] := Count[Union[Most[Rest[Subsets[IntegerDigits[n]]]]], ?(First[#] > 0 && OddQ[Last[#]] &)]; seq[len] := Module[{s = Table[0, {len}], c = 0, m = 1, i}, While[c < len, i = f[m] + 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = m]; m++]; s]; seq[20] (* Amiram Eldar, Apr 12 2025 *)
  • PARI
    \\ See Corneth link

Formula

A045888(a(n)) = n and A045888(m) <> n for m < a(n).

Extensions

Revised and a(25)-a(39) added by Amiram Eldar, Apr 12 2025
Showing 1-5 of 5 results.