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 31-40 of 50 results. Next

A261806 a(n) = Sum from "least x such that prime(x) has n digits" to "the number of primes with n digits" of the difference between prime(k) and k.

Original entry on oeis.org

7, 474, 42311, 3558614, 300169143, 25814402881, 2261786350515, 200839375217041, 18042305628036066, 1636922369808190765, 149754058084293423958, 13797718194530764325852, 1279006935910516590640721, 119184789951429474863414128, 11157358746329927416919291238, 1048709967153503078344158238498
Offset: 1

Views

Author

Carauleanu Marc, Jul 09 2016

Keywords

Examples

			As 2, 3, 5, and 7 are the only primes less than 10, A006879(1) = 4 and as 1 is the least number such that prime(1) has 1 digit, A090226(1) = 1. Therefore a(1) = Sum_{k=1..4} prime(k)-k = (2-1) + (3-2) + (5-3) + (7-4) = 1 + 1 + 2 + 3 = 7.
		

Crossrefs

Formula

a(n) = Sum_{k=A090226(n)..A006879(n)} prime(k)-k

Extensions

a(7)-a(16) from Lucas A. Brown, Oct 21 2024

A087435 Partial sums of A087434.

Original entry on oeis.org

10, 241, 10537, 573928, 35547994, 2409600865, 174155363186, 13163230391312, 1029540512731472, 82720372430619225, 6791513306490769978, 567576781128880904593, 48140629936389507358024
Offset: 1

Views

Author

Ray Chandler, Sep 02 2003

Keywords

Comments

Number of brilliant numbers <10^2n.
Bisection of A086846.

Crossrefs

Extensions

a(14) from Ray Chandler, Jul 21 2005

A098226 Number of primes <= 10^n which have repeated decimal digits.

Original entry on oeis.org

0, 1, 47, 598, 6432, 65099, 617230, 5623596, 50564448, 454769425, 4117771727, 37607628932, 346065253753, 3204941467716, 29844570139583, 279238340750839, 2623557157371147, 24739954287457774, 234057667276061521, 2220819602560635754, 21127269486018448842
Offset: 1

Views

Author

Labos Elemer, Oct 25 2004

Keywords

Crossrefs

Formula

For n>=10 a(n) = A006880(n) - 283086 because the total number of distinct-digit primes equals 283086. See A098224.

Extensions

a(13)-a(21) from Giovanni Resta, Oct 29 2019

A221847 Number of primes of the form (x+1)^5 - x^5 having n digits.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 2, 6, 7, 11, 10, 26, 44, 63, 112, 178, 286, 507, 819, 1424, 2385, 4044, 6826, 11591, 19692, 34150, 58171, 99410, 169547, 291195, 500353, 860230, 1482979, 2554281, 4406698
Offset: 0

Views

Author

Vladimir Pletser, Jan 26 2013

Keywords

Comments

Number of primes having n digits and equal to the difference of two consecutive fifth powers (x+1)^5 - x^5 = 5x(x+1)(x^2+x+1)+1 (A121616). Values of x = A121617. Sequence of number of primes having n digits and of the form (x+1)^5 - x^5 have similar characteristics to similar sequences for natural primes (A006879) and cuban primes (A221792).

A221978 Number of primes of the form (x+1)^7 - x^7 having n digits.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 3, 1, 1, 2, 4, 4, 7, 9, 12, 14, 29, 31, 45, 62, 71, 117, 175, 231, 331, 454, 634, 948, 1250, 1770, 2506, 3566, 5088, 7192, 10261, 14592, 21168, 30275, 43099, 61336, 87770, 126195, 180957, 258657, 371653, 534391, 767164, 1103259, 1583584, 2276179
Offset: 1

Views

Author

Vladimir Pletser, Feb 02 2013

Keywords

Comments

Number of primes having n digits and equal to the difference of two consecutive seventh powers (x+1)^7 - x^7 = 7x(x+1)(x^2+x+1)^2+1 (A121618). Values of x = A121619 - 1. Sequence of number of primes having n digits and of the form (x+1)^7 - x^7 have similar characteristics to similar sequences for natural primes (A006879), cuban primes (A221792) and primes of the form (x+1)^5 - x^5 (A221847).

