OFFSET
1,1
COMMENTS
Encodes to 1,2,1,4,1,6,1,8,1,10,...: unsigned version of A009531. - Paul Barry, Oct 12 2005
Parity of inverse Moebius transform of Jacobsthal numbers J(k) less J(n). - Paul Barry, Oct 12 2005
LINKS
FORMULA
a(n) = 0 if n is square, 1 otherwise.
a(n) = 1 - A010052(n). - R. J. Mathar, Jul 04 2009
a(n) = floor(1+ceiling(sqrt(n))-floor(sqrt((n)))/2). - Wesley Ivan Hurt, Sep 27 2014
G.f.: (1+x)/(2-2*x) - (1/2)*theta_3(0,x) where theta_3 is a Jacobi theta function. - Robert Israel, Oct 02 2014
MAPLE
MATHEMATICA
Differences[Table[n - Ceiling[Sqrt[n]], {n, 105}]] (* Arkadiusz Wesolowski, Oct 30 2012 *)
Table[Floor[(1 + Ceiling[Sqrt[n]] - Floor[Sqrt[n]])/2], {n, 70}] (* Wesley Ivan Hurt, Sep 27 2014 *)
PROG
(Magma) [Floor((1 + Ceiling(Sqrt(n)) - Floor(Sqrt(n)))/2) : n in [1..100]]; // Wesley Ivan Hurt, Sep 27 2014
(Python)
from math import isqrt
def A049240(n): return int(isqrt(n)**2!=n) # Chai Wah Wu, Jun 14 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved