login
A397085
a(n) = (-1)^(n-floor(sqrt(n))^2-1) if n is not a perfect square and 0 otherwise.
2
0, 0, 1, -1, 0, 1, -1, 1, -1, 0, 1, -1, 1, -1, 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1
OFFSET
0,1
COMMENTS
For n >= 1, if a(n) = -1 or a(n) = 0, then A161886(n) is odd; if a(n) = 1, then A161886(n) is even. Equivalently, a(n) is -1 or 0 precisely when n belongs to A133280, and a(n) = 1 precisely when n belongs to A195437.
REFERENCES
Ian Connell, Elementary Problem E1382, Amer. Math. Monthly, 66 (1959), no. 8, 724.
Ian Connell and Andrew Korsak, Solution to Elementary Problem E1382, Amer. Math. Monthly, 67 (1960), no. 4, 380.
D. E. Iannucci and D. Mills-Taylor, On Generalizing the Connell Sequence, Journal of Integer Sequences, Vol. 2 (1999), Article 99.1.7.
R. Redheffer, "Eine explizit loesbare Optimierungsaufgabe" (in German), in Numerische Methoden bei Optimierungsaufgaben, Band 3 (Tagung, Math. Forschungsinst., Oberwolfach, 1976), pp. 213-216, Internat. Ser. Numer. Math., Vol. 36, Birkhaeuser, Basel, 1977.
G. E. Stevens, A Connell-Like Sequence, Journal of Integer Sequences, Vol. 1 (1998), Article 98.1.4.
LINKS
Anthony Hernandez, The Redheffer Matrix Parity Problem, arXiv:2607.08962 [math.CO], 2026.
FORMULA
G.f.: Sum_{m>=1} x^(m^2+1) * (1 - x^(2*m)) / (1+x).
D.g.f. for |a(n)|: zeta(s) - zeta(2s).
EXAMPLE
For small values of n we have:
a(0) = 0 because 0 = 0^2 + 0.
a(1) = 0 because 1 = 1^2 + 0.
a(2) = 1 because 2 = 1^2 + 1 and (-1)^(1-1) = 1.
a(3) = -1 because 3 = 1^2 + 2 and (-1)^(2-1) = -1.
a(4) = 0 because 4 = 2^2 + 0.
a(5) = 1 because 5 = 2^2 + 1 and (-1)^(1-1) = 1.
MATHEMATICA
A397085[n_] := If[IntegerQ[#], 0, (-1)^(n - Floor[#]^2 - 1)] & [Sqrt[n]];
Array[A397085, 100, 0] (* Paolo Xausa, Jul 26 2026 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Tony Hernandez, Jun 20 2026
STATUS
approved