OFFSET
1,1
COMMENTS
A family of related sequences can be generated using different positive integers for a(1). a(1)=1 gives sequence A096216.
EXAMPLE
a(8)=4 because among the first seven terms, namely 3,1,1,3,4,2,6, there are 4 terms that are relatively prime to 8 (3,1,1 and 3).
MAPLE
a[1]:=3: for n from 2 to 100 do s:=0: for j from 1 to n-1 do if gcd(a[j], n)=1 then s:=s+1 else s:=s fi od: a[n]:=s: od: seq(a[n], n=1..84); # Emeric Deutsch, Aug 03 2005
MATHEMATICA
a[1] = 3; a[n_] := a[n] = Count[ GCD[ Table[ a[i], {i, n - 1}], n], 1]; Array[a, 79] (* Robert G. Wilson v, Dec 27 2005 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Aug 27 2004
EXTENSIONS
More terms from John W. Layman, Sep 27 2004
STATUS
approved