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-4 of 4 results.

A002324 Number of divisors of n == 1 (mod 3) minus number of divisors of n == 2 (mod 3).

Original entry on oeis.org

1, 0, 1, 1, 0, 0, 2, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 2, 0, 0, 2, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 1, 3, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 1, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 1, 2, 0, 0, 2, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 0, 2, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 1, 2, 0, 2, 2, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Coefficients of Dedekind zeta function for the quadratic number field of discriminant -3. See Formula section for the general expression. - N. J. A. Sloane, Mar 22 2022
Coefficients in expansion of Dirichlet series Product_p (1 - (Kronecker(m,p) + 1)*p^(-s) + Kronecker(m,p) * p^(-2s))^(-1) for m = -3.
(Number of points of norm n in hexagonal lattice) / 6, n>0.
The hexagonal lattice is the familiar 2-dimensional lattice (A_2) in which each point has 6 neighbors. This is sometimes called the triangular lattice.
The first occurrence of a(n) = 1, 2, 3, 4,... is at n= 1, 7, 49, 91, 2401, 637, ... as tabulated in A343771. - R. J. Mathar, Sep 21 2024

Examples

			G.f. = x + x^3 + x^4 + 2*x^7 + x^9 + x^12 + 2*x^13 + x^16 + 2*x^19 + 2*x^21 + ...
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 112, first display.
  • J. W. L. Glaisher, Table of the excess of the number of (3k+1)-divisors of a number over the number of (3k+2)-divisors, Messenger Math., 31 (1901), 64-72.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 7-10.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Dedekind zeta functions for imaginary quadratic number fields of discriminants -3, -4, -7, -8, -11, -15, -19, -20 are A002324, A002654, A035182, A002325, A035179, A035175, A035171, A035170, respectively.
Dedekind zeta functions for real quadratic number fields of discriminants 5, 8, 12, 13, 17, 21, 24, 28, 29, 33, 37, 40 are A035187, A035185, A035194, A035195, A035199, A035203, A035188, A035210, A035211, A035215, A035219, A035192, respectively.

