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!)
A100448 Number of triples (i,j,k) with 1 <= i <= j < k <= n and gcd{i,j,k} = 1. 15

%I #23 Mar 29 2021 14:47:37

%S 0,1,4,9,19,30,51,73,106,140,195,241,319,388,480,572,708,813,984,1124,

%T 1310,1485,1738,1926,2216,2462,2777,3059,3465,3749,4214,4590,5060,

%U 5484,6048,6474,7140,7671,8331,8899,9719,10289,11192,11902,12754,13535,14616

%N Number of triples (i,j,k) with 1 <= i <= j < k <= n and gcd{i,j,k} = 1.

%C Probably the partial sums of A102309. - _Ralf Stephan_, Jan 03 2005

%H R. J. Mathar, <a href="/A100448/b100448.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = (A071778(n)-1)/6. - _Vladeta Jovovic_, Nov 30 2004

%F a(n) = (1/6)*(-1 + Sum_{k=1..n} moebius(k)*floor(n/k)^3). - _Ralf Stephan_, Jan 03 2005

%p f:=proc(n) local i,j,k,t1,t2,t3; t1:=0; for i from 1 to n do for j from i to n do t2:=gcd(i,j); for k from j+1 to n do t3:=gcd(t2,k); if t3 = 1 then t1:=t1+1; fi; od: od: od: t1; end;

%t f[n_] := Length[ Union[ Flatten[ Table[ If[ GCD[i, j, k] == 1, {i, j, k}], {i, n}, {j, i, n}, {k, j + 1, n}], 2]]]; Table[ If[n > 3, f[n] - 1, f[n]], {n, 47}] (* _Robert G. Wilson v_, Dec 14 2004 *)

%o (Python)

%o from functools import lru_cache

%o @lru_cache(maxsize=None)

%o def A100448(n):

%o if n == 0:

%o return 0

%o c, j = 2, 2

%o k1 = n//j

%o while k1 > 1:

%o j2 = n//k1 + 1

%o c += (j2-j)*(6*A100448(k1)+1)

%o j, k1 = j2, n//j2

%o return (n*(n**2-1)-c+j)//6 # _Chai Wah Wu_, Mar 29 2021

%Y Cf. A015616, A015631, A027430, A071778, A018805.

%K nonn,easy

%O 1,3

%A _N. J. A. Sloane_, Nov 21 2004

%E More terms from _Robert G. Wilson v_, Dec 14 2004

%E Edited by _N. J. A. Sloane_, Sep 06 2008 at the suggestion of _R. J. Mathar_

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 April 25 10:39 EDT 2024. Contains 371967 sequences. (Running on oeis4.)