OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..500
FORMULA
a(n) = a(n-1) iff mu(n) = 0.
EXAMPLE
n mu(n) n: 1 2 3 4 5 6 7 8
- ----- +----------------->
1 +1 | + - - 0 - + - 0
2 -1 | - + + 0 + - + 0
3 -1 | - + + 0 + - + 0
4 0 | 0 0 0 0 0 0 0 0
5 -1 | - + + 0 + - + 0 a(8)=16, as there are
6 +1 | + - - 0 - + - 0 16 '-1's in the 8 X 8 square
7 -1 | - + + 0 + - + 0 (represented as '-')
8 0 | 0 0 0 0 0 0 0 0
MAPLE
Nplus:= 0:
Nminus:=0:
for n from 1 to 100 do
v:= numtheory:-mobius(n);
if v = 1 then Nplus:= Nplus+1
elif v = -1 then Nminus:= Nminus+1
fi;
A[n]:= 2*Nplus*Nminus;
od:
seq(A[n], n=1..100); # Robert Israel, Jan 08 2018
MATHEMATICA
Nplus = Nminus = 0;
For[n = 1, n <= 100, n++, v = MoebiusMu[n];
If[v == 1, Nplus++,
If[v == -1, Nminus++]];
a[n] = 2 Nplus Nminus];
Array[a, 100] (* Jean-François Alcover, Dec 16 2021, after Robert Israel *)
PROG
(Haskell)
a081238 n = length [() | u <- [1..n], v <- [1..n],
a008683 u * a008683 v == -1]
-- Reinhard Zumkeller, Aug 03 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Mar 11 2003
STATUS
approved