Programs

  • Mathematica
    nn = 30; t = Table[0, {nn}]; n = 0; While[n++; p = (n + 1)^7 - n^7; p < 10^nn, If[PrimeQ[p], m = Ceiling[Log[10, p]]; t[[m]]++]]; t (* T. D. Noe, Feb 04 2013 *)

A228067 Difference of consecutive integers nearest to Li(10^n) - Li(2), where Li(x) = integral(0..x, dt/log(t)) (A190802, known as Gauss' approximation for the number of primes below 10^n).

Original entry on oeis.org

5, 24, 148, 1068, 8384, 68998, 586290, 5097291, 45087026, 404206380, 3663010786, 33489883880, 308457695529, 2858876419882, 26639629409596, 249393772773269, 2344318821362265, 22116397144079593, 209317713066531967, 1986761935407441102
Offset: 1

Views

Author

Vladimir Pletser, Aug 06 2013

Keywords

Comments

This sequence gives a good approximation of the number of primes with n digits (A006879); see (A228068).
Note that A190802(n)=(Li(10^n)-Li(2)) is not defined for n=0. Its value is arbitrarily set to 0.

Examples

			For n = 1, A190802(1) - A190802(0) = 5-0 = 5.
		

Crossrefs

Formula

a(n) = A190802(n) - A190802(n-1).

A246806 Number of n-digit numbers whose base-10 representations can be written as the concatenations of 0 or more prime numbers (also expressed in base 10).

Original entry on oeis.org

1, 4, 33, 285, 2643, 24920, 239543, 2327458, 22801065, 224608236, 2222034266, 22053438268
Offset: 0

Views

Author

Jeffrey Shallit, Nov 16 2014

Keywords

Comments

Here we assume all representations involved are "canonical", that is, have no leading zeros. 1 is not a prime, and neither is 0.

Examples

			For n = 2 the 33 numbers counted include the 21 primes between 10 and 99, and also the 12 numbers {22,25,27,32,33,35,52,55,57,72,75,77}.
		

Crossrefs

Programs

  • Maple
    P[1]:= {2,3,5,7}: C[1]:= P[1]:
    for n from 2 to 7 do
      P[n]:= select(isprime, {seq(2*i+1, i=10^(n-1)/2 .. 5*10^(n-1)-1)});
      C[n]:= `union`(P[n],seq({seq(seq(c*10^j+p,p=P[j]),c=C[n-j])},j=1..n-1));
    od:
    1, seq(nops(C[n]),n=1..7); # Robert Israel, Dec 07 2014
  • Python
    from sympy import isprime, primerange
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def ok(n):
      if n%10 not in {1, 2, 3, 5, 7, 9}: return False
      if isprime(n): return True
      d = str(n)
      for i in range(1, len(d)):
        if d[i] != '0' and isprime(int(d[:i])) and ok(int(d[i:])): return True
      return False
    def a(n): return 1 if n == 0 else sum(ok(m) for m in range(10**(n-1), 10**n))
    print([a(n) for n in range(7)]) # Michael S. Branicky, Mar 26 2021

Extensions

a(9) from Jeffrey Shallit, Dec 07 2014
a(10)-a(11) from Lars Blomberg, Feb 09 2019

A359120 Number of primes p with 10^(n-1) < p < 10^n such that 10^n-p is also prime.

Original entry on oeis.org

3, 11, 47, 221, 1433, 9579, 69044, 519260, 4056919, 32504975, 266490184, 2224590493, 18850792161
Offset: 1

Views

Author

N. J. A. Sloane, Dec 17 2022

Keywords

Comments

The terms of A358310 come in decreasing blocks; a(n) is the length of the n-th block.

Examples

			For n = 1, there are three primes p with 1 < p < 10 such that 10-p is also prime, 3, 5, and 7, so a(1) = 3.
		

Crossrefs

A107318 and A065577 are very similar.

Programs

  • PARI
    a(n) = {if(n==1,return(3)); my(res=0, pow10=10^n); forprime(p=2, 10^(n-1), if(isprime(pow10-p), res++)); forprime(p=10^(n-1), pow10>>1, if(isprime(pow10-p), res+=2)); res} \\ David A. Corneth, Dec 17 2022
    
  • Python
    from sympy import isprime, primerange
    def a(n):
        lb, ub = 10**(n-1), 10**n
        s1 = sum(1 for p in primerange(1, lb) if isprime(ub-p))
        s2 = sum(2 for p in primerange(lb, 5*lb) if isprime(ub-p))
        return s1 + s2 + int(n == 1)
    print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Dec 17 2022

Extensions

a(7)-a(9) from Michael S. Branicky, Dec 17 2022
a(10)-a(11) from David A. Corneth, Dec 17 2022
a(12) from N. J. A. Sloane, Dec 17 2022, found using Corneth's PARI program.
a(13) from Martin Ehrenstein, Dec 18 2022, found using Walisch's primesieve library.

A046719 Total number of digits in all primes with n digits.

Original entry on oeis.org

4, 42, 429, 4244, 41815, 413436, 4102567, 40775008, 405774711, 4042049770, 40293025322, 401878286460, 4009949122673, 40024266995482, 399594430078005, 3990300329780096, 39853419882545236, 398095148341559286, 3977036546783471193
Offset: 1

Views

Author

Keywords

Examples

			There are 21 2-digit primes, so a(2)=2*21=42.
		

Crossrefs

a(n)=n*b(n) where b(n) is A006879.

Programs

  • Mathematica
    Flatten[Table[n*Differences[PrimePi[{10^(n - 1), 10^n}]], {n, 13}]] (* Jayanta Basu, Jun 27 2013 *)
    With[{nn=14},Differences[PrimePi[10^Range[0,nn]]]*Range[nn]] (* This program generates only the first 14 terms of the sequence; Mathematica's PrimePi function cannot generate the 15th or higher terms *) (* Harvey P. Dale, Apr 22 2016 *)

Extensions

Corrected by Jud McCranie and N. J. A. Sloane.

A077645 Sum of all primes having n decimal digits.

Original entry on oeis.org

17, 1043, 75067, 5660269, 448660141, 37096005486, 3165774592333, 276006465392920, 24460302301867259, 2196082920489474703, 199246255311162951776, 18234121474806961230363, 1680810854825228712978117, 155890014267359161122671527, 14534809256197269457684141345, 1361418455796443892761407164186
Offset: 1

Views

Author

Labos Elemer, Nov 18 2002

Keywords

Comments

Also the sum of the primes between 10^(n-1) and 10^n.
a(12) to a(20) were computed from A046731(12)-A046731(11) to A046731(20)-A046731(19). - Cino Hilliard, May 31 2008
A good estimate for the sum of the primes < k is k^2/(2*log(k)-1). Using this formula, a(20)~(10^20)^2/(2*log(10^20)-1) -(10^19)^2/(2*log(10^19)-1) = 108609290005707493265628731014013409909. The relative error this formula produces for the last 5 terms is a(16): -0.00019454, a(17): -0.00017176, a(18): -0.00015275, a(19): -0.00013674, a(20): -0.00012312. - Cino Hilliard, May 31 2008

Examples

			a(1) = 2 + 3 + 5 + 7 = 17, sum of four 1-digit primes.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) local tot,b,j: tot:=nextprime(10^(n-1)): b:=nextprime(10^(n-1)): for j while nextprime(b) < 10^n do tot:=tot+nextprime(b): b:=nextprime(b) end do:tot end proc: # Emeric Deutsch, Oct 08 2007
  • Mathematica
    Prepend[Table[Apply[Plus,Table[Prime[w],{w,PrimePi[10^(n-1)]+1,PrimePi[10^n]}]],{n,2,7}],17] (* corrected by Ivan N. Ianakiev, Aug 12 2016 *)

Formula

a(n) = Sum_{10^(n-1) <= p <= 10^n, p prime} p = A007504(A000720(10^n)) - A007504(A000720(10^(n-1))).

Extensions

2 more terms from Lior Manor, Sep 11 2007
Corrected and extended by Emeric Deutsch, Oct 08 2007
More terms from Cino Hilliard, May 31 2008
Previous Showing 31-40 of 50 results. Next