login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A379952
a(n) = 1 if n is an odd number or a perfect square, otherwise 0.
1
1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
OFFSET
0
MATHEMATICA
A379952[n_] := Boole[OddQ[n] || IntegerQ[Sqrt[n]]]; Array[A379952, 100, 0] (* Paolo Xausa, Jan 15 2025 *)
PROG
(PARI) A379952(n) = ((n%2) || issquare(n));
CROSSREFS
After the initial a(0)=1, the characteristic function of A128201, union of positive squares and the odd numbers.
Cf. also A323158.
Sequence in context: A249066 A176178 A267778 * A285384 A165728 A337966
KEYWORD
nonn,easy,changed
AUTHOR
Antti Karttunen, Jan 15 2025
STATUS
approved