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-8 of 8 results.

A033308 Decimal expansion of Copeland-Erdős constant: concatenate primes.

Original entry on oeis.org

2, 3, 5, 7, 1, 1, 1, 3, 1, 7, 1, 9, 2, 3, 2, 9, 3, 1, 3, 7, 4, 1, 4, 3, 4, 7, 5, 3, 5, 9, 6, 1, 6, 7, 7, 1, 7, 3, 7, 9, 8, 3, 8, 9, 9, 7, 1, 0, 1, 1, 0, 3, 1, 0, 7, 1, 0, 9, 1, 1, 3, 1, 2, 7, 1, 3, 1, 1, 3, 7, 1, 3, 9, 1, 4, 9, 1, 5, 1, 1, 5, 7, 1, 6, 3, 1, 6, 7, 1, 7, 3, 1, 7, 9, 1, 8, 1, 1, 9, 1, 1
Offset: 0

Views

Author

Keywords

Comments

The number .23571113171923.... was proved normal in base 10 by Copeland and Erdős but is not known to be normal in other bases. - Jeffrey Shallit, Mar 14 2008
Could be read (with indices 1, 2, ...) as irregular table whose n-th row lists the A097944(n) digits of the n-th prime A000040(n). - M. F. Hasler, Oct 25 2019
Named after the American mathematician Arthur Herbert Copeland (1898-1970) and the Hungarian mathematician Paul Erdős (1913-1996). - Amiram Eldar, May 29 2021
This constant is irrational but it is not (yet) known to be transcendental. - Charles R Greathouse IV, Feb 03 2025

Examples

			0.235711131719232931374143475359616771737983899710110310710911312...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 6.9, p. 442.
  • Glyn Harman, One hundred years of normal numbers, in M. A. Bennett et al., eds., Number Theory for the Millennium, II (Urbana, IL, 2000), A K Peters, Natick, MA, 2002, pp. 149-166.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.

Crossrefs

Cf. A030168 (continued fraction), A072754 (numerators of convergents), A072755 (denominators of convergents).
Cf. A000040 (primes), A097944 (row lengths if this is read as table), A228355 (digits of the primes listed in reversed order).
Cf. A033307 (Champernowne constant: analog for positive integers instead of primes), A007376 (digits of the integers, considered as infinite word or table), A066716 (decimals of the binary Champernowne constant).
Cf. A066747 and A191232: binary Copeland-Erdős constant: decimals and binary digits.
See also A338072.

Programs

  • Haskell
    a033308 n = a033308_list !! (n-1)
    a033308_list = concatMap (map (read . return) . show) a000040_list :: [Int]
    -- Reinhard Zumkeller, Mar 03 2014
  • Mathematica
    N[Sum[Prime[n]*10^-(n + Sum[Floor[Log[10, Prime[k]]], {k, 1, n}]), {n, 1, 40}], 100] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Aug 12 2006 *)
    N[Sum[Prime@n*10^-(n + Sum[Floor[Log[10, Prime@k]], {k, n}]), {n, 45}], 106] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Aug 12 2006 *)
    IntegerDigits //@ Prime@Range@45 // Flatten (* Robert G. Wilson v Oct 03 2006 *)
  • PARI
    default(realprecision, 2080); x=0.0; m=-1; forprime (p=2, 4000, n=1+floor(log(p)/log(10)); x=p+x*10^n; m+=n; ); x=x/10^m; for (n=0, 2000, d=floor(x); x=(x-d)*10; write("b033308.txt", n, " ", d)); \\ Harry J. Smith, Apr 30 2009
    
  • PARI
    concat( apply( {row(n)=digits(prime(n))},  [1..99] )) \\ Yields this sequence; row(n) then yields the digits of prime(n) = n-th row of the table, cf. comments. - M. F. Hasler, Oct 25 2019
    

Formula

Equals Sum_{n>=1} prime(n)*10^(-A068670(n)). - Joseph Biberstine (jrbibers(AT)indiana.edu), Aug 12 2006
Equals Sum_{i>=1} (p_i * 10^(-(Sum_{j=1..i} 1 + floor(log_10(p_j))) )) or Sum_{i>=1} (p_i * 10^(-( i + Sum_{j=1..i} floor(log_10(p_j))) )) or Sum_{i>=1} (p_i * 10^(-( Sum_{j=1..i} ceiling(log_10(1 + p_j))) )). - Daniel Forgues, Mar 26-28 2014

A068670 Number of digits in the concatenation of first n primes.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 49, 52, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 154
Offset: 0

Views

Author

Eugene McDonnell (eemcd(AT)mac.com), Jan 18 2004

Keywords

Comments

Partial sums of A097944. - Lekraj Beedassy, Aug 26 2008

