cp's OEIS Frontend

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.

Showing 1-2 of 2 results.

A195198 Characteristic function of squares or three times squares.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0
Offset: 0

Views

Author

Michael Somos, Sep 11 2011

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
A214284 is a similar sequence except with five instead of three. - Michael Somos, Oct 22 2017

Examples

			G.f. = 1 + q + q^3 + q^4 + q^9 + q^12 + q^16 + q^25 + q^27 + q^36 + q^48 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := SeriesCoefficient[ Series[ (EllipticTheta[ 3, 0, q] + EllipticTheta[ 3, 0, q^3]) / 2, {q, 0, n}], {q, 0, n}];
    a[ n_] := If[ n < 0, 0, Boole[ OddQ [ Length @ Divisors @ n] || OddQ [ Length @ Divisors[3 n]]]];
    Table[If[AnyTrue[{Sqrt[n],Sqrt[3n]},IntegerQ],1,0],{n,0,110}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 22 2020 *)
  • PARI
    {a(n) = issquare(n) || issquare(3*n)};
    
  • PARI
    {a(n) = if( n<1, n==0, direuler( p=2, n, if( p==3, 1 + X, 1) / (1 - X^2))[n])};

Formula

Euler transform of period 12 sequence [1, -1, 1, 0, 0, -1, 0, 0, 1, -1, 1, -1, ...].
Expansion of psi(q^3) * f(-q^2, -q^10) / f(-q, -q^11) in powers of q where psi(), is a Ramanujan theta function and f(, ) is Ramanujan's general theta function.
Multiplicative with a(0) = a(3^e) = 1, a(p^e) = 1 if e even, 0 otherwise.
G.f.: (theta_3(q) + theta_3(q^3)) / 2 = 1 + (Sum_{k>0} x^(k^2) + x^(3*k^2)).
Dirichlet g.f.: zeta(2*s) * (1 + 3^-s).
a(n) = A145377(n) unless n=0. a(3*n + 2) = 0. a(2*n + 1) = A127692(n). a(3*n) = a(n). a(3*n + 1) = A089801(n).
Sum_{k=0..n} a(k) ~ (1+1/sqrt(3)) * sqrt(n). - Amiram Eldar, Sep 14 2023

A214293 a(n) = 1 if n is a square, -1 if n is five times a square.

Original entry on oeis.org

1, 0, 0, 1, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 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, -1, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Michael Somos, Jul 10 2012

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Examples

			G.f. = q + q^4 - q^5 + q^9 + q^16 - q^20 + q^25 + q^36 - q^45 + q^49 + q^64 + ...
		

Crossrefs

Programs

  • Magma
    Basis( ModularForms( Gamma1(20), 1/2), 65) [2]; /* Michael Somos, Jul 01 2014 */
  • Mathematica
    a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, q] - EllipticTheta[ 3, 0, q^5]) / 2,  {q, 0, n}];
    a[ n_] := If[ n < 0, 0, Boole[ OddQ [ Length @ Divisors @ n]] - Boole[ OddQ [ Length @ Divisors [5 n]]]];
  • PARI
    {a(n) = issquare(n) - issquare(5*n)};
    
  • PARI
    {a(n) = if( n<1, 0, direuler( p=2, n, if( p==5, 1 - X, 1) / (1 - X^2 ))[n])};
    

Formula

Expansion of (phi(q) - phi(q^5)) / 2 in powers of q where phi() is a Ramanujan theta function. - Michael Somos, Sep 24 2013
Expansion of q * f(q^3, q^7) * f(-q^4, -q^16) / f(-q^8, -q^12) in powers of q where f() is Ramanujan's two-variable theta function.
Expansion of q * f(x, x^9) * f(-q, -q^4) / f(-q^2, -q^3) in powers of q where f() is Ramanujan's two-variable theta function. - Michael Somos, Sep 24 2013
Euler transform of period 20 sequence [ 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, 1, 1, -1, 0, -1, 1, 0, 0, -1, ...].
Multiplicative with a(5^e) = (-1)^e, a(p^e) = 1 if e even, 0 otherwise.
G.f.: (theta_3(q) - theta_3(q^5)) / 2 = Sum_{k>0} x^(k^2) - x^(5*k^2).
Dirichlet g.f.: zeta(2*s) * (1 - 5^-s).
a(4*n + 2) = a(4*n + 3) = 0. a(4*n) = a(n). a(5*n) = -a(n).
a(4*n) = A214293(n). a(4*n+1) = A214960(n). - Michael Somos, Sep 24 2013
Sum_{k=1..n} a(k) ~ c*sqrt(n), where c = 1 - 1/sqrt(5) = 0.5527864... (A322159). - Amiram Eldar, Oct 24 2023
Showing 1-2 of 2 results.