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.

Previous Showing 41-50 of 224 results. Next

A238939 Powers of 3 without the digit '0' in their decimal expansion.

Original entry on oeis.org

1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 177147, 531441, 1594323, 4782969, 1162261467, 94143178827, 282429536481, 2541865828329, 7625597484987, 22876792454961, 617673396283947, 16677181699666569, 278128389443693511257285776231761
Offset: 1

Views

Author

M. F. Hasler, Mar 07 2014

Keywords

Comments

Conjectured to be finite and complete. See the OEIS wiki page for further information, references and links.

Crossrefs

For the zeroless numbers (powers x^n), see A238938, A238939, A238940, A195948, A238936, A195908, A195946, A195945, A195942, A195943, A103662.
For the corresponding exponents, see A007377, A008839, A030700, A030701, A008839, A030702, A030703, A030704, A030705, A030706, A195944.
For other related sequences, see A052382, A027870, A102483, A103663.

Programs

  • Mathematica
    Select[3^Range[0,100],DigitCount[#,10,0]==0&] (* Paolo Xausa, Oct 07 2023 *)
  • PARI
    for(n=0,99,vecmin(digits(3^n))&& print1(3^n","))

Formula

a(n) = 3^A030700(n).

Extensions

Keyword:fini removed by Jianing Song, Jan 28 2023 as finiteness is only conjectured.

A023705 Numbers with no 0's in base-4 expansion.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 21, 22, 23, 25, 26, 27, 29, 30, 31, 37, 38, 39, 41, 42, 43, 45, 46, 47, 53, 54, 55, 57, 58, 59, 61, 62, 63, 85, 86, 87, 89, 90, 91, 93, 94, 95, 101, 102, 103, 105, 106, 107, 109, 110, 111, 117, 118, 119, 121, 122, 123
Offset: 1

Views

Author

Keywords

Comments

A032925 is the intersection of this sequence and A023717; cf. A179888. - Reinhard Zumkeller, Jul 31 2010

Crossrefs

Zeroless numbers in some other bases <= 10: A000042 (base 2), A032924 (base 3), A248910 (base 6), A255805 (base 8), A255808 (base 9), A052382 (base 10).
Cf. A100968 (subsequence).

Programs

  • C
    #include 
    uint32_t a_next(uint32_t a_n) { return (a_n + 1) | ((a_n & (a_n + 0xaaaaaaab)) >> 1); } /* Falk Hüffner, Jan 22 2022 */
    
  • Haskell
    a023705 n = a023705_list !! (n-1)
    a023705_list = iterate f 1 where
       f x = 1 + if r < 3 then x else 4 * f x'
             where (x', r) = divMod x 4
    -- Reinhard Zumkeller, Mar 06 2015, Oct 19 2011
    
  • Magma
    [n: n in [1..130] | not 0 in Intseq(n,4)]; // Vincenzo Librandi, Oct 04 2018
    
  • Maple
    R:= [1,2,3]: A:= 1,2,3:
    for i from 1 to 4 do
      R:= map(t -> (4*t+1,4*t+2,4*t+3), R);
      A:= A, op(R);
    od:
    A; # Robert Israel, Oct 04 2018
  • Mathematica
    Select[ Range[ 120 ], (Count[ IntegerDigits[ #, 4 ], 0 ]==0)& ]
    Select[Range[200],DigitCount[#,4,0]==0&] (* Harvey P. Dale, Dec 23 2015 *)
  • PARI
    isok(n) = vecmin(digits(n, 4)); \\ Michel Marcus, Jul 04 2015
    
  • Python
    from sympy import integer_log
    def A023705(n):
        m = integer_log(k:=(n<<1)+1,3)[0]
        return sum(1+(k-3**m)//(3**j<<1)%3<<(j<<1) for j in range(m)) # Chai Wah Wu, Jun 27 2025

Formula

G.f. g(x) satisfies g(x) = (x+2*x^2+3*x^3)/(1-x^3) + 4*(x+x^2+x^3)*g(x^3). - Robert Israel, Oct 04 2018

A052414 Numbers without 6 as a digit.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

Crossrefs

Cf. A004181, A004725, A038614 (subset of primes), A082835 (Kempner series).
Cf. A052382 (without 0), A052383 (without 1), A052404 (without 2), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052419 (without 7), A052421 (without 8), A007095 (without 9).

Programs

  • Haskell
    a052414 = f . subtract 1 where
    f 0 = 0
    f v = 10 * f w + if r > 5 then r + 1 else r where (w, r) = divMod v 9
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [ n: n in [0..89] | not 6 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<6, 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
    Select[Range[0,100],DigitCount[#,10,6]==0&] (* Harvey P. Dale, Jun 20 2013 *)
  • PARI
    lista(nn)=for (n=0, nn, if (!vecsearch(vecsort(digits(n),,8), 6), print1(n, ", "));); \\ Michel Marcus, Feb 22 2015
    
  • PARI
    /* See OEIS wiki page (cf. LINKS) for more programs */
    apply( {A052414(n)=fromdigits(apply(d->d+(d>5),digits(n-1,9)))}, [1..99]) \\ a(n)
    select( {is_A052414(n)=!setsearch(Set(digits(n)),6)}, [0..99]) \\ used in A038614
    next_A052414(n, d=digits(n+=1))={for(i=1,#d, d[i]==6&&return((1+n\d=10^(#d-i))*d)); n} \\ least a(k) > n, used in A038614. - M. F. Hasler, Jan 11 2020
    
  • Python
    from gmpy2 import digits
    def A052414(n): return int(digits(n-1,9).translate(str.maketrans('678','789'))) # Chai Wah Wu, Jun 28 2025
  • sh
    seq 0 1000 | grep -v 6; # Joerg Arndt, May 29 2011
    

Formula

a(n) = replace digits d > 5 by d + 1 in base-9 representation of n - 1. - Reinhard Zumkeller, Oct 07 2014
Sum_{k>1} 1/a(k) = A082835 = 22.205598... (Kempner series). - Bernard Schott, Jan 12 2020, edited by M. F. Hasler, Jan 13 2020

Extensions

Offset changed by Reinhard Zumkeller, Oct 07 2014

A052419 Numbers without 7 as a digit.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

Crossrefs

Cf. A004182, A004726, A038615 (subset of primes), A082836 (Kempner series).
Cf. A052382 (without 0), A052383 (without 1), A052404 (without 2), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052414 (without 6), A052421 (without 8), A007095 (without 9).

Programs

  • Haskell
    a052419 = f . subtract 1 where
    f 0 = 0
    f v = 10 * f w + if r > 6 then r + 1 else r where (w, r) = divMod v 9
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [ n: n in [0..89] | not 7 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<7, 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
    Select[Range[100],DigitCount[#,10,7]==0&] (* Harvey P. Dale, Aug 23 2011 *)
  • PARI
    lista(nn)=for (n=0, nn, if (!vecsearch(vecsort(digits(n),,8), 7), print1(n, ", "));); \\ Michel Marcus, Feb 22 2015
    
  • PARI
    /* See OEIS wiki page for more programs. */
    apply( {A052419(n)=fromdigits(apply(d->d+(d>6),digits(n-1,9)))}, [1..99]) \\ a(n)
    select( {is_A052419(n)=!setsearch(Set(digits(n)),7)}, [0..99]) \\ used in A038615
    next_A052419(n, d=digits(n+=1))={for(i=1,#d, d[i]==7&&return((1+n\d=10^(#d-i))*d)); n} \\ least a(k) > n. Used in A038615. - M. F. Hasler, Jan 11 2020
    
  • Python
    from gmpy2 import digits
    def A052419(n): return int(digits(n-1,9).replace('8','9').replace('7','8')) # Chai Wah Wu, Jun 28 2025
  • sh
    seq 0 1000 | grep -v 7; # Joerg Arndt, May 29 2011
    

Formula

a(n) = replace digits d > 6 by d + 1 in base-9 representation of n - 1. - Reinhard Zumkeller, Oct 07 2014
Sum_{n>1} 1/a(n) = A082836 = 22.493475... (Kempner series). - Bernard Schott, Jan 12 2020, edited by M. F. Hasler, Jan 13 2020

Extensions

Offset changed by Reinhard Zumkeller, Oct 07 2014

A193238 Number of prime digits in decimal representation of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 19 2011

Keywords

Crossrefs

Programs

Formula

a(A084984(n))=0; a(A118950(n))>0; a(A092620(n))=1; a(A092624(n))=2; a(A092625(n))=3; a(A046034(n))=A055642(A046034(n));
a(A000040(n)) = A109066(n).
From Hieronymus Fischer, May 30 2012: (Start)
a(n) = sum_{j=1..m+1} (floor(n/10^j+0.3) + floor(n/10^j+0.5) + floor(n/10^j+0.8) - floor(n/10^j+0.2) - floor(n/10^j+0.4) - floor(n/10^j+0.6)), where m=floor(log_10(n)), n>0.
a(10n+k) = a(n) + a(k), 0<=k<10, n>=0.
a(n) = a(floor(n/10)) + a(n mod 10), n>=0.
a(n) = sum_{j=0..m} a(floor(n/10^j) mod 10), n>=0.
a(A046034(n)) = floor(log_4(3n+1)), n>0.
a(A211681(n)) = 1 + floor((n-1)/4), n>0.
G.f.: g(x) = (1/(1-x))*sum_{j>=0} (x^(2*10^j) + x^(3*10^j)+ x^(5*10^j) + x^(7*10^j))*(1-x^10^j)/(1-x^10^(j+1)).
Also: g(x) = (1/(1-x))*sum_{j>=0} (x^(2*10^j)- x^(4*10^j)+ x^(5*10^j)- x^(6*10^j)+ x^(7*10^j)- x^(8*10^j))/(1-x^10^(j+1)). (End)

A256786 Numbers which are divisible by prime(d) for all digits d in their decimal representation.

Original entry on oeis.org

12, 14, 42, 55, 154, 222, 228, 714, 1122, 1196, 1212, 1414, 2112, 2142, 2262, 3355, 4144, 4242, 5335, 5544, 5555, 6162, 9499, 11112, 11144, 11214, 11424, 11466, 11622, 11818, 11914, 12222, 12882, 14112, 15554, 16666, 21216, 21222, 21252, 21888, 22122, 22212
Offset: 1

Views

Author

Keywords

Comments

All terms are zerofree, cf. A052382;
there is no term containing digits 1 and 3 simultaneously;
a(n) contains at least one digit 1 iff a(n) is even, cf. A011531, A005843;
a(n) contains at least one digit 2 iff a(n) mod 3 = 0, cf. A011532, A008585;
a(n) contains at least one digit 3 iff a(n) mod 10 = 5, cf. A011533, A017329;
A020639(a(n)) <= 23.
The equivalent in base 2 is the empty sequence, in base 3 it is A191681\{0}; see A256874-A256879 for the base 4 - base 9 variant, and A256870 for a variant where digits 0 are allowed but divisibility by prime(d+1) is required instead. - M. F. Hasler, Apr 11 2015

Examples

			Smallest terms containing the nonzero decimal digits:
.  d | prime(d) |  n | a(n)
. ---+----------+--------------------------
.  1 |       2  |  1 |   12 = 2^2 * 3
.  2 |       3  |  1 |   12 = 2^2 * 3
.  3 |       5  | 16 | 3355 = 5 * 11 * 61
.  4 |       7  |  2 |   14 = 2 * 7
.  5 |      11  |  4 |   55 = 5 * 11
.  6 |      13  | 10 | 1196 = 2^2 * 13 * 23
.  7 |      17  |  8 |  714 = 2 * 3 * 7 * 17
.  8 |      19  |  7 |  228 = 2^2 * 3 * 19
.  9 |      23  | 10 | 1196 = 2^2 * 13 * 23 .
		

Crossrefs

Programs

  • Haskell
    a256786 n = a256786_list !! (n-1)
    a256786_list = filter f a052382_list where
       f x = g x where
         g z = z == 0 || x `mod` a000040 d == 0 && g z'
               where (z', d) = divMod z 10
    
  • Mathematica
    Select[Range@22222,FreeQ[IntegerDigits[#],0]&&Total[Mod[#,Prime[IntegerDigits[#]]]]==0&] (* Ivan N. Ianakiev, Apr 11 2015 *)
  • PARI
    is_A256786(n)=!for(i=1,#d=Set(digits(n)),(!d[i]||n%prime(d[i]))&&return) \\ M. F. Hasler, Apr 11 2015
    
  • Python
    primes = [1, 2, 3, 5, 7, 11, 13, 17, 19, 23]
    def ok(n):
        s = str(n)
        return "0" not in s and all(n%primes[int(d)] == 0 for d in s)
    print([k for k in range(22213) if ok(k)]) # Michael S. Branicky, Dec 14 2021

A007932 Numbers that contain only 1's, 2's and 3's.

Original entry on oeis.org

1, 2, 3, 11, 12, 13, 21, 22, 23, 31, 32, 33, 111, 112, 113, 121, 122, 123, 131, 132, 133, 211, 212, 213, 221, 222, 223, 231, 232, 233, 311, 312, 313, 321, 322, 323, 331, 332, 333, 1111, 1112, 1113, 1121, 1122, 1123, 1131, 1132, 1133, 1211, 1212, 1213, 1221
Offset: 1

Views

Author

R. Muller

Keywords

Comments

This sequence is the alternate number system in base 3. - Robert R. Forslund (forslund(AT)tbaytel.net), Jun 27 2003
a(n) is the "bijective base-k numeration" or "k-adic notation" for k=3. - Chris Gaconnet (gaconnet(AT)gmail.com), May 27 2009
a(n) = n written in base 3 where zeros are not allowed but threes are. The three distinct digits used are 1, 2 and 3 instead of 0, 1 and 2. To obtain this sequence from the "canonical" base 3 sequence with zeros allowed, just replace any 0 with a 3 and then subtract one from the group of digits situated on the left: (20-->13; 100-->23; 110-->33; 1000-->223; 1010-->233). This can be done in any integer positive base b, replacing zeros with positive b's and subtracting one from the group of digits situated on the left. And zero is the only digit that can be replaced, since there is always a more significant digit greater than 0, on the left, from which to subtract one. - Robin Garcia, Jan 07 2014

Examples

			a(100)  = 3131.
a(10^3) = 323231.
a(10^4) = 111123331.
a(10^5) = 11231311131.
a(10^6) = 1212133131231.
a(10^7) = 123133223331331.
a(10^8) = 13221311111312131.
a(10^9) = 2113123122313232231.
- _Hieronymus Fischer_, Jun 06 2012
		

References

  • K. Atanassov, On the 97th, 98th and the 99th Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 3, 89-93.
  • A. Salomaa, Formal Languages, Academic Press, 1973. pages 90-91. [From Chris Gaconnet (gaconnet(AT)gmail.com), May 27 2009]

Crossrefs

Programs

  • Mathematica
    NextNbr[n_] := Block[{d = IntegerDigits[n + 1], l}, l = Length[d]; While[l != 1, If[ d[[l]] > 3, d[[l - 1]]++; d[[l]] = 1]; l-- ]; If[ d[[1]] > 3, d[[1]] = 11]; FromDigits[d]]; NestList[ NextNbr, 1, 51]
    Table[FromDigits/@Tuples[{1,2,3},n],{n,4}]//Flatten (* Harvey P. Dale, Mar 29 2018 *)
  • PARI
    a(n) = my (w=3); while (n>w, n -= w; w *= 3); my (d=digits(w+n-1, 3)); d[1] = 0; fromdigits(d) + (10^(#d-1)-1)/9 \\ Rémy Sigrist, Aug 28 2018

Formula

From Hieronymus Fischer, May 30 2012 and Jun 08 2012: (Start)
The formulas are designed to calculate base-10 numbers only using the digits 1, 2, 3.
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 3)*10^j,
where m = floor(log_3(2*n+1)), b(j) = floor((2*n+1-3^m)/(2*3^j)).
Special values:
a(k*(3^n-1)/2) = k*(10^n-1)/9, k=1,2,3.
a((5*3^n-3)/2) = (4*10^n-1)/3 = 10^n + (10^n-1)/3.
a((3^n-1)/2 - 1) = (10^(n-1)-1)/3, n>1.
Inequalities:
a(n) <= (10^log_3(2*n+1)-1)/9, equality holds for n=(3^k-1)/2, k>0.
a(n) > (3/10)*(10^log_3(2*n+1)-1)/9, n>0.
Lower and upper limits:
lim inf a(n)/10^log_3(2*n) = 1/30, for n --> infinity.
lim sup a(n)/10^log_3(2*n) = 1/9, for n --> infinity.
G.f.: g(x) = (x^(1/2)*(1-x))^(-1) Sum_{j=>0} 10^j*(x^3^j)^(3/2) * (1-x^3^j)*(1 + 2x^3^j + 3x^(2*3^j))/(1 - x^3^(j+1)).
Also: g(x) = (1/(1-x)) Sum_{j>=0} (1 - 4(x^3^j)^3 + 3(x^3^j)^4)*x^3^j*f_j(x)/(1-x^3^j), where f_j(x) = 10^j*x^((3^j-1)/2)/(1-(x^3^j)^3). The f_j obey the recurrence f_0(x) = 1/(1-x^3), f_(j+1)(x) = 10x*f_j(x^3).
Also: g(x) = (1/(1-x))*(h_(3,0)(x) + h_(3,1)(x) + h_(3,2)(x) - 3*h_(3,3)(x)), where h_(3,k)(x) = Sum_{j>=0} 10^j*x^((3^(j+1)-1)/2) * (x^3^j)^k/(1-(x^3^j)^3).
(End)

Extensions

Edited and extended by Robert G. Wilson v, Dec 14 2002
Crossrefs added by Hieronymus Fischer, Jun 06 2012

A052406 Numbers without 4 as a digit.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

Comments

This is a frequent sequence on Chinese, Japanese and Korean elevator buttons. - Jean-Sebastien Girard (circeus(AT)hotmail.com), Jul 28 2008
Essentially numbers in base 9 (using digits 0, 1, 2, 3, 5, 6, 7, 8, 9 rather than 0-8). - Charles R Greathouse IV, Oct 13 2013

Crossrefs

Cf. A004179, A004723, A011760, A038612 (subset of primes), A082833 (Kempner series).
Cf. A052382 (without 0), A052383 (without 1), A052404 (without 2), A052405 (without 3), A052413 (without 5), A052414 (without 6), A052419 (without 7), A052421 (without 8), A007095 (without 9).

Programs

  • Haskell
    a052406 = f . subtract 1 where
    f 0 = 0
    f v = 10 * f w + if r > 3 then r + 1 else r where (w, r) = divMod v 9
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [ n: n in [0..89] | not 4 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<4, 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
    Select[Range[100], DigitCount[#, 10, 4] == 0 &] (* Alonso del Arte, Oct 13 2013 *)
  • PARI
    g(n)= local(x,v,j,flag); for(x=1,n, v=Vec(Str(x)); flag=1; for(j=1,length(v), if(v[j]=="4",flag=0)); if(flag,print1(x",") ) ) \\ Cino Hilliard, Apr 01 2007
    
  • PARI
    apply( {A052406(n)=fromdigits(apply(d->d+(d>3),digits(n-1,9)))}, [1..99]) \\ a(n)
    select( {is_A052406(n)=!setsearch(Set(digits(n)),4)}, [0..99]) \\ Used in A038612
    next_A052406(n, d=digits(n+=1))={for(i=1, #d, d[i]!=4|| return((1+n\d=10^(#d-i))*d)); n} \\ least a(k) > n. Used for A038612. - M. F. Hasler, Jan 11 2020
    
  • Python
    def A052406(n): n-=1; return sum((d+(d>3))*10**i for d,i in ((n//9**i%9,i) for i in range(math.ceil(math.log(n+1,9))))) # M. F. Hasler, Jan 13 2020
    
  • Python
    from gmpy2 import digits
    def A052406(n): return int(digits(n-1,9).translate(str.maketrans('45678','56789'))) # Chai Wah Wu, Jun 28 2025
  • sh
    seq 0 1000 | grep -v 4; # Joerg Arndt, May 29 2011
    

Formula

a(n) = replace digits d > 3 by d + 1 in base-9 representation of n - 1. - Reinhard Zumkeller, Oct 07 2014
Sum_{k>1} 1/a(k) = A082833 = 21.327465... (Kempner series). - Bernard Schott, Jan 12 2020, edited by M. F. Hasler, Jan 13 2020

Extensions

Offset changed by Reinhard Zumkeller, Oct 07 2014

A082839 Decimal expansion of Kempner series Sum_{k >= 1, k has no digit 0 in base 10} 1/k.

Original entry on oeis.org

2, 3, 1, 0, 3, 4, 4, 7, 9, 0, 9, 4, 2, 0, 5, 4, 1, 6, 1, 6, 0, 3, 4, 0, 5, 4, 0, 4, 3, 3, 2, 5, 5, 9, 8, 1, 3, 8, 3, 0, 2, 8, 0, 0, 0, 0, 5, 2, 8, 2, 1, 4, 1, 8, 8, 6, 7, 2, 3, 0, 9, 4, 7, 7, 2, 7, 3, 8, 7, 5, 0, 7, 9, 6, 0, 6, 1, 4, 1, 9, 4, 2, 6, 3, 5, 9, 2, 0, 1, 9, 1, 0, 5, 2, 6, 1, 3, 9, 3, 3, 8, 6, 5, 2, 1
Offset: 2

Views

Author

Robert G. Wilson v, Apr 14 2003

Keywords

Comments

"The most novel culling of the terms of the harmonic series has to be due to A. J. Kempner, who in 1914 considered what would happen if all terms are removed from it which have a particular digit appearing in their denominators. For example, if we choose the digits 7, we would exclude the terms with denominators such as 7, 27, 173, 33779, etc. There are 10 such series, each resulting from the removal of one of the digits 0, 1, 2, ..., 9 and the first question which naturally arises is just what percentage of the terms of the series are we removing by the process?"
"The sum of the reciprocals, 1 + 1/2 + 1/3 + 1/4 + 1/5 + ... [A002387] is unbounded. By taking sufficiently many terms, it can be made as large as one pleases. However, if the reciprocals of all numbers that when written in base 10 contain at least one 0 are omitted, then the sum has the limit, 23.10345... [Boas and Wrench, AMM v78]." - Wells.
Sums of this type are now called Kempner series, cf. LINKS. Convergence of the series is not more surprising than, and related to the fact that almost all numbers are pandigital (these have asymptotic density 1), i.e., "almost no number lacks any digit": Only a fraction of (9/10)^(L-1) of the L-digit numbers don't have a digit 0. Using L-1 = [log_10 k] ~ log_10 k, this density becomes 0.9^(L-1) ~ k^(log_10 0.9) ~ 1/k^0.046. If we multiply the generic term 1/k with this density, we have a converging series with value zeta(1 - log_10 0.9) ~ 22.4. More generally, almost all numbers contain any given substring of digits, e.g., 314159, and the sum over 1/k becomes convergent even if we omit just the terms having 314159 somewhere in their digits. - M. F. Hasler, Jan 13 2020

Examples

			23.10344790942054161603...
		

References

  • Paul Halmos, "Problems for Mathematicians, Young and Old", Dolciani Mathematical Expositions, 1991, p. 258.
  • Julian Havil, Gamma, Exploring Euler's Constant, Princeton University Press, Princeton and Oxford, 2003, p. 34.
  • David Wells, "The Penguin Dictionary of Curious and Interesting Numbers," Revised Edition, Penguin Books, London, England, 1997.

Crossrefs

Programs

  • Mathematica
    (* see the Mmca in Wolfram Library Archive. - Robert G. Wilson v, Jun 01 2009 *)

Extensions

More terms from Robert G. Wilson v, Jun 01 2009

A043489 Numbers having one 0 in base 10.

Original entry on oeis.org

0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 120, 130, 140, 150, 160, 170, 180, 190, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 220, 230, 240, 250, 260, 270, 280, 290, 301, 302, 303
Offset: 1

Views

Author

Keywords

Comments

From Hieronymus Fischer, May 28 2014: (Start)
Inversion:
Given a term m, the index n such that a(n) = m can be calculated by the following procedure [see Prog section with an implementation in Smalltalk]. With k := floor(log_10(m)), z = digit position of the '0' in m counted from the right (starting with 0).
Case 1: A043489_inverse(m) = 1 + Sum_{j=1..k} A052382_inverse(floor(m/10^j))*9^(j-1), if z = 0.
Case 2: A043489_inverse(m) = 1 + A043489_inverse(m - c - m mod 10^z) + A052382_inverse(m mod 10^z)) - (9^z - 1)/8, if z > 0, where c := 1, if the digit at position z+1 of m is ‘1’ and k > z + 1, otherwise c := 10.
Example 1: m = 990, k = 2, z = 0 (Case 1), A043489_inverse(990) = 1 + A052382_inverse(99))*1 + A052382_inverse(9))*9 = 1 + 90 + 81 = 172.
Example 2: m = 1099, k = 3, z = 2 (Case 2), A043489_inverse(1099) = 1 + A043489_inverse(990) + A052382_inverse(99)) - 10 = 1 + A043489_inverse(990) + 80 = 1 + 172 + 80 = 253.
(End)

Examples

			a(10^1)= 90.
a(10^2)= 590.
a(10^3)= 4190.
a(10^4)= 35209.
a(10^5)= 308949.
a(10^6)= 2901559.
a(10^7)= 27250269.
a(10^8)= 263280979.
a(10^9)= 2591064889.
a(10^10)= 25822705899.
a(10^20)= 366116331598324670219.
a(10^50)= 3.7349122484477433715662812...*10^51
a(10^100)= 4.4588697999177752943575344...*10^103.
a(10^1000)= 5.5729817962143143812258616...*10^1045.
[Examples by _Hieronymus Fischer_, May 28 2014]
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,9000],DigitCount[#,10,0]==1&] (* Enrique Pérez Herrero, Nov 29 2013 *)
  • PARI
    is(n)=#select(d->d==0, digits(n))==1 \\ Charles R Greathouse IV, Oct 06 2016
  • Smalltalk
    A043489_nextTerm
      "Answers the minimal number > m which contains exactly 1 zero digit (in base 10), where m is the receiver.
      Usage: a(n) A043489_nextTerm
      Answer: a(n+1)"
      | d d0 s n p |
      n := self.
      p := 1.
      s := n.
      (d0 := n // p \\ 10) = 0
         ifTrue:
              [p := 10 * p.
              s := s + 1].
      [(d := n // p \\ 10) = 9] whileTrue:
              [s := s - (8 * p).
              p := 10 * p].
      (d = 0 or: [d0 = 0]) ifTrue: [s := s - (p // 10)].
      ^s + p
    [by Hieronymus Fischer, May 28 2014]
    ------------------
    
  • Smalltalk
    A043489
    "Answers the n-th number such that number of 0's in base 10 is 1, where n is the receiver. Uses the method zerofree: base from A052382.
      Usage: n A043489
      Answer: a(n)"
      | n a b dj cj gj ej j r |
      n := self.
      n <= 1 ifTrue: [^r := 0].
      n <= 10 ifTrue: [^r := (n - 1) * 10].
      j := n invGeometricSum2: 9.
      b := j geometricSum2: 9.
      cj := 9 ** j.
      dj := (j + 1) * cj.
      gj := (cj - 1) / 8.
      ej := 10 ** j.
      a := n - b - 2.
      b := a \\ dj.
      r := (a // dj + 1) * ej * 10.
      [b >= cj] whileTrue:
              [a := b - cj.
              cj := cj // 9.
              dj := j * cj.
              b := a \\ dj.
              r := (a // dj + 1) * ej + r.
              gj := gj - cj.
              ej := ej // 10.
              j := j - 1].
      r := (b + gj zerofree: 10) + r.
      ^r
    [by Hieronymus Fischer, May 28 2014]
    ------------------
    
  • Smalltalk
    A043489_inverse
      "Answers the index n such that A043489(n) = m, where m is the receiver. Uses A052382_inverse from A052382.
      Usage: n zerofree_inverse: b [b = 10 for this sequence]
      Answer: a(n)"
      | m p q s r m1 mr |
      m := self.
      m < 100 ifTrue: [^m // 10 + 1].
      p := q := 1.
      s := 0.
      [m // p \\ 10 = 0] whileFalse:
         [p := 10 * p.
         s := s + q.
         q := 9 * q].
      p > 1
         ifTrue:
         [r := m \\ p.
         p := 10 * p.
         m1 := m // p.
         (m1 \\ 10 = 1 and: [m1 > 10])
              ifTrue: [mr := m - r - 1]
              ifFalse: [mr := m - r - 10].
         ^mr A043489_inverse + r A052382_inverse - s + 1]
         ifFalse:
         [s := 1.
         p := 10.
         q := 1.
         [p < m] whileTrue:
              [s := (m // p) A052382_inverse * q + s.
              p := 10 * p.
              q := 9 * q].
         ^s]
    [by Hieronymus Fischer, May 28 2014]
    

Formula

From Hieronymus Fischer, May 28 2014: (Start)
a(1 + Sum_{j=1..n} j*9^j) = 10*(10^n - 1).
a(2 + Sum_{j=1..n} j*9^j) = 10^(n+1) + (10^n - 1)/9 = (91*10^n - 1)/9.
a((9^(n+1) - 1)/8 + 1 + Sum_{j=1..n} j*9^j) = 10*(10^(n+1) - 1)/9, where Sum_{j=1..n} j*9^j = (1-(n+1)*9^n+n*9^(n+1))*9/64.
Iterative calculation:
With i := digit position of the '0' in a(n) counted from the right (starting with 0), j = number of contiguous '9' digits in a(n) counted from position 1, if i = 0, and counted from position 0, if i > 0 (0 if none)
a(n+1) = a(n) + 10 + (10^j - 1)/9, if i = 0.
a(n+1) = a(n) + 1 + (10^(j-1) - 1)/9, if i = j > 0.
a(n+1) = a(n) + 1 + (10^j - 1)/9, if i > j.
[see Prog section for an implementation in Smalltalk].
Direct calculation:
Set j := max( m | (Sum_{i=1..m} i*9^i) < n) and c(1) := n - 2 - Sum_{i=1..j} i*9^i. Define successively,
c(i+1) = c(i) mod ((j-i+2)*9^(j-i+1)) - 9^(j-i+1) while this value is >= 0, and set k := i for the last such index for which c(i) >= 0.
Then a(n) = A052382(c(k) mod ((j-k+2)*9^(j-k+1)) + (9^(j-k+1)-1)/8) + Sum_{i=1..k} ((floor(c(i)/((j-i+2)*9^(j-i+1))) + 1) * 10^(j-i+2)). [see Prog section for an implementation in Smalltalk].
Behavior for large n:
a(n) = O(n^(log(10)/log(9))/log(n)).
a(n) = O(n^1.047951651.../log(n)).
Inequalities:
a(n) < 2*(8n)^log_9(10)/(log_9(8n)*log_9(10)).
a(n) < (8n)^log_9(10)/(log_9(8n)*log_9(10)), for large n (n > 10^50).
a(n) > 0.9*(8n)^log_9(10)/(log_9(8n)*log_9(10)), for 2 < n < 10^50.
a(n) >= A011540(n), equality holds for n <= 10.
(End)
Previous Showing 41-50 of 224 results. Next