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”).
%I #3 Feb 11 2014 19:05:30
%S 2,2,4,4,9,5,15,10,16,12,29,13,38,19,26,27,56,21,64,29,42,36,80,30,78,
%T 47,69,46,106,31,123,66,84,66,103,51,153,78,104,70,175,52,187,88,106,
%U 96,207,75,195,92,147,111,237,84,187,113,170,131,273,75,279,142,176
%N Number of integers in {1, 2, ..., prime(n)} that are coprime to n.
%C Compare the definition of a(n) to phi(n) = number of integers in {1, 2, ..., n} that are coprime to n.
%e There are five numbers in {1, 2, ..., prime(6) = 13} that are coprime to 6, i.e. 1, 5, 7, 11, 13. Hence a(6) = 5.
%t h[n_] := Module[{l}, l = {}; For[i = 1, i <= Prime[n], i++, If[GCD[i, n] == 1, l = Append[l, i]]]; l]; Table[Length[h[i]], {i, 1, 100}]
%K nonn
%O 1,1
%A _Joseph L. Pe_, Oct 04 2002