login
a(n) = #{(i,j): mu(i)*mu(j) = 1, 1<=i,j<=n}, where mu = A008683 (Moebius function).
3

%I #18 Aug 23 2024 20:55:48

%S 1,2,5,5,10,13,20,20,20,25,34,34,45,52,61,61,74,74,89,89,100,113,130,

%T 130,130,145,145,145,164,185,208,208,225,244,265,265,290,313,338,338,

%U 365,394,425,425,425,452,485,485,485,485,514,514,549,549,580,580,613

%N a(n) = #{(i,j): mu(i)*mu(j) = 1, 1<=i,j<=n}, where mu = A008683 (Moebius function).

%C A081238(n) + A081239(n) + a(n) = n^2;

%C a(n) = a(n-1) iff mu(n) = 0.

%H Alois P. Heinz, <a href="/A081240/b081240.txt">Table of n, a(n) for n = 1..10000</a> (first 520 terms from Reinhard Zumkeller)

%F a(n) = |Sum_{i=1..n} sqrt(mu(i))|^2. - _Enrique Pérez Herrero_, Jul 30 2012

%F a(n) = A070548(n)^2 + A070549(n)^2. - _Jason Yuen_, Aug 23 2024

%e n mu(n) ... n: 1 2 3 4 5 6 7 8

%e - ------ .... |---------------->

%e 1 .. +1 ..... | + - - 0 - + - 0

%e 2 .. -1 ..... | - + + 0 + - + 0

%e 3 .. -1 ..... | - + + 0 + - + 0

%e 4 ... 0 ..... | 0 0 0 0 0 0 0 0

%e 5 .. -1 ..... | - + + 0 + - + 0 a(8)=20, as there are

%e 6 .. +1 ..... | + - - 0 - + - 0 20 '+1's in the 8x8-square

%e 7 .. -1 ..... | - + + 0 + - + 0 (represented as '+')

%e 8 ... 0 ..... | 0 0 0 0 0 0 0 0.

%t Table[Abs[Sum[Sqrt[MoebiusMu[i]],{i,1,n}]]^2,{n,60}] (* _Enrique Pérez Herrero_, Jul 30 2012 *)

%o (Haskell)

%o a081240 n = length [() | u <- [1..n], v <- [1..n],

%o a008683 u * a008683 v == 1]

%o -- _Reinhard Zumkeller_, Aug 03 2012

%Y Cf. A008683, A070548, A070549.

%K nonn

%O 1,2

%A _Reinhard Zumkeller_, Mar 11 2003