Programs

  • Haskell
    a002324 n = a001817 n - a001822 n  -- Reinhard Zumkeller, Nov 26 2011
    
  • Maple
    A002324 := proc(n)
        local a,pe,p,e;
        a :=1 ;
        for pe in ifactors(n)[2] do
            p := op(1,pe) ;
            e := op(2,pe) ;
            if p = 3 then
                ;
            elif modp(p,3) = 1 then
                a := a*(e+1) ;
            else
                a := a*(1+(-1)^e)/2 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A002324(n),n=1..100) ; # R. J. Mathar, Sep 21 2024
  • Mathematica
    dn12[n_]:=Module[{dn=Divisors[n]},Count[dn,?(Mod[#,3]==1&)]-Count[ dn,?(Mod[#,3]==2&)]]; dn12/@Range[120]  (* Harvey P. Dale, Apr 26 2011 *)
    a[ n_] := If[ n < 1, 0, DivisorSum[ n, KroneckerSymbol[ -3, #] &]]; (* Michael Somos, Aug 24 2014 *)
    Table[DirichletConvolve[DirichletCharacter[3,2,m],1,m,n],{n,1,30}] (* Steven Foster Clark, May 29 2019 *)
    f[3, p_] := 1; f[p_, e_] := If[Mod[p, 3] == 1, e+1, (1+(-1)^e)/2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 17 2020 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum(k=1, n, x^k / (1 + x^k + x^(2*k)), x * O(x^n)), n))}; \\ Michael Somos
    
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, (d%3==1) - (d%3==2)))};
    
  • PARI
    {a(n) = local(A, p, e); if( n<1, 0, A = factor(n); prod(k=1, matsize(A)[1], if( p=A[k,1], e=A[k,2]; if( p==3, 1, if( p%3==1, e+1, !(e%2))))))}; \\ Michael Somos, May 20 2005
    
  • PARI
    {a(n) = if( n<1, 0, qfrep([2,1; 1,2], n, 1)[n] / 3)}; \\ Michael Somos, Jun 05 2005
    
  • PARI
    {a(n) = if( n<1, 0, direuler(p=2, n, 1 / (1 - X) / (1 - kronecker(-3, p)*X))[n])}; \\ Michael Somos, Jun 05 2005
    
  • PARI
    my(B=bnfinit(x^2+x+1)); vector(100,n,#bnfisintnorm(B,n)) \\ Joerg Arndt, Jun 01 2024
    
  • Python
    from math import prod
    from sympy import factorint
    def A002324(n): return prod(e+1 if p%3==1 else int(not e&1) for p, e in factorint(n).items() if p != 3) # Chai Wah Wu, Nov 17 2022

Formula

From N. J. A. Sloane, Mar 22 2022 (Start):
The Dedekind zeta function DZ_K(s) for a quadratic field K of discriminant D is as follows.
Here m is defined by K = Q(sqrt(m)) (so m=D/4 if D is a multiple of 4, otherwise m=D).
DZ_K(s) is the product of three terms:
(a) Product_{odd primes p | D} 1/(1-1/p^s)
(b) Product_{odd primes p such that (D|p) = -1} 1/(1-1/p^(2s))
(c) Product_{odd primes p such that (D|p) = 1} 1/(1-1/p^s)^2
and if m is
0,1,2,3,4,5,6,7 mod 8, the prime 2 is to be included in term
-,c,a,a,-,b,a,a, respectively.
For Maple (and PARI) implementations, see link. (End)
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = u^2 - 3*v^2 + 4*w^2 - 2*u*w + w - v. - Michael Somos, Jul 20 2004
Has a nice Dirichlet series expansion, see PARI line.
G.f.: Sum_{k>0} x^k/(1+x^k+x^(2*k)). - Vladeta Jovovic, Dec 16 2002
a(3*n + 2) = 0, a(3*n) = a(n), a(3*n + 1) = A033687(n). - Michael Somos, Apr 04 2003
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^3), A(x^6)) where f(u1, u2, u3, u6) = (u1 - u3)*(u3 - u6) - (u2 - u6)^2. - Michael Somos, May 20 2005
Multiplicative with a(3^e) = 1, a(p^e) = e+1 if p == 1 (mod 3), a(p^e) = (1+(-1)^e)/2 if p == 2 (mod 3). - Michael Somos, May 20 2005
G.f.: Sum_{k>0} x^(3*k - 2) / (1 - x^(3*k - 2)) - x^(3*k - 1) / (1 - x^(3*k - 1)). - Michael Somos, Nov 02 2005
G.f.: Sum_{n >= 1} q^(n^2)(1-q)(1-q^2)...(1-q^(n-1))/((1-q^(n+1))(1-q^(n+2))...(1-q^(2n))). - Jeremy Lovejoy, Jun 12 2009
a(n) = A001817(n) - A001822(n). - R. J. Mathar, Mar 31 2011
A004016(n) = 6*a(n) unless n=0.
Dirichlet g.f.: zeta(s)*L(chi_2(3),s), with chi_2(3) the nontrivial Dirichlet character modulo 3 (A102283). - Ralf Stephan, Mar 27 2015
From Andrey Zabolotskiy, May 07 2018: (Start)
a(n) = Sum_{ m: m^2|n } A000086(n/m^2).
a(A003136(m)) > 0, a(A034020(m)) = 0 for all m. (End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/(3*sqrt(3)) = 0.604599... (A073010). - Amiram Eldar, Oct 11 2022

Extensions

More terms from David Radcliffe
Somos D.g.f. replaced with correct version by Ralf Stephan, Mar 27 2015

A088534 Number of representations of n by the quadratic form x^2 + xy + y^2 with 0 <= x <= y.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0
Offset: 0

Views

Author

Benoit Cloitre, Nov 16 2003

Keywords

Comments

Also, apparently the number of 6-regular plane graphs with n vertices that have only trigonal faces and loops ("({1,3},6)-spheres" from the paper by Michel Deza and Mathieu Dutour Sikiric). - Andrey Zabolotskiy, Dec 22 2021

Examples

			From _M. F. Hasler_, Mar 05 2018: (Start)
a(0) = a(1) = 1 since 0 = 0^2 + 0*0 + 0^2 and 1 = 0^2 + 0*1 + 1^2.
a(2) = 0 since 2 cannot be written as x^2 + xy + y^2.
a(49) = 2 since 49 = 0^2 + 0*7 + 7^2 = 3^2 + 3*5 + 5^2. (End)
		

References

  • B. C. Berndt, "On a certain theta-function in a letter of Ramanujan from Fitzroy House", Ganita 43 (1992), 33-43.

Crossrefs

Cf. A118886 (indices of values > 1), A198772 (indices of 1's), A198773 (indices of 2's), A198774 (indices of 3's), A198775 (indices of 4's), A198799 (index of 1st term = n).
Cf. A215622.

Programs

  • Haskell
    a088534 n = length
       [(x,y) | y <- [0..a000196 n], x <- [0..y], x^2 + x*y + y^2 == n]
    a088534_list = map a088534 [0..]
    -- Reinhard Zumkeller, Oct 30 2011
    
  • Julia
    function A088534(n)
        n % 3 == 2 && return 0
        M = Int(round(2*sqrt(n/3)))
        count = 0
        for y in 0:M, x in 0:y
            n == x^2 + y^2 + x*y && (count += 1)
        end
        return count
    end
    A088534list(upto) = [A088534(n) for n in 0:upto]
    A088534list(104) |> println # Peter Luschny, Mar 17 2018
    
  • Mathematica
    a[n_] := Sum[Boole[i^2 + i*j + j^2 == n], {i, 0, n}, {j, 0, i}];
    Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Jun 20 2018 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,i,if(i^2+i*j+j^2-n,0,1)))
    
  • PARI
    A088534(n,d)=sum(x=0,sqrt(n\3),sum(y=max(x,sqrtint(n-x^2)\2),sqrtint(n-2*x^2),x^2+x*y+y^2==n&&(!d||!printf("%d",[x,y]))))\\ Set 2nd arg = 1 to print all decompositions, with 0 <= x <= y. - M. F. Hasler, Mar 05 2018
    
  • Python
    def A088534(n):
        c = 0
        for y in range(n+1):
            if y**2 > n:
                break
            for x in range(y+1):
                z = x*(x+y)+y**2
                if z > n:
                    break
                elif z == n:
                    c += 1
        return c # Chai Wah Wu, May 16 2022

