[go: up one dir, main page]

login
A097944
Number of digits in n-th prime.
9
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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
OFFSET
1,5
COMMENTS
For primes p <= n sum(a(n)) -> n/2 and n-> inf.
LINKS
FORMULA
a(n) = (log n + log log n)/(log 10) + O(1).
a(n) = A055642(A000040(n)). - Reinhard Zumkeller, Apr 08 2012
a(n) = A068670(n) - A068670(n-1). - M. F. Hasler, Oct 24 2019
EXAMPLE
The first 4 primes are 2,3,5,7. These are 1-digit numbers so the first 4 entries in the table are 1's.
MATHEMATICA
a[n_]:=StringLength[ToString[Prime[n]]]; (* Vladimir Joseph Stephan Orlovsky, Dec 03 2008 *)
IntegerLength[Prime[Range[110]]] (* Harvey P. Dale, Oct 04 2012 *)
PROG
(PARI) a(n)=#Str(prime(n))
(PARI) A097944(n)=logint(prime(n), 10)+1 \\ M. F. Hasler, Oct 24 2019
(Haskell)
a097944 = a055642 . a000040 -- Reinhard Zumkeller, Apr 08 2012
CROSSREFS
Cf. A060417, A068670 (partial sums).
Sequence in context: A204553 A214455 A060417 * A037203 A032556 A110592
KEYWORD
nonn,base,easy
AUTHOR
Cino Hilliard, Sep 05 2004
STATUS
approved