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-10 of 56 results. Next

A256186 Naught-y primes (A056709) that after removing all zeros become zeroless primes (A038618).

Original entry on oeis.org

101, 103, 107, 109, 307, 401, 503, 509, 601, 607, 701, 709, 809, 907, 1009, 1013, 1031, 1039, 1049, 1051, 1063, 1091, 1093, 1097, 1103, 1301, 1307, 1409, 1607, 1709, 1801, 1901, 1907, 2003, 2011, 2027, 2029, 2039, 2063, 2069, 2081, 2083, 2203, 2207, 2309, 2609, 2707
Offset: 1

Views

Author

Zak Seidov, Mar 19 2015

Keywords

Comments

Subsequence of A256227.

Examples

			a(1)=101=A056709(1) => 11=A038618(5), a(15)=1009=A056709(16) => 19=A038618(8).
		

Crossrefs

Cf. A056709 Naught-y primes, primes with noughts (or zeros), A038618 Primes not containing digit '0', a.k.a. zeroless primes.

Programs

  • Mathematica
    ss = {}; Do[id = IntegerDigits[p = Prime[k]]; If[Min[id] < 1 && PrimeQ[FromDigits[Delete[id, Position[id, 0]]]], ss = {ss, p}], {k, 1, 500}]; Flatten[ss] (* Zak Seidov *)
    Select[Prime[Range[500]], DigitCount[#, 10, 0] > 0 && PrimeQ[FromDigits[DeleteCases[IntegerDigits[#], 0]]] &] (* Alonso del Arte, Mar 22 2015 *)
  • PARI
    is(n)=my(d=digits(n)); isprime(n) && #d>#(d=select(x->x,d)) && isprime(fromdigits(d)) \\ Charles R Greathouse IV, Mar 19 2015

A384793 a(n) is the start of the first occurrence of exactly n consecutive zeroless primes (A038618).

Original entry on oeis.org

461717, 162119, 75431, 81421, 19661, 5923, 4813, 1319, 2917, 1117, 1721, 521, 911, 613, 311, 11519, 25411, 7321, 7717, 8819, 9413, 5519, 9613, 2311, 2, 41213, 16319, 1423, 21121, 8219, 162221, 71233, 113, 68521, 148627, 192611, 86531, 48413, 269219, 13313, 275521, 11113, 111521
Offset: 1

Views

Author

Hugo Pfoertner, based on an idea by René-Louis Clerc, Jun 20 2025

Keywords

Examples

			a(25) = 2 because the 25 primes 2, 3, ..., 97 don't have a zero in their decimal representation, terminated by 101.
a(1) = 461717 because it is the smallest zeroless prime, whose nearest lower and upper prime neighbors 461707 and 461801 both have at least one zero in their decimal representation.
		

Crossrefs

A256227 Naught-y numbers (A011540) that after removing all zeros become zeroless primes (A038618).

Original entry on oeis.org

20, 30, 50, 70, 101, 103, 107, 109, 110, 130, 170, 190, 200, 203, 209, 230, 290, 300, 301, 307, 310, 370, 401, 403, 407, 410, 430, 470, 500, 503, 509, 530, 590, 601, 607, 610, 670, 700, 701, 703, 709, 710, 730, 790, 803, 809, 830, 890, 907, 970, 1001, 1003, 1007, 1009, 1010, 1013, 1027, 1030
Offset: 1

Views

Author

Keywords

Crossrefs

A256186 is the intersection of this sequence with A000040.

Programs

  • Maple
    N:= 4: # to produce all terms with <= N digits
    ZLO:= proc(d) # produce set of d-digit odd zeroless numbers
           option remember;
           if d = 1 then {1,3,5,7,9}
           else
             map(t -> seq(t+x*10^(d-1),x=1..9), ZLO(d-1))
           fi
    end proc:
    addzeros:= proc(x,d) # d-digit numbers formed by inserting 0's into x
            local L,n,R;
          L:= convert(x,base,10);
          n:= nops(L);
          R:= map(t -> [op(t),d], combinat[choose](d-1,n-1));
          seq(add(L[i]*10^(r[i]-1),i=1..n), r = R);
        end proc:
    Z[1]:= {2,3,5,7}:
    for i from 2 to N-1 do Z[i]:= select(isprime,ZLO(i)) od:
    `union`(seq(seq(map(addzeros,Z[i],d), i=1..d-1),d=2..N));
    # if using Maple 11 or earlier, uncomment the next line
    # sort(convert(%,list)); # Robert Israel, Mar 19 2015
  • Mathematica
    ss={};Do[id=IntegerDigits[p];If[Min[id]<1&&PrimeQ[FromDigits[Delete[id,Position[id,0]]]],ss={ss,p}],{p,20,2000}];Flatten[ss]
    Select[Range[1200],DigitCount[#,10,0]>0&&PrimeQ[FromDigits[DeleteCases[ IntegerDigits[ #],0]]]&] (* Harvey P. Dale, Jan 01 2024 *)
  • PARI
    is(n)=my(d=digits(n),e=select(x->x,d)); #e<#d && isprime(fromdigits(e)) \\ Charles R Greathouse IV, Mar 19 2015

A384794 a(n) is the index of A384793(n) in A038618.

Original entry on oeis.org

25854, 10283, 5501, 5861, 1734, 638, 535, 178, 353, 154, 226, 89, 141, 101, 59, 1053, 2110, 758, 800, 899, 949, 593, 970, 282, 1, 3184, 1463, 186, 1769, 836, 10285, 5190, 26, 5075, 9495, 12124, 6222, 3733, 16123, 1205, 16463, 1011, 7153, 59960, 19815, 10030, 23986
Offset: 1

Views

Author

Hugo Pfoertner, Jun 29 2025

Keywords

Comments

There are n consecutive primes in the interval [A038618(a(n)) .. A038618(a(n)+n-1)].

Examples

			a(33) = 26: The terms A038618(26)=113=A384793(33) .. A038618(58)=293 are the first occurrence of exactly 33 consecutive primes in A038618.
		

Crossrefs

Formula

A038618(a(n)) = A384793(n).

A052382 Numbers without 0 in the decimal expansion, colloquial 'zeroless numbers'.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 111, 112, 113
Offset: 1

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

Comments

The entries 1 to 79 match the corresponding subsequence of A043095, but then 81, 91-98, 100, 102, etc. are only in one of the two sequences. - R. J. Mathar, Oct 13 2008
Complement of A011540; A168046(a(n)) = 1; A054054(a(n)) > 0; A007602, A038186, A038618, A052041, A052043, and A052045 are subsequences. - Reinhard Zumkeller, Apr 25 2012, Apr 07 2011, Dec 01 2009
a(n) = n written in base 9 where zeros are not allowed but nines are. The nine distinct digits used are 1, 2, 3, ..., 9 instead of 0, 1, 2, ..., 8. To obtain this sequence from the "canonical" base 9 sequence with zeros allowed, just replace any 0 with a 9 and then subtract one from the group of digits situated on the left. For example, 9^3 = 729 (10) (in base 10) = 1000 (9) (in base 9) = 889 (9-{0}) (in base 9 without zeros) because 100 (9) = [9-1]9 = 89 (9-{0}) and thus 1000 (9) = [89-1]9 = 889 (9-{0}). - Robin Garcia, Jan 15 2014
From Hieronymus Fischer, May 28 2014: (Start)
Inversion: Given a term m, the index n such that a(n) = m can be calculated by A052382_inverse(m) = m - sum_{1<=j<=k} floor(m/10^j)*9^(j-1), where k := floor(log_10(m)) [see Prog section for an implementation in Smalltalk].
Example 1: A052382_inverse(137) = 137 - (floor(137/10) + floor(137/100)*9) = 137 - (13*1 + 1*9) = 137 - 22 = 115.
Example 2: A052382_inverse(4321) = 4321 - (floor(4321/10) + floor(4321/100)*9 + floor(4321/1000)*81) = 4321 - (432*1 + 43*9 + 4*81) = 4321 - (432 + 387 + 324) = 3178. (End)
The sum of the reciprocals of these numbers from a(1)=1 to infinity, called the Kempner series, is convergent towards a limit: 23.103447... whose decimal expansion is in A082839. - Bernard Schott, Feb 23 2019
Integer n > 0 is encoded using bijective base-9 numeration, see Wikipedia link below. - Alois P. Heinz, Feb 16 2020

Examples

			For k >= 0, a(10^k) = (1, 11, 121, 1331, 14641, 162151, 1783661, 19731371, ...) = A325203(k). - _Hieronymus Fischer_, May 30 2012 and Jun 06 2012; edited by _M. F. Hasler_, Jan 13 2020
		

References

  • Paul Halmos, "Problems for Mathematicians, Young and Old", Dolciani Mathematical Expositions, 1991, p. 258.

Crossrefs

Cf. A004719, A052040, different from A067251.
Column k=9 of A214676.
Cf. A011540 (complement), A043489, A054054, A168046.
Cf. A052383 (without 1), A052404 (without 2), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052414 (without 6), A052419 (without 7), A052421 (without 8), A007095 (without 9).
Zeroless numbers in some other bases <= 10: A000042 (base 2), A032924 (base 3), A023705 (base 4), A248910 (base 6), A255805 (base 8), A255808 (base 9).
Cf. A082839 (sum of reciprocals).
Cf. A038618 (subset of primes)

Programs

  • Haskell
    a052382 n = a052382_list !! (n-1)
    a052382_list = iterate f 1 where
    f x = 1 + if r < 9 then x else 10 * f x' where (x', r) = divMod x 10
    -- Reinhard Zumkeller, Mar 08 2015, Apr 07 2011
    
  • Magma
    [ n: n in [1..114] | not 0 in Intseq(n) ]; // Bruno Berselli, May 28 2011
    
  • Maple
    a:= proc(n) local d, l, m; m:= n; l:= NULL;
          while m>0 do d:= irem(m, 9, 'm');
            if d=0 then d:=9; m:= m-1 fi;
            l:= d, l
          od; parse(cat(l))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 11 2015
    is_zeroless := n -> not is(0 in convert(n, base, 10)):
    select(is_zeroless, [seq(1..113)]);  # Peter Luschny, Jun 20 2025
  • Mathematica
    A052382 = Select[Range[100], DigitCount[#, 10, 0] == 0 &] (* Alonso del Arte, Mar 10 2011 *)
  • PARI
    select( {is_A052382(n)=n&&vecmin(digits(n))}, [0..111]) \\ actually: is_A052382 = (bool) A054054. - M. F. Hasler, Jan 23 2013, edited Jan 13 2020
    
  • PARI
    a(n) = for (w=0, oo, if (n >= 9^w, n -= 9^w, return ((10^w-1)/9 + fromdigits(digits(n, 9))))) \\ Rémy Sigrist, Jul 26 2017
    
  • PARI
    apply( {A052382(n,L=logint(n,9))=fromdigits(digits(n-9^L>>3,9))+10^L\9}, [1..100])
    next_A052382(n, d=digits(n+=1))={for(i=1, #d, d[i]|| return(n-n%(d=10^(#d-i+1))+d\9)); n} \\ least a(k) > n. Used in A038618.
    ( {A052382_vec(n,M=1)=M--;vector(n, i, M=next_A052382(M))} )(99) \\ n terms >= M
    \\ See OEIS Wiki page (cf. LINKS) for more programs. - M. F. Hasler, Jan 11 2020
    
  • Python
    A052382 = [n for n in range(1,10**5) if not str(n).count('0')]
    # Chai Wah Wu, Aug 26 2014
    
  • Python
    from sympy import integer_log
    def A052382(n):
        m = integer_log(k:=(n<<3)+1,9)[0]
        return sum((1+(k-9**m)//(9**j<<3)%9)*10**j for j in range(m)) # Chai Wah Wu, Jun 27 2025
  • Smalltalk
    A052382
    "Answers the n-th term of A052382, where n is the receiver."
    ^self zerofree: 10
    A052382_inverse
    "Answers that index n which satisfy A052382(n) = m, where m is the receiver.”
    ^self zerofree_inverse: 10
    zerofree: base
    "Answers the n-th zerofree number in base base, where n is the receiver. Valid for base > 2.
    Usage: n zerofree: b [b = 10 for this sequence]
    Answer: a(n)"
    | n m s c bi ci d |
    n := self.
    c := base - 1.
    m := (base - 2) * n + 1 integerFloorLog: c.
    d := n - (((c raisedToInteger: m) - 1)//(base - 2)).
    bi := 1.
    ci := 1.
    s := 0.
    1 to: m
    do:
    [:i |
    s := (d // ci \\ c + 1) * bi + s.
    bi := base * bi.
    ci := c * ci].
    ^s
    zerofree_inverse: base
    "Answers the index n such that the n-th zerofree number in base base is = m, where m is the receiver. Valid for base > 2.
    Usage: m zerofree_inverse: b [b = 10 for this sequence]
    Answer: n"
    | m p q s |
    m := self.
    s := 0.
    p := base.
    q := 1.
    [p < m] whileTrue:
    [s := m // p * q + s.
    p := base * p.
    q := (base - 1) * q].
    ^m - s
    "by Hieronymus Fischer, May 28 2014"
    
  • sh
    seq 0 1000 | grep -v 0; # Joerg Arndt, May 29 2011
    

Formula

a(n+1) = f(a(n)) with f(x) = 1 + if x mod 10 < 9 then x else 10*f([x/10]). - Reinhard Zumkeller, Nov 15 2009
From Hieronymus Fischer, Apr 30, May 30, Jun 08 2012, Feb 17 2019: (Start)
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 9)*10^j, where m = floor(log_9(8*n + 1)), b(j) = floor((8*n + 1 - 9^m)/(8*9^j)).
Also: a(n) = Sum_{j=0..m-1} (1 + A010878(b(j)))*10^j.
a(9*n + k) = 10*a(n) + k, k=1..9.
Special values:
a(k*(9^n - 1)/8) = k*(10^n - 1)/9, k=1..9.
a((17*9^n - 9)/8) = 2*10^n - 1.
a((9^n - 1)/8 - 1) = 10^(n-1) - 1, n > 1.
Inequalities:
a(n) <= (1/9)*((8*n+1)^(1/log_10(9)) - 1), equality holds for n=(9^k-1)/8, k>0.
a(n) > (1/10)*((8*n+1)^(1/log_10(9)) - 1), n > 0.
Lower and upper limits:
lim inf a(n)/10^log_9(8*n) = 1/10, for n -> infinity.
lim inf a(n)/n^(1/log_10(9)) = 8^(1/log_10(9))/10, for n -> infinity.
lim sup a(n)/10^log_9(8*n) = 1/9, for n -> infinity.
lim sup a(n)/n^(1/log_10(9)) = 8^(1/log_10(9))/9, for n -> infinity.
G.f.: g(x) = (x^(1/8)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(9/8)*(1 - 10z(j)^9 + 9z(j)^10)/((1-z(j))(1-z(j)^9)), where z(j) = x^9^j.
Also: g(x) = (1/(1-x)) Sum_{j>=0} (1 - 10(x^9^j)^9 + 9(x^9^j)^10)*x^9^j*f_j(x)/(1-x^9^j), where f_j(x) = 10^j*x^((9^j-1)/8)/(1-(x^9^j)^9). Here, the f_j obey the recurrence f_0(x) = 1/(1-x^9), f_(j+1)(x) = 10x*f_j(x^9).
Also: g(x) = (1/(1-x))*((Sum{k=0..8} h_(9,k)(x)) - 9*h_(9,9)(x)), where h_(9,k)(x) = Sum_{j>=0} 10^j*x^((9^(j+1)-1)/8)*x^(k*9^j)/(1-x^9^(j+1)).
Generic formulas for analogous sequences with numbers expressed in base p and only using the digits 1, 2, 3, ... d, where 1 < d < p:
a(n) = Sum_{j=0..m-1} (1 + b(j) mod d)*p^j, where m = floor(log_d((d-1)*n+1)), b(j) = floor(((d-1)*n+1-d^m)/((d-1)*d^j)).
Special values:
a(k*(d^n-1)/(d-1)) = k*(10^n-1)/9, k=1..d.
a(d*((2d-1)*d^(n-1)-1)/(d-1)) = ((d+9)*10^n-d)/9 = 10^n + d*(10^n-1)/9.
a((d^n-1)/(d-1)-1) = d*(10^(n-1)-1)/9, n > 1.
Inequalities:
a(n) <= (10^log_d((d-1)*n+1)-1)/9, equality holds for n = (d^k-1)/(d-1), k > 0.
a(n) > (d/10)*(10^log_d((d-1)*n+1)-1)/9, n > 0.
Lower and upper limits:
lim inf a(n)/10^log_d((d-1)*n) = d/90, for n -> infinity.
lim sup a(n)/10^log_d((d-1)*n) = 1/9, for n -> infinity.
G.f.: g(x) = (1/(1-x)) Sum_{j>=0} (1 - (d+1)(x^d^j)^d + d(x^d^j)^(d+1))*x^d^j*f_j(x)/(1-x^d^j), where f_j(x) = p^j*x^((d^j-1)/(d-1))/(1-(x^d^j)^d). Here, the f_j obey the recursion f_0(x) = 1/(1-x^d), f_(j+1)(x) = px*f_j(x^d).
(End)
A052382 = { n | A054054(n) > 0 }. - M. F. Hasler, Jan 23 2013
From Hieronymus Fischer, Feb 20 2019: (Start)
Sum_{n>=1} (-1)^(n+1)/a(n) = 0.696899720...
Sum_{n>=1} 1/a(n)^2 = 1.6269683705819...
Sum_{n>=1} 1/a(n) = 23.1034479... = A082839. This so-called Kempner series converges very slowly. For the calculation of the sum, it is helpful to use the following fraction of partial sums, which converges rapidly:
lim_{n->infinity} (Sum_{k=p(n)..p(n+1)-1} 1/a(k)) / (Sum_{k=p(n-1)..p(n)-1} 1/a(k)) = 9/10, where p(n) = (9^n-1)/8, n > 1.
(End)

Extensions

Typos in formula section corrected by Hieronymus Fischer, May 30 2012
Name clarified by Peter Luschny, Jun 20 2025

A011540 Numbers that contain a digit 0.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Complement of A052382.
A168046(a(n)) = 0; A054054(a(n)) = 0; A055640(a(n)) = 0 for n = 1 and A055640(a(n)) > 0 for n > 1; A055641(a(n)) > 0; subsequence of A188643. - Reinhard Zumkeller, Apr 25 2012, Apr 07 2011; corrected by Hieronymus Fischer, Jan 13 2013
A067898(a(n)) > 0. - Reinhard Zumkeller, May 04 2012; corrected by Hieronymus Fischer, Jan 13 2013
From Hieronymus Fischer, Jan 13 2013, May 28 2014; edited by M. F. Hasler; edited by Hieronymus Fischer, Dec 27 2018: (Start)
Zerofree floor: The greatest zerofree number < a(n) is A052382(a(n) + 1 - n).
The greatest zero-containing number (i.e., non-zerofree number, or term of this sequence) less than a given zerofree number A052382(n) is a(A052382(n) + 1 - n).
The ratio n/(a(n) + 1) indicates the relative proportion of zero-containing numbers less than or equal to a(n) compared to all numbers less than or equal to a(n). Since Lim_{n -> infinity} a(n)/n = 1, this can be expressed as "Almost all numbers contain a 0" (in a slightly informal manner).
As an example, for n = 10^100, n/(a(n) + 1) = 0.9999701184..., i.e., 99.997...% of all numbers between 0 and 10^100 contain a zero digit. Only the tiny proportion of 0.0000298816... (less than 0.003%) contain no zero digit. This is in contrast to the behavior for small indices, where the relative portion of numbers that contain no zero digit is significant: for n = 10^3 and even n = 10^7, the proportion of numbers less than or equal to n that contain no zero digit exceeds 81% and 53%, respectively.
Inversion: Given a number z that contains a zero digit, the index n for which a(n) = z is n = (z+1)*probability that a randomly chosen number k from the range 0..z contains a zero digit.
Example 1: z = 10; the probability that a randomly chosen number less than or equal to 10 contains no zero digit is 9/11. The probability that it contains a zero digit is p = 2/11. Thus, n = (z+1)*p = 2 and a(2) = 10.
Example 2: z = 10^6; the probability that a randomly chosen number with m > 1 digits contains no zero digit is (9/10)^(m-1). For m = 1 the probability is 9/10. The probability that a randomly chosen number with 1..m digits contains no zero digit is q = (9/10)*10/(10^m+1) + Sum_{i = 2..m} (9/10)^(i-1)*(10^i - 10^(i-1))/(10^m+1) = (72 + 81*(9^(m-1) - 1))/(8*(10^m+1)). Hence, the probability that the chosen number with 1..m digits contains a zero digit is p = 1 - q = (8*10^m - 9*9^m + 17)/(8*(10^m + 1)). Thus, p = 402131/1000001 (for z = 10^6) and so n = (z+1)*p = 402131, which implies a(402131) = 10^6.
The number of terms z such that k*10^m <= z < (k+1)*10^m is 10^m - 9^m, where 1 <= k < 10 and m >= 0.
The number of terms z such that 10^m <= z < 10^(m+1) is 9*(10^m - 9^m), where m >= 0.
The number of terms z <= 10^m is (8*10^m - 9*9^m + 17)/8 where m>=1 (cf. A217094).
Infinitely many terms are primes, and most primes are zero-containing numbers. Sketch of a proof: The number of zero-containing numbers less than or equal to a(n) is n. Hence there are a(n) + 1 - n zerofree numbers less than or equal to a(n). From the asymptotic behavior of a(n) (see formula section) it follows a(n) + 1 - n < (5/4)*n^log_10(9) for sufficiently large n. By the prime number theorem we have for each fixed d > 0 the relation pi(n) [number of primes less than or equal to n] > (1 - d/4)*(n/log(n)) for sufficiently large n. Thus, for the number of primes less than or equal to a(n) which contain a zero digit [hereafter denoted as P_0(a(n))] we have P_0(a(n)) > pi(a(n)) - (a(n) + 1 - n) > (1 - d/4)*a(n)/log(a(n)) - (5/4)*n^log_10(9) > (1-d/4)*n/log(n) - (5/4)*n^log_10(9) = (1-d/4)*n/log(n) * (1 - (5/4)*(1/(1-d/4))*(1/n) * n^(log_10(9))*log(n)) > (1-d/2)*n/log(n) for sufficiently large n. Because of a(n) = n + o(n) this also implies P_0(a(n)) > (1 - d)*a(n)/log(a(n)) for sufficiently large n. Thus, the proportion of primes less than or equal to a(n) which contain a zero digit compared to the total number of primes less than or equal to a(n) is arbitrarily near to 1 for sufficiently large n.
Sequence inversion:
Given a term m > 0, the index n such that a(n) = m can be calculated with the following procedure: Define k := floor(log_10(m)) and i := digit position of the leftmost '0' in m counted from the right (starting with 0), then:
A011540_inverse(m) = 2 + m mod 10^i + Sum_{j = 1..k} floor((m - 1 - m mod 10^i)/10^j)*9^(j-1) [see PROG section for an implementation in Smalltalk].
Example: m = 905, k = 2, i = 1, A011540_inverse(905) = 2 + 905 mod 10 + floor((905 - 1 - 905 mod 10)/10)*1 + floor((905 - 1 - 905 mod 10)/100)*9 = 2 + 5 + floor(899/10)*1 + floor(899/100)*9 = 2 + 5 + 89*1 + 8*9 = 168.
(End)
For the number of k-digit numbers containing the digit '0', see A229127. - Jon E. Schoenfield, Sep 14 2013
The above "sketch of proof" only compares the relative densities, and since the density of this sequence is 1, the result is "obvious". But the nontrivial part is that there is no correlation between the absence of a digit '0' and primality of the number (cf. A038618). Indeed, consider the set S defined to be the set of primes with all digits '0' replaced by the smallest possible nonzero digit while avoiding duplicates. Having exactly the same density as the set of primes, the argument of the proof applies in the same way and leads to the same conclusion for the number of zero-containing terms; however, there is none in the set S. - M. F. Hasler, Oct 11 2015, example added Feb 11 2019

Examples

			a(10)      = 90.
a(100)     = 540.
a(10^3)    = 4005.
a(10^4)    = 30501.
a(10^5)    = 253503.
a(10^6)    = 2165031.
a(10^7)    = 20163807
a(10^8)    = 182915091.
a(10^9)    = 1688534028.
a(10^10)   = 15749319096.
a(10^20)   = 114131439770460123393.
a(10^50)   = 10057979971082351274741...89870962249 = 1.0057979971082...*10^50
a(10^100)  = 10000298815737485...786424499 = 1.0000298815737...*10^100.
a(10^1000) = 1...(45 zeros)...196635515818798306...4244999 (1001 digits), using recursive calculation. - _Hieronymus Fischer_, Jan 13 2013
		

Crossrefs

Programs

  • Haskell
    a011540 n = a011540_list !! (n-1)
    a011540_list = filter ((== 0) . a168046) [0..]
    -- Reinhard Zumkeller, Apr 07 2011
    
  • Magma
    [0] cat [ n: n in [0..350] | 0 in Intseq(n) ]; // Vincenzo Librandi, Oct 12 2015
    
  • Mathematica
    Select[Range[0, 299], DigitCount[#, 10, 0] > 0 &] (* Alonso del Arte, Mar 10 2011 *)
    Select[Range[0, 299], Times@@IntegerDigits[#] == 0 &] (* Alonso del Arte, Aug 29 2014 *)
  • PARI
    is(n)=!n||!vecmin(digits(n)) \\ M. F. Hasler, Feb 28 2018, replacing an earlier version from Charles R Greathouse IV, Aug 09 2011
    
  • PARI
    A011540(n)=my(m=log(n+.5)\log(10)+1, f(m)=n-10^m+(9*9^m-17)/8, j=(sign(f(m)+1)+1)\2+m-1, c=[f(j)], k=1); while(c[k]>0,c=concat(c,c[k] % (10^(j-k+1) - 9^(j-k+1)) - 10^(j-k));k++); k>1&&k--||n>1||return(0); c[k]%(10^(j-k+1) - 9^(j-k+1)) + sum(i=1,k, (c[i]\(10^(j-i+1) - 9^(j-i+1)) + 1)*10^(j-i+1)) \\ Uses the "Direct calculation" formula given by H. Fischer. - M. F. Hasler, Oct 11 2015
    
  • Python
    A011540_list = [n for n in range(10**3) if '0' in str(n)] # Chai Wah Wu, Mar 26 2021
  • Smalltalk
    A011540
    "Calculates the n-th number with zero digits recursively - not optimized"
    | n j m b d p r |
    n := self.
    n < 2 ifTrue: [^r := 0].
    m := (n integerFloorLog: 10) + 1.
    j := (n + 1 - ((10 raisedToInteger: m) - (((9 raisedToInteger: (m + 1)) - 17) // 8))) sign + 1 // 2 + m - 1.
    d := (10 raisedToInteger: j) - (9 raisedToInteger: j).
    b := ((10 raisedToInteger: j) - (((9 raisedToInteger: (j + 1)) - 17) // 8)).
    (((n - b) \\ d > (10 raisedToInteger: (j - 1))) and: [n >= 19])
    ifTrue:
    [p := (((n - b) \\ d + b - d) A011540)].
    (n - b) \\ d > (10 raisedToInteger: (j - 1))
    ifFalse: [p := (n - b) \\ d].
    r := (((n - b) // d + 1) * (10 raisedToInteger: j)) + p.
    ^r "Hieronymus Fischer, Jan 13 2013"
    
  • Smalltalk
    A011540_inverse
    "Version 1: Answers the index n such that A011540(n) = m, where m is the receiver.
    Usage: m A011540_inverse
    Answer: n"
    | m p q s r d |
    m := self.
    m < 10 ifTrue: [^1].
    p := q := 1.
    [p < m] whileTrue:
    [d := m // p \\ 10.
    d = 0 ifTrue: [q := p].
    p := 10 * p].
    r := m \\ q.
    s := r + 2.
    p := 10.
    q := 1.
    m := m - r - 1.
    [p < m] whileTrue:
    [s := m // p * q + s.
    p := 10 * p.
    q := 9 * q].
    ^s
    "Hieronymus Fischer, May 28 2014"
    
  • Smalltalk
    A011540_inverse
    "Version 2: Answers the index n such that A011540(n) = m, where m is the receiver.
    Uses A052382_inverse from A052382.
    Usage: m A011540_inverse
    Answer: n"
    | m p q d |
    m := self.
    m < 10 ifTrue: [^1].
    p := q := 1.
    [p < m] whileTrue:
    [d := m // p \\ 10.
    d = 0 ifTrue: [q := p].
    p := 10 * p].
    ^m + 1 - (m - 1 - (m \\ q)) A052382_inverse
    "Hieronymus Fischer, May 28 2014"
    

Formula

From Hieronymus Fischer, Jan 13 2013: (Start)
Inequalities:
a(n) <= 10*(n - 1), equality holds for 1 <= n <= 11.
a(n) <= 9*n, for n <> 11.
a(n) < n + 10 * n^log_10(9).
a(n) < n + 2 * n^log_10(9), for n > 6*10^8.
a(n) > n + 9^log_10(9)/8 * n^log_10(9).
a(n) < A043489(n), for n > 10.
Iterative calculation:
a(n+1) = a(n) + 1 + 9*sign(A007954(a(n)+1)).
Recursive calculation (for n > 1):
Set m := floor(log_10(n)) + 1), j := floor(sign(n+1 - (8*10^m - 9*9^m + 17)/8) + 1)/2) + m - 1, d := 10^j - 9^j, b := (8*10^j - 9*9^j + 17)/8, and determine r(n) as follows:
Case 1: r(n) = a(b - d + (n - b) mod d), if (n - b) mod d > 10^(j-1) and n >= 19
Case 2: r(n) = (n - b) mod d, if (n - b) mod d <= 10^(j-1).
Then a(n) = (floor((n - b)/d) + 1)*10^j + r(n).
Direct calculation (for n>1):
Set m := floor(log_10(n)) + 1), j := floor((sign(n+1 - (8*10^m - 9*9^m + 17)/8) + 1)/2) + m - 1, and determine k and c(i) as follows:
c(1) = n - (8*10^j - 9*9^j + 17)/8, then define successively for i = 1, 2, ...,
c(i+1) = (c(i) mod (10^(j-i+1) - 9^(j-i+1))) - 10^(j-i) while this value is > 0, and set k := i for the last such index for which c(i) > 0 (in any case k is k<=j).
Then a(n) = c(k) mod (10^(j-k+1) - 9^(j-k+1)) + sum_{i=1..k}(floor(c(i)/(10^(j-i+1) - 9^(j-i+1))) + 1)*10^(j-i+1).
Asymptotic behavior:
a(n) = n + O(n^log_10(9)) = n*(1+ O(1/n^0.04575749056...)).
lim a(n)/n = 1 for n -> infinity.
lim inf (a(n) - n)/n^log_10(9) = 9^log_10(9)/8 = 1.017393081085670008926619124438...
lim sup (a(n) - n)/n^log_10(9) = 9/8 = 1.125.
Sums:
Sum_{n >= 2} (-1)^n/a(n) = 0.0693489578....
Sum_{n >= 2} 1/a(n)^2 = 0.0179656962...
Sum_{n >= 2} 1/a(n) diverges, because of a(n) < 10*n.
Sum_{n >= 1} a(n)/n^2 diverges too.
Sum_{n >= 2} 1/a(n)^2 + Sum_{n >= 1} 1/A052382(n)^2 = Pi^2/6.
Generating function:
g(x) = Sum_{k >= 1} g_k(x), where the terms g_k(x) obey the following recurrence relation:
g_k(x) = 10^k*x^b(k) * (1 - 10x^(9d(k)) + 9x^(10d(k)))/((1-x^d(k))(1-x)) + (x*x^b(k) * (1 - 10^(k-1)*x^(10^(k-1)-1) + (10^(k-1)-1)*x^10^(k-1))/((1-x)^2) + g_(k-1)(x)*x^d(k)) * (1-x^(9d(k)))/(1-x^d(k)),
where b(k) := 2 + 10^k - 9^k - (9^k-1)/8,
d(k) := 10^k - 9^k, and g_0(x) = 0.
Explicit representation of g_k(x):
g_k(x) = (10^k*x^b(k)*(1 - 10x^(9d(k)) + 9x^(10d(k)))/(1-x^d(k)) + sum_{j=1..k-1} ((10^j*x^b(j) * (1 - 10x^(9d(j)) + 9x^(10d(j)))/(1-x^d(j)) + x^(b(j)-10^j+1) * (1 - 10^j*x^(10^j-1) + (10^j-1)*x^10^j)/(1-x)) * Product_{i=j+1..k} x^d(i)*(1-x^(9d(i)))/(1-x^d(i)))/(1-x).
A summation term g_k(x) of the g.f. represents all the sequence terms >= 10^k and < 10^(k+1).
Example 1: g_1(x) = 10*x^2*(1 - 10x^9 + 9x^10)/(1-x)^2 represents the g.f. fragment 10x^2 + 20x^3 + ... + 90x^10 and so generates the terms a(2)=10 ... a(10)=90.
Example 2: g_2(x) = 10^2*x^11*(1 - 10x^(9*19) + 9x^(10*19))/((1-x)(1-x^19)) + 10*x^21 * (1 - 10x^9 + 9x^10)/((1-x)^2) * (1-x^(9*19))/(1-x^19)) + x^11*x * (1 - 10x^9 + 9x^10)/((1-x)^2) * (1-x^(9*19))/(1-x^19) represents the g.f. fragment 100x^11 + 101x^12 + ... + 109x^20 + 110x^21 + 120x^22 + ... + 190x^29 + 200x^30 + 201x^31 + ... + 210x^40 + ... + 990x^181 and so generates the terms a(11) = 100 ... a(181) = 990.
(End)
From Hieronymus Fischer, Feb 12 2019: (Start)
The number C(n) of zero-containing numbers <= n (counting function) is given by C(n) = A011540_inverse(n), if n is a zero-containing number, and C(n) = A011540_inverse(A052382(a(n) + 1 - n)), if n is a zerofree number.
Upper bound:
C(n) <= n+1-((9*n+1)^d-1)/8.
Lower bound:
C(n) > n+1-((10*n+1)^d-1)/8
where d = log_10(9) = 0.95424250943932...
(see A324160).
(End)

Extensions

Edited by M. F. Hasler, Oct 11 2015

A038603 Primes not containing the digit '1'.

Original entry on oeis.org

2, 3, 5, 7, 23, 29, 37, 43, 47, 53, 59, 67, 73, 79, 83, 89, 97, 223, 227, 229, 233, 239, 257, 263, 269, 277, 283, 293, 307, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 409, 433, 439, 443, 449, 457, 463, 467, 479, 487, 499, 503, 509, 523, 547, 557
Offset: 1

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net), Jul 15 1998

Keywords

Comments

Subsequence of A132080. - Reinhard Zumkeller, Aug 09 2007
Maynard proves that this sequence is infinite and in particular contains the expected number of elements up to x, on the order of x^(log 9/log 10)/log x. - Charles R Greathouse IV, Apr 08 2016

Crossrefs

Intersection of A000040 (primes) and A052383 (numbers with no digit 1).
Primes having no digit d = 0..9 are A038618, this sequence, A038604, A038611, A038612, A038613, A038614, A038615, A038616, and A038617, respectively.
Primes with other restrictions on digits: A106116, A156756.

Programs

  • Magma
    [ p: p in PrimesUpTo(600) | not 1 in Intseq(p) ];  // Bruno Berselli, Aug 08 2011
    
  • Mathematica
    Select[Prime[Range[70]], DigitCount[#, 10, 1] == 0 &] (* Vincenzo Librandi, Aug 09 2011 *)
  • PARI
    is(n)=if(isprime(n),n=vecsort(eval(Vec(Str(n))),,8);n[1]>1||(!n[1]&&n[2]>1)) \\ Charles R Greathouse IV, Aug 09 2011
    
  • PARI
    is(n)=!vecsearch(vecsort(digits(n)),1) && isprime(n) \\ Charles R Greathouse IV, Oct 03 2012
    
  • PARI
    next_A038603(n)=until((n=nextprime(n+1))==n=next_A052383(n-1),);n \\ Compute least a(k) > n. See A052383. - M. F. Hasler, Jan 14 2020
    
  • Python
    from sympy import nextprime
    i=p=1
    while i<=500:
        p = nextprime(p)
        if '1' not in str(p):
            print(str(i)+" "+str(p))
            i+=1
    # Indranil Ghosh, Feb 07 2017, edited by M. F. Hasler, Jan 15 2020
    # See the OEIS Wiki page for more efficient programs. - M. F. Hasler, Jan 14 2020

Formula

a(n) ≍ n^(log 10/log 9) log n. - Charles R Greathouse IV, Aug 03 2023

A038615 Primes not containing the digit '7'.

Original entry on oeis.org

2, 3, 5, 11, 13, 19, 23, 29, 31, 41, 43, 53, 59, 61, 83, 89, 101, 103, 109, 113, 131, 139, 149, 151, 163, 181, 191, 193, 199, 211, 223, 229, 233, 239, 241, 251, 263, 269, 281, 283, 293, 311, 313, 331, 349, 353, 359, 383, 389, 401, 409, 419, 421, 431, 433, 439
Offset: 1

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net), Jul 15 1998

Keywords

Comments

Subsequence of primes of A052419. - Michel Marcus, Feb 22 2015
Maynard proves that this sequence is infinite and in particular contains the expected number of elements up to x, on the order of x^(log 9/log 10)/log x. - Charles R Greathouse IV, Apr 08 2016

Crossrefs

Primes having no digit d = 0..9 are A038618, A038603, A038604, A038611, A038612, A038613, A038614, this sequence, A038616, and A038617, respectively.

Programs

  • Magma
    [ p: p in PrimesUpTo(500) | not 7 in Intseq(p) ]; // Bruno Berselli, Aug 08 2011
    
  • Mathematica
    Select[Prime[Range[70]], DigitCount[#, 10, 7] == 0 &] (* Vincenzo Librandi, Aug 08 2011 *)
  • PARI
    lista(nn)=forprime(p=2, nn, if (!vecsearch(vecsort(digits(p),,8), 7), print1(p, ", "));); \\ Michel Marcus, Feb 22 2015
    
  • PARI
    (A038615_upto(N)=select( is_A052419, primes([1,N])))(444) \\ i.e.: {is_A038615(n)=is_A052419(n)&&isprime(n)}; {is_A052419(n)=!setsearch(Set(digits(n)),7)}. - M. F. Hasler, Jan 11 2020

Formula

Intersection of A000040 (primes) and A052419 (numbers with no digit 7). - M. F. Hasler, Jan 11 2020
a(n) ~ n^(log 10/log 9) * log(n). - Charles R Greathouse IV, Aug 03 2023

Extensions

Offset corrected by Arkadiusz Wesolowski, Aug 07 2011

A038611 Primes not containing the digit '3'.

Original entry on oeis.org

2, 5, 7, 11, 17, 19, 29, 41, 47, 59, 61, 67, 71, 79, 89, 97, 101, 107, 109, 127, 149, 151, 157, 167, 179, 181, 191, 197, 199, 211, 227, 229, 241, 251, 257, 269, 271, 277, 281, 401, 409, 419, 421, 449, 457, 461, 467, 479, 487, 491, 499, 509, 521, 541, 547, 557
Offset: 1

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net), Jul 15 1998

Keywords

Comments

Subsequence of primes of A052405. - Michel Marcus, Feb 22 2015
Maynard proves that this sequence is infinite and in particular contains the expected number of elements up to x, on the order of x^(log 9/log 10)/log x. - Charles R Greathouse IV, Apr 08 2016

Crossrefs

Intersection of A000040 (primes) and A052405 (numbers with no digit 3).
Primes having no digit d = 0..9 are A038618, A038603, A038604, this sequence, A038612, A038613, A038614, A038615, A038616, and A038617, respectively.

Programs

  • Magma
    [ p: p in PrimesUpTo(600) | not 3 in Intseq(p) ]; // Bruno Berselli, Aug 08 2011
    
  • Mathematica
    Select[Prime[Range[70]], DigitCount[#, 10, 3] == 0 &] (* Vincenzo Librandi, Aug 08 2011 *)
  • PARI
    lista(nn)=forprime(p=2, nn, if (!vecsearch(vecsort(digits(p),,8), 3), print1(p, ", "));); \\ Michel Marcus, Feb 22 2015
    
  • PARI
    ( {A038611_upto(N,M=1)=select( is_A052405, primes([M,N]))} )(350)
    
  • PARI
    next_A038611(n)={until((n=nextprime(n+1))==n=next_A052405(n-1),);n}
    ( {A038611_vec(n,M=2)=M--;vector(n,i,M=next_A038611(M))} )(20, 1000)
    \\ Get 20 terms >= 1000. See also OEIS wiki page. - M. F. Hasler, Jan 14 2020
    
  • Python
    from sympy import isprime
    i=j=1
    while j<=5000:
        if isprime(i) and "3" not in str(i):
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 07 2017

Formula

a(n) ≍ n^(log 10/log 9) log n. - Charles R Greathouse IV, Aug 03 2023

Extensions

Offset corrected by Arkadiusz Wesolowski, Aug 07 2011

A195943 Zeroless prime powers: Intersection of A000961 and A052382.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 113, 121, 125, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 243, 251, 256, 257, 263, 269, 271, 277, 281, 283, 289, 293, 311
Offset: 1

Views

Author

M. F. Hasler, Sep 25 2011

Keywords

Comments

In contrast to A195942, we also allow for primes (p^n with n=1) in this sequence.

Crossrefs

Programs

  • Haskell
    a195943 n = a195943_list !! (n-1)
    a195943_list = filter ((== 1) . a010055) a052382_list
    -- Reinhard Zumkeller, Sep 27 2011
  • PARI
    for( n=1,9999, is_A000961(n) && is_A052382(n) && print1(n","))
    

Formula

A010055(a(n)) * A168046(a(n)) = 1. - Reinhard Zumkeller, Sep 27 2011
Showing 1-10 of 56 results. Next