login
This site is supported by donations to The OEIS Foundation.

 

Logo

Many excellent designs for a new banner were submitted. We will use the best of them in rotation.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A010052 Characteristic function of squares: 1 if n is a square else 0. 111

%I

%S 1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,

%T 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,1,0,0,0,

%U 0,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

%N Characteristic function of squares: 1 if n is a square else 0.

%C G.f. A(x) satisfies 0=f(A(x),A(x^2),A(x^4)) where f(u,v,w)=(u-w)^2-(v-w)*(v+w-1) - _Michael Somos_, Jul 19 2004

%C Also parity of the divisor function A000005 if n >= 1. - _Omar E. Pol_, Jan 14 2012

%C This sequence can be considered as k=1 analog of A025426 (k=2), A025427 (k=3), A025428 (k=4); see also A000161. - _M. F. Hasler_, Jan 25 2013

%C Also, the decimal expansion of sum(n=0...oo) 1/(10^n)^n. - _Eric Desbiaux_, Mar 15 2009, rephrased and simplified by _M. F. Hasler_, Jan 26 2013

%D J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, pp. 3-4, also p. 166, Ex. 5.5.1.

%D T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, Problem 20.

%H Charles R Greathouse IV, <a href="/A010052/b010052.txt">Table of n, a(n) for n = 0..10000</a>

%H Y. Puri and T. Ward, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL4/WARD/short.html">Arithmetic and growth of periodic orbits</a>, J. Integer Seqs., Vol. 4 (2001), #01.2.1.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/JacobiThetaFunctions.html">Jacobi Theta Functions</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F a(n) = [sqrt(n)] - [sqrt(n-1)] (n>0).

%F a(n) = A000005(n) mod 2, n>0. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 19 2001

%F Dirichlet generating function: zeta(2s). - _Franklin T. Adams-Watters_, Sep 11 2005.

%F G.f. (theta_3(0,x) + 1)/2, where theta_3 is a Jacobi theta function. - _Franklin T. Adams-Watters_, Jun 19 2006

%F a(n) = f(n,0) with f(x,y) = if x>0 then f(x-2*y-1,y+1) else 0^(-x). [From _Reinhard Zumkeller_, Sep 26 2008]

%F For n>=1 a(n)=sumdiv(n,d,(-1)^bigomega(d)) [From _Benoit Cloitre_, Oct 25 2009]

%F a(n) <= A093709(n). [From _Reinhard Zumkeller_, Nov 14 2009]

%F a(A000290(n)) = 1; a(A000037(n)) = 0. - _Reinhard Zumkeller_, Jun 20 2011

%F a(n) = 0 ^ A053186(n). [_Reinhard Zumkeller_, Feb 12 2012]

%p readlib(issqr): f := i->if issqr(i) then 1 else 0; fi; [ seq(f(i),i=0..100) ];

%t lst = {}; Do[AppendTo[lst, 2*Sum[Floor[n/k] - Floor[(n - 1)/k], {k, Floor[Sqrt[n]]}] - DivisorSigma[0, n]], {n, 93}]; Prepend[lst, 1] (* _Eric Desbiaux_, Jan 29 2012 *)

%o (PARI) a(n)=issquare(n)

%o (PARI) a(n)=if(n<1,1,sumdiv(n,d,(-1)^bigomega(d))) [From _Benoit Cloitre_, Oct 25 2009]

%o (Haskell)

%o a010052 n = fromEnum $ a000196 n ^ 2 == n

%o -- _Reinhard Zumkeller_, Jan 26 2012, Feb 20 2011

%o a010052_list = concat (iterate (\xs -> xs ++ [0,0]) [1])

%o -- _Reinhard Zumkeller_, Apr 27 2012

%Y Cf. A008836.

%K nonn,nice,easy,mult

%O 0,1

%A _N. J. A. Sloane_.

%E More terms from _Franklin T. Adams-Watters_, Jun 19 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified April 23 19:18 EDT 2014. Contains 240946 sequences.