Formula

a(A003136(n)) > 0; a(A034020(n)) = 0;
a(A118886(n)) > 1; a(A198772(n)) = 1;
a(A198773(n)) = 2; a(A198774(n)) = 3;
a(A198775(n)) = 4;
a(A198799(n)) = n and a(m) <> n for m < A198799(n). - Reinhard Zumkeller, Oct 30 2011, corrected by M. F. Hasler, Mar 05 2018
In the prime factorization of n, let S_1 be the set of distinct prime factors p_i for which p_i == 1 (mod 3), let S_2 be the set of distinct prime factors p_j for which p_j == 2 (mod 3), and let M be the exponent of 3. Then n = 3^M * (Product_{p_i in S_1} p_i ^ e_i) * (Product_{p_j in S_2} p_j ^ e_j), and the number of solutions for x^2 + xy + y^2 = n, 0 <= x <= y is floor((Product_{p_i in S_1} (e_i + 1) + 1) / 2) if all e_j are even and 0 otherwise. E.g. a(1729) = 4 since 1729 = 7^1*13^1*19^1 and floor(((1+1)*(1+1)*(1+1)+1)/2) = 4. - Seth A. Troisi, Jul 02 2020
a(n) = ceiling(A004016(n)/12) = (A002324(n) + A145377(n)) / 2. - Andrey Zabolotskiy, Dec 23 2021

Extensions

Edited by M. F. Hasler, Mar 05 2018

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

A157235 Number of primitive inequivalent oblique sublattices of hexagonal (triangular) lattice of index n (equivalence and symmetry of sublattices are determined using only parent lattice symmetries).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 1, 2, 1, 3, 2, 2, 2, 5, 2, 4, 3, 5, 3, 4, 4, 6, 5, 6, 4, 10, 4, 6, 6, 8, 6, 10, 5, 9, 7, 8, 6, 14, 6, 10, 10, 11, 7, 12, 8, 14, 10, 12, 8, 17, 10, 12, 11, 14, 9, 20, 9, 15, 14, 14, 12, 22, 10, 16, 14, 22, 11, 20, 11, 18, 18, 18
Offset: 1

Views

Author

N. J. A. Sloane, Feb 25 2009

Keywords

Crossrefs

Cf. A003051 (all sublattices), A003050 (all primitive sublattices), A154272 (primitive sublattices fully inheriting the parent lattice symmetry, inlcuding the orientation of the mirrors), A000086 (primitive rotation-symmetric sublattices, counting mirror images as distinct), A060594 (primitive mirror-symmetric sublattices), A145377 (all sublattices inheriting the parent lattice symmetry), A304182.

Formula

a(n) = A003050(n) - (A000086(n)-A154272(n))/2 - A060594(n). - Andrey Zabolotskiy, Mar 19 2021

Extensions

New name and a(1)=0 prepended by Andrey Zabolotskiy, May 09 2018
Terms a(31) and beyond from Andrey Zabolotskiy, Mar 19 2021
Showing 1-4 of 4 results.