A093709 Characteristic function of squares or twice squares.
1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 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, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0
Offset: 0
Examples
G.f. = 1 + q + q^2 + q^4 + q^8 + q^9 + q^16 + q^18 + q^25 + q^32 + q^36 + q^49 + ...
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- S. Cooper and M. Hirschhorn, On some infinite product identities, Rocky Mountain J. Math., 31 (2001) 131-139. see p. 133 Theorem 1.
- John S. Rutherford, Sublattice enumeration. IV. Equivalence classes of plane sublattices by parent Patterson symmetry and colour lattice group type, Acta Cryst. (2009). A65, 156-163. - From _N. J. A. Sloane_, Feb 23 2009
- Michael Somos, Introduction to Ramanujan theta functions
- Eric Weisstein's World of Mathematics, Ramanujan Theta Functions
- Index entries for characteristic functions
Programs
-
Magma
A := Basis( ModularForms( Gamma1(8), 1/2), 104); A[1] + A[2]; /* Michael Somos, Jan 01 2015 */
-
Maple
seq(`if`(issqr(n) or issqr(n/2),1,0), n=0..100); # Robert Israel, Apr 05 2016
-
Mathematica
Table[Boole[IntegerQ[Sqrt[n]] || IntegerQ[Sqrt[2*n]]], {n, 0, 104}] (* Jean-François Alcover, Dec 05 2013 *) a[ n_] := If[ n < 0, 0, Boole[ OddQ [ Length @ Divisors[ n]] || OddQ [ Length @ Divisors[ 2 n]]]]; (* Michael Somos, Jan 01 2015 *) a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, q] + EllipticTheta[ 3, 0, q^2]) / 2, {q, 0, n}]; (* Michael Somos, Jan 01 2015 *)
-
PARI
{a(n) = issquare(n) || issquare(2*n)};
Formula
Expansion of psi(q^4) * f(-q^3, -q^5) / f(-q, -q^7) in powers of q where psi(), f() are Ramanujan theta functions.
Expansion of f(-q^3, -q^5)^2 / psi(-q) in powers of q where psi(), f() are Ramanujan theta functions. - Michael Somos, Jan 01 2015
Euler transform of period 8 sequence [ 1, 0, -1, 1, -1, 0, 1, -1, ...].
G.f. A(x) satisfies A(x^2) = (A(x) + A(-x)) / 2. a(2*n) = a(n).
Given g.f. A(x), then A(x) / A(x^2) = 1 + x*A092869(x^2).
Given g.f. A(x), then B(x) = A(x^2) / A(x) satisfies 0 = f(B(x), B(x^2)) where f(u, v) = u^2 + v - 2(u + u^2)*v + 2*(u*v)^2.
Multiplicative with a(0) = a(2^e) = 1, a(p^e) = 1 if e even, 0 otherwise.
G.f.: (theta_3(q) + theta_3(q^2)) / 2 = 1 + (Sum_{k>0} x^(k^2) + x^(2*k^2)).
Dirichlet g.f.: zeta(2*s) * (1 + 2^-s).
a(n) = A000035(A000203(n)) = A000035(A000593(n)) = A000035(A001227(n)), if n>0. - Omar E. Pol, Apr 05 2016
Sum_{k=1..n} a(k) ~ (1 + 1/sqrt(2)) * sqrt(n). - Vaclav Kotesovec, Oct 16 2020
Comments