This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A010052 #209 Aug 18 2025 23:36:18 %S A010052 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 A010052 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 A010052 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 A010052 Characteristic function of squares: a(n) = 1 if n is a square, otherwise 0. %C A010052 Also parity of the divisor function A000005 if n >= 1. - _Omar E. Pol_, Jan 14 2012 %C A010052 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 A010052 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 %C A010052 Run lengths of zeros gives A005843, the nonnegative even numbers. - _Jeremy Gardiner_, Jan 14 2018 %C A010052 Inverse Möbius transform of Liouville's lambda function (A008836), n >= 1. - _Wesley Ivan Hurt_, Jun 22 2024 %D A010052 Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, pp. 3-4, also p. 166, Ex. 5.5.1. %D A010052 Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, Problem 20. %D A010052 Richard Bellman, A Brief Introduction to Theta Functions, Dover, 2013 (11.14). %D A010052 Michael D. Hirschhorn, The Power of q, Springer, 2017. See phi(q) page 8. %D A010052 Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2. %D A010052 Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002, p. 55. %H A010052 Charles R Greathouse IV, <a href="/A010052/b010052.txt">Table of n, a(n) for n = 0..10000</a> %H A010052 David Christopher and Tamil Nadu, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Christopher/chris7.html">Partitions with Fixed Number of Sizes</a>, Journal of Integer Sequences, 15 (2015), Article 15.11.5. %H A010052 Robert Price, <a href="/A010052/a010052.txt">Comments on A010052 concerning Elementary Cellular Automata</a>, Jan 29 2016. %H A010052 Yash Puri and Thomas 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), Article 01.2.1. %H A010052 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ElementaryCellularAutomaton.html">Elementary Cellular Automaton</a>. %H A010052 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/JacobiThetaFunctions.html">Jacobi Theta Functions</a>. %H A010052 Stephen Wolfram, <a href="http://wolframscience.com/">A New Kind of Science</a>. %H A010052 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a> %H A010052 <a href="https://oeis.org/wiki/Index_to_Elementary_Cellular_Automata">Index to Elementary Cellular Automata</a>. %H A010052 <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>. %H A010052 <a href="/index/Ce#cell">Index entries for sequences related to cellular automata</a>. %F A010052 a(n) = floor(sqrt(n)) - floor(sqrt(n-1)), for n > 0. %F A010052 a(n) = A000005(n) mod 2, n > 0. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 19 2001 %F A010052 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 %F A010052 Dirichlet g.f.: zeta(2s). - _Franklin T. Adams-Watters_, Sep 11 2005 %F A010052 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.] %F A010052 a(n) = f(n,0) with f(x,y) = f(x-2*y-1,y+1) if x > 0, otherwise 0^(-x). - _Reinhard Zumkeller_, Sep 26 2008 %F A010052 a(n) = Sum_{d|n} (-1)^bigomega(d), for n >= 1. - _Benoit Cloitre_, Oct 25 2009 %F A010052 a(n) <= A093709(n). - _Reinhard Zumkeller_, Nov 14 2009 %F A010052 a(A000290(n)) = 1; a(A000037(n)) = 0. - _Reinhard Zumkeller_, Jun 20 2011 %F A010052 a(n) = 0 ^ A053186(n). - _Reinhard Zumkeller_, Feb 12 2012 %F A010052 a(n) = A063524(A007913(n)), for n > 0. - _Reinhard Zumkeller_, Jul 09 2014 %F A010052 a(n) = -(-1)^n * A258998(n) unless n = 0. 2 * a(n) = A000122(n) unless n = 0. - _Michael Somos_, Jun 16 2015 %F A010052 a(n) = A037011(A156552(n)), provided that A037011(n) = A000035(A106737(n)). [See A037011.] - _Antti Karttunen_, Nov 03 2017 %F A010052 a(n*m) = a(n/gcd(n,m))*a(m/gcd(n,m)) for all n and m > 0 (conjectured). - _Velin Yanev_, Feb 13 2019 [Proof from _Michael B. Porter_, Feb 16 2019: If nm is a square, nm = product_i (p_i^2), where p_i are prime, not necessarily distinct. Each p_i either appears twice in n, twice in m, or one time in each and therefore in the gcd. So n/gcd(n,m) and m/gcd(n,m) are both squares. If nm is not a square, there is a q_j that appears in one of n or m but not in the gcd. So either n/gcd(n,m) or m/gcd(n,m) is not a square.] %F A010052 a(n) = Sum_{d|n} A008836(d), n >= 1, a(0) = 1. - _Jinyuan Wang_, Apr 20 2019 %F A010052 G.f.: A(q) = Sum_{n >= 0} q^(2*n)*Product_{k >= 2*n+1} 1 - (-q)^k. - _Peter Bala_, Feb 22 2021 %F A010052 Multiplicative with a(p^e) = 1 if e is even, and 0 otherwise. - _Amiram Eldar_, Dec 29 2022 %F A010052 a(n) = Sum_{d|n} mobius(core(n)), where core(n) = A007913(n). - _Peter Bala_, Jan 24 2024 %e A010052 G.f. = 1 + x + x^4 + x^9 + x^16 + x^25 + x^36 + x^49 + x^64 + x^81 + ... %p A010052 readlib(issqr): f := i->if issqr(i) then 1 else 0; fi; [ seq(f(i),i=0..100) ]; %t A010052 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 *) %t A010052 Table[If[IntegerQ[Sqrt[n]],1,0],{n,0,100}] (* _Harvey P. Dale_, Jul 19 2014 *) %t A010052 a[n_] := SeriesCoefficient[1/(1 - q)* QHypergeometricPFQ[{-q, -q}, {-(q^2)}, -q, -q], {q, 0, Abs@n}] (* _Mats Granvik_, Jan 01 2016 *) %t A010052 Range[0, 120] /. {n_ /; IntegerQ@ Sqrt@ n -> 1, n_ /; n != 1 -> 0} (* _Michael De Vlieger_, Jan 02 2016 *) %t A010052 a[n_] := Sum[If[Mod[n, k] == 0, Re[Sqrt[LiouvilleLambda[k]]*Sqrt[LiouvilleLambda[n/k]]], 0], {k, 1, n}] (* _Mats Granvik_, Aug 10 2018 *) %o A010052 (PARI) {a(n) = issquare(n)}; %o A010052 (PARI) a(n)=if(n<1,1,sumdiv(n,d,(-1)^bigomega(d))) \\ _Benoit Cloitre_, Oct 25 2009 %o A010052 (PARI) a(n) = if (n<1, 1, direuler( p=2, n, 1/ (1 - X^2 ))[n]); \\ _Michel Marcus_, Mar 08 2015 %o A010052 (Haskell) %o A010052 a010052 n = fromEnum $ a000196 n ^ 2 == n %o A010052 -- _Reinhard Zumkeller_, Jan 26 2012, Feb 20 2011 %o A010052 a010052_list = concat (iterate (\xs -> xs ++ [0,0]) [1]) %o A010052 -- _Reinhard Zumkeller_, Apr 27 2012 %o A010052 (Scheme) (define (A010052 n) (if (zero? n) 1 (- (A000196 n) (A000196 (- n 1))))) ;; (For the definition of A000196, see under that entry). - _Antti Karttunen_, Nov 03 2017 %o A010052 (Python) %o A010052 def A010052(n): return int(math.isqrt(n)**2==n) ## appears to be faster than sympy.ntheory.primetest.is_square, up to 10^8 at least. %o A010052 # _M. F. Hasler_, Mar 21 2022 %Y A010052 Column k=1 of A243148, A337165, A341040 (for n>0). %Y A010052 Cf. A000005, A000122, A005369, A007913, A008836 (Mobius transf.), A037011, A063524, A258998, A271102 (Dirichlet inv), A046951 (inv. Mobius trans.). %Y A010052 First differences of A000196. %K A010052 nonn,nice,easy,mult %O A010052 0,1 %A A010052 _N. J. A. Sloane_ %E A010052 More terms from _Franklin T. Adams-Watters_, Jun 19 2006