Examples

			a(5) is 6 because concatenating the first five primes gives 235711, which has six digits.
		

Crossrefs

Cf. A019518, A097944 (number of decimal digits of the primes).
Cf. A033308 (decimal expansion of the Copeland-Erdos constant).

Programs

  • Magma
    a068670:=func< n | n + &+[ Floor(Log(10, NthPrime(k))): k in [1..n] ] >; [ a068670(n): n in [1..70] ];
    
  • Mathematica
    Table[n + Sum[Floor[Log[10, Prime[k]]], {k, 1, n}], {n, 1, 90}] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Aug 12 2006 *)
    Accumulate[IntegerLength[Prime[Range[70]]]] (* Harvey P. Dale, Jul 01 2012 *)
  • PARI
    A68670=List(0); A068670(n)={for(N=#A68670,n, listput(A68670, A68670[N] + A097944(N))); A68670[n+1]} \\ M. F. Hasler, Oct 24 2019
    
  • Python
    from sympy import sieve
    from itertools import accumulate, chain
    def f(, n): return  + len(str(n))
    def agen(): yield from accumulate(chain((0,), (p for p in sieve)), f)
    print(list(islice(agen(), 62))) # Michael S. Branicky, Feb 03 2023

Formula

a(n) = Sum_{i=1..n} ceiling(log_10(1 + prime(i))). - Daniel Forgues, Apr 02 2014

Extensions

Extended to a(0) = 0 by M. F. Hasler, Oct 24 2019

A074462 Average digit (rounded up) in the decimal expansion of prime(n).

Original entry on oeis.org

2, 3, 5, 7, 1, 2, 4, 5, 3, 6, 2, 5, 3, 4, 6, 4, 7, 4, 7, 4, 5, 8, 6, 9, 8, 1, 2, 3, 4, 2, 4, 2, 4, 5, 5, 3, 5, 4, 5, 4, 6, 4, 4, 5, 6, 7, 2, 3, 4, 5, 3, 5, 3, 3, 5, 4, 6, 4, 6, 4, 5, 5, 4, 2, 3, 4, 3, 5, 5, 6, 4, 6, 6, 5, 7, 5, 7, 7, 2, 5, 5, 3, 3, 4, 6, 4, 6, 6, 4, 5, 6, 7, 7, 5, 8, 3, 5, 3, 4, 4, 6, 6, 5, 7, 5, 7, 7, 6, 8, 3, 5, 4, 5, 6, 4, 4, 5, 6, 5, 7
Offset: 1

Views

Author

Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 23 2002

Keywords

Examples

			The prime numbers begin with 2,3,5,7,11,13,17,19,23,... so the average digits rounded up are 2, 3, 5, 7, (1+1)/2=1, (1+3)/2=2, (1+7)/2=4, (1+9)/2=5, ceiling((2+3)/2)=3, ...
		

Crossrefs

Programs

  • Mathematica
    Table[Ceiling[Mean[IntegerDigits[p]]],{p,Prime[Range[120]]}] (* Harvey P. Dale, Nov 06 2022 *)
  • PARI
    a(n) = my(d=digits(prime(n))); ceil(vecsum(d)/#d); \\ Michel Marcus, Apr 23 2022

Formula

a(n) = ceiling(A007605(n)/A097944(n)). - R. J. Mathar, Sep 23 2008
a(n) = A004427(A000040(n)). - Reinhard Zumkeller, May 27 2010

Extensions

Offset changed to 1, cf. to A073342 added, and extended by R. J. Mathar, Sep 23 2008

A228355 Write the primes backwards in base 10 and juxtapose their digits.

Original entry on oeis.org

2, 3, 5, 7, 1, 1, 3, 1, 7, 1, 9, 1, 3, 2, 9, 2, 1, 3, 7, 3, 1, 4, 3, 4, 7, 4, 3, 5, 9, 5, 1, 6, 7, 6, 1, 7, 3, 7, 9, 7, 3, 8, 9, 8, 7, 9, 1, 0, 1, 3, 0, 1, 7, 0, 1, 9, 0, 1, 3, 1, 1, 7, 2, 1, 1, 3, 1, 7, 3, 1, 9, 3, 1, 9, 4, 1, 1, 5, 1, 7, 5, 1, 3, 6, 1, 7, 6
Offset: 0

Views

Author

Vincenzo Librandi, Aug 21 2013

Keywords

Comments

Also, decimal expansion of the constant 0.235711317191329213731434743595...
The same sequence, but with different indexing, would arise for the table whose n-th row lists the A097944(n) digits of the n-th prime A000040(n) from right to left. - M. F. Hasler, Oct 24 2019

Crossrefs

Programs

  • Mathematica
    Reverse[IntegerDigits//@ Reverse@Prime@Range@50//Flatten]
  • PARI
    fromdigits( A=concat(apply( row(n)=Vecrev(digits(prime(n))), [1..default(realprecision)])))*.1^#A \\ Result = the constant, A = sequence of digits, row(n) = n-th row of the table. - M. F. Hasler, Oct 24 2019

A060417 Number of different decimal digits in n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, 3, 2, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3
Offset: 1

Views

Author

Labos Elemer, Apr 05 2001

Keywords

Examples

			The maximum is 10. Thus 1234567891 is a prime with 9 and 123456789011 with 10 different decimal digits.
		

Crossrefs

Programs

  • Haskell
    import Data.List (nub, sort)
    a060417 = length . nub . show . a000040
    -- Reinhard Zumkeller, Apr 08 2012

Formula

Table[Length[Union[IntegerDigits[Prime[w]]]], {w, 1, 1000}]

A073342 Average digit (rounded to the nearest integer) in the decimal expansion of n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 1, 2, 4, 5, 3, 6, 2, 5, 3, 4, 6, 4, 7, 4, 7, 4, 5, 8, 6, 9, 8, 1, 1, 3, 3, 2, 3, 2, 4, 4, 5, 2, 4, 3, 5, 4, 6, 3, 4, 4, 6, 6, 1, 2, 4, 4, 3, 5, 2, 3, 5, 4, 6, 3, 5, 4, 4, 5, 3, 2, 2, 4, 2, 4, 5, 5, 4, 6, 5, 4, 6, 5, 7, 6, 2, 4, 5, 2, 3, 3, 5, 4, 6, 5, 4, 4, 6, 7, 6, 5, 7, 3, 5, 3, 3, 3, 5, 6, 5, 7, 4, 6, 7, 6, 8, 2, 4, 3, 5, 5, 3, 4, 4, 6, 5, 7
Offset: 1

Views

Author

Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 23 2002

Keywords

Examples

			For the prime 107 we have nearest((1+0+7)/3)=nearest(8/3)=3.
		

Crossrefs

Programs

  • Mathematica
    Floor[Mean[IntegerDigits[#]]+1/2]&/@Prime[Range[120]] (* Harvey P. Dale, Nov 22 2011 *)

Formula

a(n)=round(A007605(n)/A097944(n)). - R. J. Mathar, Sep 23 2008

Extensions

Changed offset to 1, added Cf. to A074462 and extended. - R. J. Mathar, Sep 23 2008

A175762 Primes with an arithmetic mean of digits which is also prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 19, 31, 37, 59, 73, 1061, 1151, 1223, 1289, 1487, 1511, 1559, 1601, 1667, 1847, 1973, 1999, 2099, 2141, 2213, 2297, 2411, 2459, 2477, 2549, 2657, 2693, 2729, 2819, 2837, 2909, 2927, 2963, 3023, 3041, 3089, 3203, 3221, 3359, 3449, 3467, 3539, 3557
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 29 2010

Keywords

Examples

			a(10)=73 because (7+3)/2=5=prime. a(12)=1151 because (1+1+5+1)/4=2=prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[500]],PrimeQ[Mean[IntegerDigits[#]]]&] (* Harvey P. Dale, Jan 16 2013 *)

Formula

{A000040(i): A007605(i)/A097944(i) in A000040}.

Extensions

Corrected (59 inserted, 1061 inserted etc.) by R. J. Mathar, Sep 24 2010

A278959 Length of the string that is generated by the concatenation of all the prime numbers < n (where n >= 0).

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 6, 6, 8, 8, 8, 8, 10, 10, 12, 12, 12, 12, 14, 14, 14, 14, 14, 14, 16, 16, 18, 18, 18, 18, 18, 18, 20, 20, 20, 20, 22, 22, 24, 24, 24, 24, 26, 26, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 30
Offset: 0

Views

Author

Indranil Ghosh, Dec 02 2016

Keywords

Comments

In the following Python program, the algorithm based on the sieve of Eratosthenes is used to generate the primes.

Examples

			For n=15, the primes < n are 2,3,5,7,11,13. So the concatenated string is "23571113", which has length=8. a(n)=8.
		

Crossrefs

Programs

  • Mathematica
    Join[{0},Accumulate[Table[If[PrimeQ[n],IntegerLength[n],0],{n,0,60}]]] (* Harvey P. Dale, Mar 04 2023 *)
  • Python
    def p(n):
        if n<=2:
            return 0
        s=1
        l = [True] * n
        for i in range(3,int(n**0.5)+1,2):
            if l[i]:
                l[i*i::2*i]=[False]*((n-i*i-1)//(2*i)+1)
        for i in range(3,n,2):
                if l[i]:
                    s+=len(str(i))
        return s
    for i in range(0, 100001):
        print(f'{i} {p(i)}')
Showing 1-8 of 8 results.