login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A227291
Characteristic function of squarefree numbers squared (A062503).
9
1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0
OFFSET
1,1
FORMULA
Dirichlet g.f.: zeta(2s)/zeta(4s) = prod[prime p: 1+p^(-2s) ], see A008966.
a(n) = A008966(A037213(n)), when assumed A008966(0) = 0. - Reinhard Zumkeller, Jul 07 2013
a(n) = A063524(sum(A225817(n,k)*A225817(n,A000005(n)+1-k): k=1..A000005(n))). - Reinhard Zumkeller, Aug 01 2013
Multiplicative with a(p^e) = 1 if e=2, a(p^e) = 0 if e=1 or e>2. - Antti Karttunen, Jul 28 2017
Sum_{k=1..n} a(k) ~ 6*sqrt(n) / Pi^2. - Vaclav Kotesovec, Feb 02 2019
a(n) = A225569(A225546(n)-1). - Peter Munn, Oct 31 2019
From Antti Karttunen, Jul 18 2022: (Start)
a(n) = A010052(n) * A008966(A000196(n)).
a(n) = Sum_{d|n} A008836(n/d) * A307430(d).
a(n) = Sum_{d|n} A007427(n/d) * A322327(d).
(End)
EXAMPLE
a(3) = 0 because 3 is not the square of a squarefree number.
a(4) = 1 because sqrt(4) = 2, a squarefree number.
MAPLE
A227291 := proc(n)
local pe;
if n = 0 then
1;
else
for pe in ifactors(n)[2] do
if op(2, pe) <> 2 then
return 0 ;
end if;
end do:
end if;
1 ;
end proc:
seq(A227291(n), n=1..100) ; # R. J. Mathar, Feb 07 2023
MATHEMATICA
Table[Abs[Sum[MoebiusMu[n/d], {d, Select[Divisors[n], SquareFreeQ[#] &]}]], {n, 1, 200}] (* Geoffrey Critzer, Mar 18 2015 *)
Module[{nn=120, len, sfr}, len=Ceiling[Sqrt[nn]]; While[!SquareFreeQ[len], len++]; sfr=(Select[Range[len], SquareFreeQ])^2; Table[If[MemberQ[ sfr, n], 1, 0], {n, nn}]] (* Harvey P. Dale, Nov 27 2024 *)
PROG
(PARI) a(n)=if(n<1, 0, direuler(p=2, n, 1+X^2)[n])
(PARI) A227291(n) = factorback(apply(e->(2==e), factor(n)[, 2])); \\ Antti Karttunen, Jul 14 2022
(PARI) A227291(n) = (issquare(n) && issquarefree(sqrtint(n))); \\ Antti Karttunen, Jul 14 2022
(Haskell)
a227291 n = fromEnum $ (sum $ zipWith (*) mds (reverse mds)) == 1
where mds = a225817_row n
-- Reinhard Zumkeller, Jul 30 2013, Jul 07 2013
(Scheme) (define (A227291 n) (if (= 1 n) n (* (if (= 2 (A067029 n)) 1 0) (A227291 (A028234 n))))) ;; Antti Karttunen, Jul 28 2017
KEYWORD
nonn,mult,easy
AUTHOR
Ralf Stephan, Jul 05 2013
STATUS
approved