Displaying 1-10 of 11 results found.
Number of primes less than 10^n which do not contain the digit 0.
+10
30
4, 25, 153, 1010, 7122, 52313, 397866, 3103348, 24649318, 198536215, 1616808581, 13287264748, 110033428309, 917072930187
FORMULA
Number of primes less than 10^n after removing any primes with at least one digit 0.
a(n) <= (9^n-1)/2 = A052386(n)*4/9 since the last digit of a prime of n digits can only be one of 4 numbers, (2,3,5,7) when n = 1 and (1,3,7,9) when n > 1. - Chai Wah Wu, Mar 18 2018
EXAMPLE
a(3) = 153 because there are 168 primes less than 10^3, 15 primes have at least one zero; 168 - 15 = 153.
MATHEMATICA
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = 1; Do[ While[ p = NextPrim[p]; p < 10^n, If[ Position[ IntegerDigits[p], 0] == {}, c++ ]]; Print[c]; p--, {n, 1, 8}] (* Robert G. Wilson v, Feb 02 2004 *)
Table[PrimePi[10^n]-Total[Boole[DigitCount[#, 10, 0]>0]&/@ Prime[ Range[ PrimePi[ 10^n]]]], {n, 8}] (* The program generates the first 8 terms of the sequence. To generate more, increase the digit 8 but the program may take a long time to run. *) (* Harvey P. Dale, Aug 26 2021 *)
PROG
(Python)
from sympy import sieve # use primerange for larger terms
def nodigs0(n): return '0' not in str(n)
def aupton(terms):
ps, alst = 0, []
for n in range(1, terms+1):
ps += sum(nodigs0(p) for p in sieve.primerange(10**(n-1), 10**n))
alst.append(ps)
return alst
0, 8, 80, 728, 6560, 59048, 531440, 4782968, 43046720, 387420488, 3486784400, 31381059608, 282429536480, 2541865828328, 22876792454960, 205891132094648, 1853020188851840, 16677181699666568, 150094635296999120
COMMENTS
Number of integers from 0 to 10^(n+1)-1 that lack any particular digit other than 0. - Robert G. Wilson v, Apr 14 2003
FORMULA
a(0)=0, a(1)=8; for n>1, a(n) = 10*a(n-1)-9*a(n-2). - Harvey P. Dale, Apr 14 2015
a(n) = Sum_{i=1..n} 8^i*binomial(n,n-i) for n>0, a(0)=0. - Bruno Berselli, Nov 11 2015
MATHEMATICA
Table[9^n - 1, {n, 0, 20}]
LinearRecurrence[{10, -9}, {0, 8}, 30] (* Harvey P. Dale, Apr 14 2015 *)
A(n,k) = Sum_{i=1..k} n^i; square array A(n,k), n>=0, k>=0, read by antidiagonals.
+10
21
0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 6, 3, 0, 0, 4, 14, 12, 4, 0, 0, 5, 30, 39, 20, 5, 0, 0, 6, 62, 120, 84, 30, 6, 0, 0, 7, 126, 363, 340, 155, 42, 7, 0, 0, 8, 254, 1092, 1364, 780, 258, 56, 8, 0, 0, 9, 510, 3279, 5460, 3905, 1554, 399, 72, 9, 0
COMMENTS
A(n,k) is the total sum of lengths of longest ending contiguous subsequences with the same value over all s in {1,...,n}^k:
A(4,1) = 4 = 1+1+1+1: [1], [2], [3], [4].
A(1,4) = 4: [1,1,1,1].
A(3,2) = 12 = 2+1+1+1+2+1+1+1+2: [1,1], [1,2], [1,3], [2,1], [2,2], [2,3], [3,1], [3,2], [3,3].
A(2,3) = 14 = 3+1+1+2+2+1+1+3: [1,1,1], [1,1,2], [1,2,1], [1,2,2], [2,1,1], [2,1,2], [2,2,1], [2,2,2].
FORMULA
A(1,k) = k, else A(n,k) = n/(n-1)*(n^k-1).
A(n,k) = Sum_{i=1..k} n^i.
A(n,k) = Sum_{i=1..k+1} binomial(k+1,i)*A(n-i,k)*(-1)^(i+1) for n>k, given values A(0,k), A(1,k),..., A(k,k). - Yosu Yurramendi, Sep 03 2013
EXAMPLE
Square array A(n,k) begins:
0, 0, 0, 0, 0, 0, 0, 0, ...
0, 1, 2, 3, 4, 5, 6, 7, ...
0, 2, 6, 14, 30, 62, 126, 254, ...
0, 3, 12, 39, 120, 363, 1092, 3279, ...
0, 4, 20, 84, 340, 1364, 5460, 21844, ...
0, 5, 30, 155, 780, 3905, 19530, 97655, ...
0, 6, 42, 258, 1554, 9330, 55986, 335922, ...
0, 7, 56, 399, 2800, 19607, 137256, 960799, ...
MAPLE
A:= (n, k)-> `if`(n=1, k, (n/(n-1))*(n^k-1)):
seq(seq(A(n, d-n), n=0..d), d=0..12);
MATHEMATICA
a[0, 0] = 0; a[1, k_] := k; a[n_, k_] := n*(n^k-1)/(n-1); Table[a[n-k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Dec 16 2013 *)
CROSSREFS
Columns k=0-10 give: A000004, A001477, A002378, A027444, A027445, A152031, A228290, A228291, A228292, A228293, A228294.
Rows n=0-11 give: A000004, A001477, A000918(k+1), A029858(k+1), A080674, A104891, A105281, A104896, A052379(k-1), A052386, A105279, A105280.
Decimal expansion of Kempner series Sum_{k >= 1, k has no digit 0 in base 10} 1/k.
+10
15
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
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
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.
EXAMPLE
23.10344790942054161603...
CROSSREFS
Cf. A002387, A052386, A082830, A082831, A082832, A082833, A082834, A082835, A082836, A082837, A082838.
Number of integers from 1 to 10^(n+1)-1 that lack 0 and 1 as a digit.
+10
11
8, 72, 584, 4680, 37448, 299592, 2396744, 19173960, 153391688, 1227133512, 9817068104, 78536544840, 628292358728, 5026338869832, 40210710958664, 321685687669320, 2573485501354568, 20587884010836552, 164703072086692424, 1317624576693539400, 10540996613548315208
FORMULA
a(n) = (8^(n+2) - 1)/7 - 1.
a(n) = 8*a(n-1) + 8.
a(n) = Sum_{k=1..n} 8^k. - corrected by Michel Marcus, Sep 25 2014
Conjecture: a(n) = A023001(n+2)-1. - R. J. Mathar, May 18 2007. Comment from Vim Wenders, Mar 26 2008: The conjecture is true: the g.f. leads to the closed form a(n) = -(8/7)*(1^n) + (64/7)*(8^n) = (-8 + 64*8^n)/7 = (-8 + 8^(n+2))/7 = (8^(n+2) - 1)/7 - 1 = A023001(n+2) - 1.
a(n) = 9*a(n-1) - 8*a(n-2); a(0)=8, a(1)=72. - Harvey P. Dale, Sep 22 2013
EXAMPLE
For n=1, the numbers from 1 to 99 which have 0 or 1 as a digit are the numbers 1 and 10, 20, 30, ..., 90 and 11, 12, ..., 18, 19 and 21, 31, ..., 91. So a(1) = 99 - 27 = 72.
MATHEMATICA
(8^(Range[0, 20]+2)-1)/7-1 (* or *) LinearRecurrence[{9, -8}, {8, 72}, 20] (* Harvey P. Dale, Sep 22 2013 *)
a(0)=0; a(n) = 10*a(n-1) + 10.
+10
6
0, 10, 110, 1110, 11110, 111110, 1111110, 11111110, 111111110, 1111111110, 11111111110, 111111111110, 1111111111110, 11111111111110, 111111111111110, 1111111111111110, 11111111111111110, 111111111111111110, 1111111111111111110, 11111111111111111110, 111111111111111111110
COMMENTS
a(n) is the smallest even number with digits in {0,1} having digit sum n; in other words, the base 10 reading of the binary string of A000918(n). Cf. A069532. - Jason Kimberley, Nov 02 2011
Also, except for a(0), the binary representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 645", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. - Robert Price, Jul 19 2017
REFERENCES
S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.
FORMULA
a(n) = (10/9)*(10^n-1), with n>=0.
a(n) = Sum_{k=1..n} 10^k.
O.g.f.: 10*x/((1 - x)*(1 - 10*x)).
E.g.f.: 10*exp(x)*(exp(9*x) - 1)/9. (End)
MATHEMATICA
NestList[10*(# + 1) &, 0, 25] (* Paolo Xausa, Jul 17 2024 *)
PROG
(Haskell)
a105279 n = a105279_list !! n
a105279_list = iterate ((* 10) . (+ 1)) 0
a(0) = 0; a(n) = 5*a(n-1) + 5.
+10
3
0, 5, 30, 155, 780, 3905, 19530, 97655, 488280, 2441405, 12207030, 61035155, 305175780, 1525878905, 7629394530, 38146972655, 190734863280, 953674316405, 4768371582030, 23841857910155, 119209289550780, 596046447753905, 2980232238769530, 14901161193847655
COMMENTS
Number of integers from 0 to (10^n)-1 that lack 0, 1, 2, 3 and 4 as a digit.
Number of monic irreducible polynomials of degree 1 in GF(5)[x1,...,xn]. - Max Alekseyev, Jan 23 2006
FORMULA
a(n) = 6*a(n-1) - 5*a(n-2).
G.f.: 5*x / ((1-x)*(1-5*x)). (End)
EXAMPLE
a(3) = 5*a(2) + 5 = 5*30 + 5 = 155.
MATHEMATICA
RecurrenceTable[{a[n]==5*a[n-1]+5, a[0]==0}, a, {n, 0, 30}] (* Vaclav Kotesovec, Jul 25 2014 *)
PROG
(PARI) concat(0, Vec(5*x/((x-1)*(5*x-1)) + O(x^30))) \\ Colin Barker, Jul 25 2014
(Magma) [5*(5^n -1)/4: n in [0..30]]; // G. C. Greubel, Jun 15 2021
(Sage) [5*(5^n -1)/4 for n in (0..30)] # G. C. Greubel, Jun 15 2021
a(0) = 0; a(n) = 7*a(n-1) + 7.
+10
3
0, 7, 56, 399, 2800, 19607, 137256, 960799, 6725600, 47079207, 329554456, 2306881199, 16148168400, 113037178807, 791260251656, 5538821761599, 38771752331200, 271402266318407, 1899815864228856, 13298711049601999, 93090977347214000, 651636841430498007
COMMENTS
Conjecture: this is also the number of integers from 0 to 10^n - 1 that lack 0, 1 and 2 as a digit.
Number of monic irreducible polynomials of degree 1 in GF(7)[x1,...,xn]. - Max Alekseyev, Jan 23 2006
FORMULA
a(n) = 8*a(n-1) - 7*a(n-2).
G.f.: 7*x / ((x-1)*(7*x-1)). (End)
MAPLE
a:=n->sum (7^j, j=1..n): seq(a(n), n=0..30); # Zerinvary Lajos, Oct 03 2007
MATHEMATICA
RecurrenceTable[{a[n]==7*a[n-1]+7, a[0]==0}, a, {n, 0, 30}] (* Vaclav Kotesovec, Jul 25 2014 *)
PROG
(PARI) concat(0, Vec(7*x/((x-1)*(7*x-1)) + O(x^30))) \\ Colin Barker, Jul 25 2014
(Magma) [(7/6)*(7^n -1): n in [0..30]]; // G. C. Greubel, Jun 09 2021
(Sage) [(7/6)*(7^n -1) for n in (0..30)] # G. C. Greubel, Jun 09 2021
0, 6, 42, 258, 1554, 9330, 55986, 335922, 2015538, 12093234, 72559410, 435356466, 2612138802, 15672832818, 94036996914, 564221981490, 3385331888946, 20311991333682, 121871948002098, 731231688012594, 4387390128075570, 26324340768453426, 157946044610720562
COMMENTS
Number of integers from 0 to (10^n)-1 that lack 0, 1, 2 and 3 as a digit.
Also, a(n) is the expected number of tosses of a single die needed to obtain for the first time a string of n consecutive 6's. - Jean M. Morales, Aug 04 2012
FORMULA
a(n) = 7*a(n-1)-6*a(n-2). G.f.: 6*x/((x-1)*(6*x-1)). - Colin Barker, Jan 28 2013
PROG
(PARI) a(n)=if(n<0, 0, (6^n-1)*6/5)
a(0)=0; a(n) = 11*a(n-1) + 11.
+10
2
0, 11, 132, 1463, 16104, 177155, 1948716, 21435887, 235794768, 2593742459, 28531167060, 313842837671, 3452271214392, 37974983358323, 417724816941564, 4594972986357215, 50544702849929376, 555991731349223147, 6115909044841454628, 67274999493256000919
MAPLE
a:=n-> add(11^j, j=1..n): seq(a(n), n=0..12); # Zerinvary Lajos, Oct 03 2007
MATHEMATICA
NestList[11#+11&, 0, 20] (* or *) LinearRecurrence[{12, -11}, {0, 11}, 20] (* Harvey P. Dale, Dec 02 2023 *)
Search completed in 0.010 seconds
|