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!)
A122847 a(0)=0. a(n) = a(n-1) + (sum of positive integers which are coprime to n, <= n and missing from {a(0),a(1),a(2),..,a(n-1)}). 1

%I #11 Oct 11 2019 12:37:39

%S 0,1,1,3,3,9,14,31,43,69,76,118,141,206,235,280,331,440,493,637,704,

%T 829,926,1152,1247,1470,1613,1841,1996,2375,2494,2932,3144,3428,3656,

%U 4032,4216,4824,5122,5544,5820,6582,6802,7647,8000,8451,8870,9850,10159

%N a(0)=0. a(n) = a(n-1) + (sum of positive integers which are coprime to n, <= n and missing from {a(0),a(1),a(2),..,a(n-1)}).

%e The positive integers which are coprime to 8 and <= 8 are 1,3,5,7. Of these, 5 and 7 are missing from the terms a(0) through a(7). So a(8) = a(7) + 5 + 7 = 43.

%t f[l_List] := Block[{n = Length[l]},Append[l, l[[ -1]] + Plus @@ Select[Range[n], GCD[n, # ] == 1 && FreeQ[l, # ] &]]];Nest[f, {0}, 50] (* _Ray Chandler_, Oct 26 2006 *)

%t s={0,1}; b=1; Do[ b=b+Total[ Select[ Range[ n ],GCD[ #1,n ]==1&&FreeQ[ s,#1 ]& ] ]; AppendTo[ s,b ],{n,2,100} ]; s (*Seidov*)

%Y Cf. A122965.

%K nonn

%O 0,4

%A _Leroy Quet_, Oct 23 2006

%E Extended by _Ray Chandler_ and _Zak Seidov_, Oct 26 2006

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 May 3 14:39 EDT 2024. Contains 372215 sequences. (Running on oeis4.)