OFFSET
0,1
COMMENTS
Characteristic function of A001481.
a(n) = 1 if A000161(n) > 0.
a(A022544(n)) = 0.
Multiplicative because A002654 is. - Andrew Howroyd, Aug 01 2018
For positive n, m = 2*a(n) + 1 is the smallest positive integer such that m * n is not a sum of two squares. - Peter Schorn, Dec 29 2023
LINKS
FORMULA
a(n) = min{1, A004018(n)}. - N. J. A. Sloane, Jan 11 2020
MATHEMATICA
Join[{1}, Table[If[SquaresR[2, n]>1, 1, 0], {n, 120}]] (* Harvey P. Dale, Aug 25 2017 *)
PROG
(PARI) a(n)=my(f=0); my(r=sqrtint(n)); forstep(i=r, 1, -1, if(issquare(n-i*i), f=1; break)); f
(PARI) a(n)=if(0==n, 1, (sumdiv(n, d, (d%4==1) - (d%4==3)) > 0)); \\ Andrew Howroyd, Aug 01 2018, the check for 0-argument added by Antti Karttunen, Apr 22 2022
(Python)
from sympy import factorint
def A229062(n): return int(all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n).items())) # Chai Wah Wu, Jun 28 2022
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Ralf Stephan, Sep 17 2013
STATUS
approved