login
Initial digit of composite numbers.
0

%I #13 Dec 13 2017 02:44:12

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

%T 5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,

%U 9,9,9,9,9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

%N Initial digit of composite numbers.

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

%t c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x] Table[First[IntegerDigits[c[w]]], {w, 1, 128}]

%t First[IntegerDigits[#]]&/@Complement[Range[150],Prime[Range[ PrimePi[150]]]] (* _Harvey P. Dale_, Apr 26 2011 *)

%o (PARI) lista(nn) = forcomposite(n=1, nn, print1(digits(n)[1], ", ")); \\ _Michel Marcus_, Dec 13 2017

%Y Cf. A000030, A002808, A077648.

%K base,easy,nonn

%O 1,1

%A _Labos Elemer_, Nov 19 2002