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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A010052 Characteristic function of squares: 1 if n is a square else 0. 180
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

Also parity of the divisor function A000005 if n >= 1. - Omar E. Pol, Jan 14 2012

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

Also, the decimal expansion of sum(n >= 0) 1/(10^n)^n. -  Eric Desbiaux, Mar 15 2009, rephrased and simplified by M. F. Hasler, Jan 26 2013

REFERENCES

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

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

Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

LINKS

Charles R Greathouse IV, Table of n, a(n) for n = 0..10000

D. Christopher, T. Nadu, Partitions with Fixed Number of Sizes, Journal of Integer Sequences, 15 (2015), #15.11.5.

Robert Price, Comments on A010052 concerning Elementary Cellular Automata, Jan 29 2016

Y. Puri and T. Ward, Arithmetic and growth of periodic orbits, J. Integer Seqs., Vol. 4 (2001), #01.2.1.

Eric Weisstein's World of Mathematics, Jacobi Theta Functions

Eric Weisstein's World of Mathematics, Elementary Cellular Automaton

S. Wolfram, A New Kind of Science

Index entries for sequences related to cellular automata

Index entries for characteristic functions

Index to Elementary Cellular Automata

FORMULA

a(n) = floor(sqrt(n)) - floor(sqrt(n-1)), for n > 0.

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

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

Dirichlet g.f.: zeta(2s). - Franklin T. Adams-Watters, Sep 11 2005

G.f. (theta_3(0,x) + 1)/2, where theta_3 is a Jacobi theta function. - Franklin T. Adams-Watters, Jun 19 2006. See A000122 for theta_3.

a(n) = f(n,0) with f(x,y) = if x>0 then f(x-2*y-1,y+1) else 0^(-x). - Reinhard Zumkeller, Sep 26 2008

a(n) = sumdiv(n,d,(-1)^bigomega(d)), for n >= 1. - Benoit Cloitre, Oct 25 2009

a(n) <= A093709(n). - Reinhard Zumkeller, Nov 14 2009

a(A000290(n)) = 1; a(A000037(n)) = 0. - Reinhard Zumkeller, Jun 20 2011

a(n) = 0 ^ A053186(n). - Reinhard Zumkeller, Feb 12 2012

a(n) = A063524(A007913(n)), for n > 0. - Reinhard Zumkeller, Jul 09 2014

a(n) = -(-1)^n * A258998(n) unless n = 0. 2 * a(n) = A000122(n) unless n = 0. - Michael Somos, Jun 16 2015

EXAMPLE

G.f. = 1 + x + x^4 + x^9 + x^16 + x^25 + x^36 + x^49 + x^64 + x^81 + ...

MAPLE

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

MATHEMATICA

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 *)

Table[If[IntegerQ[Sqrt[n]], 1, 0], {n, 0, 100}] (* Harvey P. Dale, Jul 19 2014 *)

a[n_] := SeriesCoefficient[1/(1 - q)* QHypergeometricPFQ[{-q, -q}, {-(q^2)}, -q, -q], {q, 0, Abs@n}] (* Mats Granvik, Jan 01 2016 *)

Range[0, 120] /. {n_ /; IntegerQ@ Sqrt@ n -> 1, n_ /; n != 1 -> 0} (* Michael De Vlieger, Jan 02 2016 *)

PROG

(PARI) {a(n) = issquare(n)};

(PARI) a(n)=if(n<1, 1, sumdiv(n, d, (-1)^bigomega(d))) \\ Benoit Cloitre, Oct 25 2009

(PARI) a(n) = if (n<1, 1, direuler( p=2, n, 1/ (1 - X^2 ))[n]); \\ Michel Marcus, Mar 08 2015

(Haskell)

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

-- Reinhard Zumkeller, Jan 26 2012, Feb 20 2011

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

-- Reinhard Zumkeller, Apr 27 2012

CROSSREFS

Cf. A008836.

Column k=1 of A243148.

Cf. A005369.

Cf. A063524, A007913.

Cf. A000122, A258998.

Sequence in context: A127692 A014305 A023533 * A039985 A127239 A129186

Adjacent sequences:  A010049 A010050 A010051 * A010053 A010054 A010055

KEYWORD

nonn,nice,easy,mult

AUTHOR

N. J. A. Sloane

EXTENSIONS

More terms from Franklin T. Adams-Watters, Jun 19 2006

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified February 25 21:48 EST 2017. Contains 282654 sequences.