%I #22 Feb 16 2025 08:33:01
%S 1,3,7,9,16,20,31,35,39,46,63,67,87,98,112,119,146,152,182,189,209,
%T 228,265,273,286,308,321,330,375,391,440,453,486,515,554,565,624,657,
%U 698,712,778,801,871,888,906,946,1022,1037,1063,1080,1133,1152,1236,1252
%N Numbers of carefree couples (a,b) with a,b<=n.
%C (a, b) is a carefree couple if gcd(a, b) = 1 and a is squarefree (A005117). - _Amiram Eldar_, Mar 03 2021
%D Steven R. Finch, Mathematical Constants, Cambridge University Press, 2003, Section 2.5.1 Carefree Couples, p. 110.
%H Charles R Greathouse IV, <a href="/A118258/b118258.txt">Table of n, a(n) for n = 1..100000</a>
%H Pieter Moree, <a href="https://arxiv.org/abs/math/0510003">Counting carefree couples</a>, arXiv:math/0510003 [math.NT], 2005-2014.
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CarefreeCouple.html">Carefree Couple</a>.
%F From _Amiram Eldar_, Mar 03 2021: (Start)
%F a(n) = (A118259(n) + A118260(n))/2.
%F a(n) ~ A065464 * n^2 + O(n*log(n)). (End)
%e a(4) = 9 because there are 9 ordered pairs (i,j) of positive integers such that 1<=i,j<=4, gcd(i,j)=1 and i is squarefree: (1,1), (2,1), (3,1), (1,2), (3,2), (1,3), (2,3), (1,4), (3,4). - _Geoffrey Critzer_, Jan 12 2015
%p F:= proc(n) local A,a;
%p A:= select(numtheory:-issqrfree, [$1..n]);
%p add(nops(select(y->igcd(a,y)=1, [$1..n])),a=A);
%p end proc:
%p seq(F(n),n=1..100); # _Robert Israel_, Jan 12 2015
%t Table[nn = n;Select[Level[Table[Table[{i, j}, {i, 1, nn}], {j, 1, nn}], {2}], Apply[GCD, #] == 1 && SquareFreeQ[#[[1]]] &] // Length, {n, 1, 54}] (* _Geoffrey Critzer_, Jan 12 2015 *)
%o (PARI) a(n)=my(s); forsquarefree(m=1,n, s+=sumdiv(m, d, n\d*moebius(d))); s \\ _Charles R Greathouse IV_, Jan 25 2018
%Y Cf. A005117, A065464, A118259, A118260.
%K nonn
%O 1,2
%A _Eric W. Weisstein_, Apr 20 2006