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”).

Initial digits of prime numbers.
15

%I #15 Oct 16 2024 22:26:30

%S 2,3,5,7,1,1,1,1,2,2,3,3,4,4,4,5,5,6,6,7,7,7,8,8,9,1,1,1,1,1,1,1,1,1,

%T 1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,

%U 3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5

%N Initial digits of prime numbers.

%H Vincenzo Librandi, <a href="/A077648/b077648.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A000030(A000040(n)).

%t Table[First[IntegerDigits[Prime[n]]], {n, 1, 120}]

%o (Magma) [Intseq(p)[#Intseq(p)]: p in PrimesUpTo(600)]; // _Bruno Berselli_, Feb 14 2013

%o (PARI) a(n) = digits(prime(n))[1]; \\ _Michel Marcus_, Feb 11 2017

%o (Python)

%o from sympy import prime

%o def A077648(n): return int(str(prime(n))[0]) # _Chai Wah Wu_, Oct 16 2024

%Y Cf. A000030, A000040.

%K base,nonn

%O 1,1

%A _Labos Elemer_, Nov 19 2002