login
a(1)=1. a(n) is the number of earlier terms of the sequence which are noncomposites (1 or primes) and are coprime to n.
0

%I #11 Oct 31 2019 11:54:52

%S 1,1,2,2,4,2,5,3,6,3,8,3,9,6,5,7,11,6,12,7,8,9,13,8,12,10,11,10,15,7,

%T 16,13,12,14,12,11,18,15,13,14,19,11,21,14,16,18,21,15,18,16,18,15,21,

%U 15,15,15,17,19,23,16,24,21,18,21,19,15,25,21,21,17,26,20,26,23,22,21,20

%N a(1)=1. a(n) is the number of earlier terms of the sequence which are noncomposites (1 or primes) and are coprime to n.

%e The noncomposites among the first 7 terms of the sequence are 1,1,2,2,2,5. Of these, three terms (1,1,5) are coprime to 8. So a(8)=3.

%t f[l_List] := Append[l, Length[Select[l, GCD[ #,Length[l] + 1] == 1 && (PrimeQ[ # ] || # == 1) &]]];Nest[f, {1}, 80] (* _Ray Chandler_, Dec 11 2006 *)

%K nonn

%O 1,3

%A _Leroy Quet_, Dec 08 2006

%E Extended by _Ray Chandler_, Dec 11 2006