login
Numbers without 0 as a digit, a.k.a. zeroless numbers.
211

%I #152 Sep 08 2022 08:44:59

%S 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,

%T 29,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,51,52,53,54,

%U 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

%N Numbers without 0 as a digit, a.k.a. zeroless numbers.

%C 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

%C 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

%C 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

%C From _Hieronymus Fischer_, May 28 2014: (Start)

%C 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].

%C Example 1: A052382_inverse(137) = 137 - (floor(137/10) + floor(137/100)*9) = 137 - (13*1 + 1*9) = 137 - 22 = 115.

%C 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)

%C 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

%C Integer n > 0 is encoded using bijective base-9 numeration, see Wikipedia link below. - _Alois P. Heinz_, Feb 16 2020

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

%H Reinhard Zumkeller, <a href="/A052382/b052382.txt">Table of n, a(n) for n = 1..10000</a>

%H K. Mahler, <a href="http://carmaweb.newcastle.edu.au/mahler/docs/115.pdf">On the generating function of the integers with a missing digit</a>, J. Indian Math. Soc. 15A (1951), 34-40.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/KempnerSeries.html">Kempner Series</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Zerofree.html">Zerofree</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Bijective_numeration">Bijective numeration</a>

%H <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.

%F 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

%F From _Hieronymus Fischer_, Apr 30, May 30, Jun 08 2012, Feb 17 2019: (Start)

%F 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)).

%F Also: a(n) = Sum_{j=0..m-1} (1 + A010878(b(j)))*10^j.

%F a(9*n + k) = 10*a(n) + k, k=1..9.

%F Special values:

%F a(k*(9^n - 1)/8) = k*(10^n - 1)/9, k=1..9.

%F a((17*9^n - 9)/8) = 2*10^n - 1.

%F a((9^n - 1)/8 - 1) = 10^(n-1) - 1, n > 1.

%F Inequalities:

%F a(n) <= (1/9)*((8*n+1)^(1/log_10(9)) - 1), equality holds for n=(9^k-1)/8, k>0.

%F a(n) > (1/10)*(8*n+1)^(1/log_10(9)) - 1), n > 0.

%F Lower and upper limits:

%F lim inf a(n)/10^log_9(8*n) = 1/10, for n -> infinity.

%F lim inf a(n)/n^(1/log_10(9)) = 8^(1/log_10(9))/10, for n -> infinity.

%F lim sup a(n)/10^log_9(8*n) = 1/9, for n -> infinity.

%F lim sup a(n)/n^(1/log_10(9)) = 8^(1/log_10(9))/9, for n -> infinity.

%F 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.

%F 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).

%F 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)).

%F Generic formulas for analogous sequences with numbers expressed in base p and only using the digits 1, 2, 3, ... d, where 1 < d < p:

%F 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)).

%F Special values:

%F a(k*(d^n-1)/(d-1)) = k*(10^n-1)/9, k=1..d.

%F a(d*((2d-1)*d^(n-1)-1)/(d-1)) = ((d+9)*10^n-d)/9 = 10^n + d*(10^n-1)/9.

%F a((d^n-1)/(d-1)-1) = d*(10^(n-1)-1)/9, n > 1.

%F Inequalities:

%F a(n) <= (10^log_d((d-1)*n+1)-1)/9, equality holds for n = (d^k-1)/(d-1), k > 0.

%F a(n) > (d/10)*(10^log_d((d-1)*n+1)-1)/9, n > 0.

%F Lower and upper limits:

%F lim inf a(n)/10^log_d((d-1)*n) = d/90, for n -> infinity.

%F lim sup a(n)/10^log_d((d-1)*n) = 1/9, for n -> infinity.

%F 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).

%F (End)

%F A052382 = { n | A054054(n) > 0 }. - _M. F. Hasler_, Jan 23 2013

%F From _Hieronymus Fischer_, Feb 20 2019: (Start)

%F Sum_{n>=1} (-1)^(n+1)/a(n) = 0.696899720...

%F Sum_{n>=1} 1/a(n)^2 = 1.6269683705819...

%F 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:

%F 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.

%F (End)

%e 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

%p a:= proc(n) local d, l, m; m:= n; l:= NULL;

%p while m>0 do d:= irem(m, 9, 'm');

%p if d=0 then d:=9; m:= m-1 fi;

%p l:= d, l

%p od; parse(cat(l))

%p end:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Jan 11 2015

%t A052382 = Select[Range[100], DigitCount[#, 10, 0] == 0 &] (* _Alonso del Arte_, Mar 10 2011 *)

%o (Haskell)

%o a052382 n = a052382_list !! (n-1)

%o a052382_list = iterate f 1 where

%o f x = 1 + if r < 9 then x else 10 * f x' where (x', r) = divMod x 10

%o -- _Reinhard Zumkeller_, Mar 08 2015, Apr 07 2011

%o (Magma) [ n: n in [1..114] | not 0 in Intseq(n) ]; // _Bruno Berselli_, May 28 2011

%o (sh) seq 0 1000 | grep -v 0; # _Joerg Arndt_, May 29 2011

%o (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

%o (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

%o (PARI)

%o apply( {A052382(n,L=logint(n,9))=fromdigits(digits(n-9^L>>3,9))+10^L\9}, [1..100])

%o 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.

%o ( {A052382_vec(n,M=1)=M--;vector(n, i, M=next_A052382(M))} )(99) \\ n terms >= M

%o \\ See OEIS Wiki page (cf. LINKS) for more programs. - _M. F. Hasler_, Jan 11 2020

%o (Smalltalk)

%o A052382

%o "Answers the n-th term of A052382, where n is the receiver."

%o ^self zerofree: 10

%o A052382_inverse

%o "Answers that index n which satisfy A052382(n) = m, where m is the receiver.”

%o ^self zerofree_inverse: 10

%o zerofree: base

%o "Answers the n-th zerofree number in base base, where n is the receiver. Valid for base > 2.

%o Usage: n zerofree: b [b = 10 for this sequence]

%o Answer: a(n)"

%o | n m s c bi ci d |

%o n := self.

%o c := base - 1.

%o m := (base - 2) * n + 1 integerFloorLog: c.

%o d := n - (((c raisedToInteger: m) - 1)//(base - 2)).

%o bi := 1.

%o ci := 1.

%o s := 0.

%o 1 to: m

%o do:

%o [:i |

%o s := (d // ci \\ c + 1) * bi + s.

%o bi := base * bi.

%o ci := c * ci].

%o ^s

%o zerofree_inverse: base

%o "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.

%o Usage: m zerofree_inverse: b [b = 10 for this sequence]

%o Answer: n"

%o | m p q s |

%o m := self.

%o s := 0.

%o p := base.

%o q := 1.

%o [p < m] whileTrue:

%o [s := m // p * q + s.

%o p := base * p.

%o q := (base - 1) * q].

%o ^m - s

%o "by _Hieronymus Fischer_, May 28 2014"

%o (Python)

%o A052382 = [n for n in range(1,10**5) if not str(n).count('0')]

%o # _Chai Wah Wu_, Aug 26 2014

%Y Cf. A004719, A052040, different from A067251.

%Y Cf. A055640, A046034, A007931, A007932, A084544, A084545.

%Y Column k=9 of A214676.

%Y Cf. A011540 (complement), A043489, A054054, A168046.

%Y 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).

%Y 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).

%Y Cf. A082839 (sum of reciprocals).

%Y Cf. A038618 (subset of primes)

%Y Subsequences: A007602, A038186, A052041, A052043, A052045, A059405, A066484, A099542.

%K base,easy,nonn

%O 1,2

%A _Henry Bottomley_, Mar 13 2000

%E Typos in formula section corrected by _Hieronymus Fischer_, May 30 2012