[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Search: a052386 -id:a052386
     Sort: relevance | references | number | modified | created      Format: long | short | data
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
OFFSET
1,1
FORMULA
Number of primes less than 10^n after removing any primes with at least one digit 0.
a(n) <= A052386(n) = 9*(9^n-1)/8. - Charles R Greathouse IV, Sep 13 2016
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
print(aupton(7)) # Michael S. Branicky, Apr 25 2021
KEYWORD
nonn,base,more
AUTHOR
Enoch Haga, Jan 30 2004
EXTENSIONS
Edited and extended by Robert G. Wilson v, Feb 02 2004
a(9)-a(12) from Donovan Johnson, Feb 14 2008
a(13) from Robert Price, Nov 08 2013
a(14) from Giovanni Resta, Mar 20 2017
STATUS
approved
a(n) = 9^n-1.
+10
25
0, 8, 80, 728, 6560, 59048, 531440, 4782968, 43046720, 387420488, 3486784400, 31381059608, 282429536480, 2541865828328, 22876792454960, 205891132094648, 1853020188851840, 16677181699666568, 150094635296999120
OFFSET
0,2
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
These are the numbers 888...8 in base 9. - Zerinvary Lajos, Nov 21 2007
FORMULA
G.f.: 1/(1-9*x)-1/(1-x). - Mohammad K. Azarian, Jan 14 2009
E.g.f.: e^(9*x)-e^x. - Mohammad K. Azarian, Jan 14 2009
a(n) = A024023(n)*A034472(n). - Reinhard Zumkeller, Feb 14 2009
a(n) = 9*a(n-1)+8 for n>0, a(0)=0. - Vincenzo Librandi, Nov 19 2010
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
a(n) = A001019(n) - 1. - Sean A. Irvine, Jun 19 2019
Sum_{n>=1} 1/a(n) = A248726. - Amiram Eldar, Nov 13 2020
MATHEMATICA
Table[9^n - 1, {n, 0, 20}]
LinearRecurrence[{10, -9}, {0, 8}, 30] (* Harvey P. Dale, Apr 14 2015 *)
PROG
(PARI) a(n)=9^n-1 \\ Charles R Greathouse IV, Jun 11 2015
KEYWORD
nonn,easy
AUTHOR
STATUS
approved
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
OFFSET
0,8
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].
LINKS
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
Rows n=0-11 give: A000004, A001477, A000918(k+1), A029858(k+1), A080674, A104891, A105281, A104896, A052379(k-1), A052386, A105279, A105280.
Main diagonal gives A031972.
Lower diagonal gives A226238.
Cf. A228250.
KEYWORD
nonn,tabl,easy
AUTHOR
Alois P. Heinz, Aug 19 2013
STATUS
approved
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
OFFSET
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.
LINKS
Robert Baillie, Sums of reciprocals of integers missing a given digit, Amer. Math. Monthly, 86 (1979), 372-374.
Robert Baillie, Summing The Curious Series Of Kempner And Irwin, arXiv:0806.4410 [math.CA], 2008-2015. [Robert G. Wilson v, Jun 01 2009]
Frank Irwin, A Curious Convergent Series, Amer. Math. Monthly, 23 (1916), 149-152.
A. D. Wadhwa, An interesting subseries of the harmonic series, Amer. Math. Monthly, 78 (1975), 931-933.
A. D. Wadhwa, Some convergent subseries of the harmonic series, Amer. Math. Monthly, 85 (1978), 661-663.
Eric Weisstein's World of Mathematics, Kempner Series.
Wikipedia, Kempner series
Wolfram Library Archive, KempnerSums.nb (8.6 KB) - Mathematica Notebook, Summing Kempner's Curious (Slowly-Convergent) Series [Robert G. Wilson v, Jun 01 2009]
EXAMPLE
23.10344790942054161603...
MATHEMATICA
(* see the Mmca in Wolfram Library Archive. - Robert G. Wilson v, Jun 01 2009 *)
CROSSREFS
KEYWORD
nonn,cons,base
AUTHOR
Robert G. Wilson v, Apr 14 2003
EXTENSIONS
More terms from Robert G. Wilson v, Jun 01 2009
STATUS
approved
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
OFFSET
0,1
FORMULA
a(n) = (8^(n+2) - 1)/7 - 1.
G.f.: 8/((1-x)*(1-8*x)). - R. J. Mathar, Nov 19 2007
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
a(n) = 8*A023001(n+1). - Alois P. Heinz, Feb 15 2023
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.
MAPLE
A052379:=n->(8^(n+2)-1)/7-1: seq(A052379(n), n=0..20); # Wesley Ivan Hurt, Sep 26 2014
MATHEMATICA
(8^(Range[0, 20]+2)-1)/7-1 (* or *) LinearRecurrence[{9, -8}, {8, 72}, 20] (* Harvey P. Dale, Sep 22 2013 *)
PROG
(Magma) [(8^(n+2)-1)/7-1: n in [0..20]]; // Vincenzo Librandi, Jul 04 2011
(PARI) a(n)=8^(n+2)\7 - 1 \\ Charles R Greathouse IV, Aug 25 2014
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Odimar Fabeny, Mar 12 2000
EXTENSIONS
More terms and revised description from James A. Sellers, Mar 13 2000
STATUS
approved
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
OFFSET
0,2
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.
Repunits times 10: a(n) = 10 * A002275(n). - Reinhard Zumkeller, Feb 05 2012
From Stefano Spezia, Sep 15 2023: (Start)
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
(Magma) [-10/9+(10/9)*10^n: n in [0..20]]; // Vincenzo Librandi, Jul 04 2011
(Haskell)
a105279 n = a105279_list !! n
a105279_list = iterate ((* 10) . (+ 1)) 0
-- Reinhard Zumkeller, Feb 05 2012
CROSSREFS
Row n=10 of A228275.
Partial sums of A178500.
KEYWORD
nonn,easy
AUTHOR
Alexandre Wajnberg, Apr 25 2005
STATUS
approved
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
OFFSET
0,2
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) = 5*(5^n - 1)/4. - Max Alekseyev, Jan 23 2006
a(n) = a(n-1) + 5^n with a(0)=0. - Vincenzo Librandi, Nov 13 2010
From Colin Barker, Jul 25 2014: (Start)
a(n) = 6*a(n-1) - 5*a(n-2).
G.f.: 5*x / ((1-x)*(1-5*x)). (End)
E.g.f.: (5/4)*(exp(5*x) - exp(x)). - G. C. Greubel, Jun 15 2021
EXAMPLE
a(3) = 5*a(2) + 5 = 5*30 + 5 = 155.
MAPLE
a:=n->add(5^j, j=1..n): seq(a(n), n=0..30); # Zerinvary Lajos, Jun 27 2007
MATHEMATICA
RecurrenceTable[{a[n]==5*a[n-1]+5, a[0]==0}, a, {n, 0, 30}] (* Vaclav Kotesovec, Jul 25 2014 *)
NestList[5#+5&, 0, 30] (* Harvey P. Dale, Oct 04 2019 *)
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
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Alexandre Wajnberg, Apr 24 2005
STATUS
approved
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
OFFSET
0,2
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) = (7^(n+1) - 7) / 6. - Max Alekseyev, Jan 23 2006
a(n) = a(n-1) + 7^n with a(0)=0. - Vincenzo Librandi, Nov 13 2010
From Colin Barker, Jul 25 2014: (Start)
a(n) = 8*a(n-1) - 7*a(n-2).
G.f.: 7*x / ((x-1)*(7*x-1)). (End)
E.g.f.: (7/6)*(exp(7*x) - exp(x)). - G. C. Greubel, Jun 09 2021
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
CROSSREFS
Row n=7 of A228275.
KEYWORD
easy,nonn
AUTHOR
Alexandre Wajnberg, Apr 24 2005
STATUS
approved
a(0)=0; a(n)=6*a(n-1)+6.
+10
3
0, 6, 42, 258, 1554, 9330, 55986, 335922, 2015538, 12093234, 72559410, 435356466, 2612138802, 15672832818, 94036996914, 564221981490, 3385331888946, 20311991333682, 121871948002098, 731231688012594, 4387390128075570, 26324340768453426, 157946044610720562
OFFSET
0,2
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) = 6^n+a(n-1) (with a(0)=0). - Vincenzo Librandi, Nov 13 2010
a(n) = 7*a(n-1)-6*a(n-2). G.f.: 6*x/((x-1)*(6*x-1)). - Colin Barker, Jan 28 2013
MAPLE
a:=n->add(6^j, j=1..n): seq(a(n), n=0..30); # Zerinvary Lajos, Oct 03 2007
MATHEMATICA
NestList[6#+6&, 0, 30] (* Harvey P. Dale, Jul 24 2012 *)
PROG
(PARI) a(n)=if(n<0, 0, (6^n-1)*6/5)
CROSSREFS
Row n=6 of A228275.
KEYWORD
easy,nonn
AUTHOR
Alexandre Wajnberg, Apr 25 2005
EXTENSIONS
More terms from Harvey P. Dale, Jul 24 2012
STATUS
approved
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
OFFSET
0,2
FORMULA
a(n) = 11^n+a(n-1) (with a(0)=0). - Vincenzo Librandi, Nov 13 2010
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 *)
CROSSREFS
Row n=11 of A228275.
KEYWORD
base,easy,nonn
AUTHOR
Alexandre Wajnberg, Apr 25 2005
EXTENSIONS
Corrected by T. D. Noe, Nov 07 2006
STATUS
approved

Search completed in 0.010 seconds