login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A097559 a(n) = number of terms among {a(1), a(2), a(3), ..., a(n-1)} that are coprime to n; a(1)=2. 1

%I #16 Jul 26 2015 10:10:35

%S 2,0,1,1,3,2,5,4,6,3,9,3,11,8,7,9,15,5,17,10,11,12,21,8,19,16,16,14,

%T 27,7,29,19,19,20,24,13,35,20,25,19,39,14,41,25,23,28,45,20,40,23,35,

%U 30,51,22,36,28,35,33,57,16,59,37,34,38,46,23,65,38,45,27,69,27,71,44,38,40

%N a(n) = number of terms among {a(1), a(2), a(3), ..., a(n-1)} that are coprime to n; a(1)=2.

%C A family of related sequences can be generated using different positive integers for a(1). (a(1)=1 gives sequence A096216.)

%e a(8)=4 because among the first seven terms, namely 2,0,1,1,3,2,5, there are 4 terms that are relatively prime to 8 (1,1,3 and 5).

%p a[1]:=2: 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_

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

%Y Cf. A096216.

%K nonn

%O 1,1

%A _Leroy Quet_, Aug 27 2004

%E More terms from _Emeric Deutsch_, Aug 03 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 13 18:54 EDT 2024. Contains 374285 sequences. (Running on oeis4.)