login
If b(n,1) = n; b(n,m) is number of terms among {b(n,1), b(n,2), ..., b(n,m-1)} which are coprime to m, then a(n) = b(n,n).
0

%I #13 Jul 25 2021 01:25:32

%S 1,0,1,1,3,1,5,4,5,3,9,3,11,8,6,9,15,5,17,8,12,11,21,7,18,13,12,12,27,

%T 7,29,19,15,18,24,12,35,23,23,17,39,12,41,20,19,25,45,18,38,24,23,26,

%U 51,21,40,30,35,31,57,18,59,38,37,38,47,24,65,36,38,27,69,24,71,41,36,43

%N If b(n,1) = n; b(n,m) is number of terms among {b(n,1), b(n,2), ..., b(n,m-1)} which are coprime to m, then a(n) = b(n,n).

%C When calculating the sequence, GCD(0,m) = m, so 0 is to be considered coprime only to 1.

%e Array b(n,m) (of which this sequence in the main diagonal) begins like this:

%e 1,1,2,2,4,2,6,2,7,... (sequence A096216)

%e 2,0,1,1,3,2,5,4,6,... (sequence A097559)

%e 3,1,1,3,4,2,6,4,5,... (sequence A097560)

%e 4,0,1,1,3,2,5,4,6,... (sequence A097559 except for first term)

%e 5,1,2,2,3,2,6,3,5,... (sequence A097562)

%e 6,0,0,0,1,1,3,3,2,... (sequence A097606)

%t b[n_] := Module[{a}, a[1] = n; a[k_] := a[k] = Count[ GCD[ Table[ a[i], {i, k - 1}], k], 1]; a[n]]; Array[b, 76] (* _Robert G. Wilson v_, Dec 27 2005 *)

%Y Cf. A096216, A097559, A097560, A097562, A097606.

%K nonn

%O 1,5

%A _Leroy Quet_, Dec 25 2005

%E a(17)-a(76) from _Robert G. Wilson v_, Dec 27 2005