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-10 of 31 results. Next

A002654 Number of ways of writing n as a sum of at most two nonzero squares, where order matters; also (number of divisors of n of form 4m+1) - (number of divisors of form 4m+3).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Glaisher calls this E(n) or E_0(n). - N. J. A. Sloane, Nov 24 2018
Number of sublattices of Z X Z of index n that are similar to Z X Z; number of (principal) ideals of Z[i] of norm n.
a(n) is also one fourth of the number of integer solutions of n = x^2 + y^2 (order and signs matter, and 0 (without signs) is allowed). a(n) = N(n)/4, with N(n) from p. 147 of the Niven-Zuckermann reference. See also Theorem 5.12, p. 150, which defines a (strongly) multiplicative function h(n) which coincides with A056594(n-1), n >= 1, and N(n)/4 = sum(h(d), d divides n). - Wolfdieter Lang, Apr 19 2013
a(2+8*N) = A008441(N) gives the number of ways of writing N as the sum of 2 (nonnegative) triangular numbers for N >= 0. - Wolfdieter Lang, Jan 12 2017
Coefficients of Dedekind zeta function for the quadratic number field of discriminant -4. See A002324 for formula and Maple code. - N. J. A. Sloane, Mar 22 2022

Examples

			4 = 2^2, so a(4) = 1; 5 = 1^2 + 2^2 = 2^2 + 1^2, so a(5) = 2.
x + x^2 + x^4 + 2*x^5 + x^8 + x^9 + 2*x^10 + 2*x^13 + x^16 + 2*x^17 + x^18 + ...
2 = (+1)^2 + (+1)^2 = (+1)^2 + (-1)^2  = (-1)^2 + (+1)^2 = (-1)^2 + (-1)^2. Hence there are 4 integer solutions, called N(2) in the Niven-Zuckerman reference, and a(2) = N(2)/4 = 1.  4 = 0^1 + (+2)^2 = (+2)^2 + 0^2 = 0^2 + (-2)^2 = (-2)^2 + 0^2. Hence N(4) = 4 and a(4) = N(4)/4 = 1. N(5) = 8, a(5) = 2. - _Wolfdieter Lang_, Apr 19 2013
		

References

  • J. M. Borwein, D. H. Bailey and R. Girgensohn, Experimentation in Mathematics, A K Peters, Ltd., Natick, MA, 2004. x+357 pp. See p. 194.
  • George Chrystal, Algebra: An elementary text-book for the higher classes of secondary schools and for colleges, 6th ed., Chelsea Publishing Co., New York, 1959, Part II, p. 346 Exercise XXI(17). MR0121327 (22 #12066)
  • Emil Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 15.
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers, New York: John Wiley, 1980, pp. 147 and 150.
  • Günter Scheja and Uwe Storch, Lehrbuch der Algebra, Tuebner, 1988, p. 251.
  • 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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 89.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 340.

Crossrefs

Equals 1/4 of A004018. Partial sums give A014200.
Cf. A002175, A008441, A121444, A122856, A122865, A022544, A143574, A000265, A027748, A124010, A025426 (two squares, order does not matter), A120630 (Dirichlet inverse), A101455 (Mobius transform), A000089, A241011.
If one simply reads the table in Glaisher, PLMS 1884, which omits the zero entries, one gets A213408.
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
    a002654 n = product $ zipWith f (a027748_row m) (a124010_row m) where
       f p e | p `mod` 4 == 1 = e + 1
             | otherwise      = (e + 1) `mod` 2
       m = a000265 n
    -- Reinhard Zumkeller, Mar 18 2013
    
  • Maple
    with(numtheory):
    A002654 := proc(n)
        local count1, count3, d;
        count1 := 0:
        count3 := 0:
        for d in numtheory[divisors](n) do
            if d mod 4 = 1 then
                count1 := count1+1
            elif d mod 4 = 3 then
                count3 := count3+1
            fi:
        end do:
        count1-count3;
    end proc:
    # second Maple program:
    a:= n-> add(`if`(d::odd, (-1)^((d-1)/2), 0), d=numtheory[divisors](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 04 2020
  • Mathematica
    a[n_] := Count[Divisors[n], d_ /; Mod[d, 4] == 1] - Count[Divisors[n], d_ /; Mod[d, 4] == 3]; a/@Range[105] (* Jean-François Alcover, Apr 06 2011, after R. J. Mathar *)
    QP = QPochhammer; CoefficientList[(1/q)*(QP[q^2]^10/(QP[q]*QP[q^4])^4-1)/4 + O[q]^100, q] (* Jean-François Alcover, Nov 24 2015 *)
    f[2, e_] := 1; f[p_, e_] := If[Mod[p, 4] == 1, e + 1, Mod[e + 1, 2]]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 19 2020 *)
    Rest[CoefficientList[Series[EllipticTheta[3, 0, q]^2/4, {q, 0, 100}], q]] (* Vaclav Kotesovec, Mar 10 2023 *)
  • PARI
    direuler(p=2,101,1/(1-X)/(1-kronecker(-4,p)*X))
    
  • PARI
    {a(n) = polcoeff( sum(k=1, n, x^k / (1 + x^(2*k)), x * O(x^n)), n)}
    
  • PARI
    {a(n) = sumdiv( n, d, (d%4==1) - (d%4==3))}
    
  • PARI
    {a(n) = local(A); A = x * O(x^n); polcoeff( eta(x^2 + A)^10 / (eta(x + A) * eta(x^4 + A))^4 / 4, n)} \\ Michael Somos, Jun 03 2005
    
  • PARI
    a(n)=my(f=factor(n>>valuation(n,2))); prod(i=1,#f~, if(f[i,1]%4==1, f[i,2]+1, (f[i,2]+1)%2)) \\ Charles R Greathouse IV, Sep 09 2014
    
  • PARI
    my(B=bnfinit(x^2+1)); vector(100,n,#bnfisintnorm(B,n)) \\ Joerg Arndt, Jun 01 2024
    
  • Python
    from math import prod
    from sympy import factorint
    def A002654(n): return prod(1 if p == 2 else (e+1 if p % 4 == 1 else (e+1) % 2) for p, e in factorint(n).items()) # Chai Wah Wu, May 09 2022

Formula

Dirichlet series: (1-2^(-s))^(-1)*Product (1-p^(-s))^(-2) (p=1 mod 4) * Product (1-p^(-2s))^(-1) (p=3 mod 4) = Dedekind zeta-function of Z[ i ].
Coefficients in expansion of Dirichlet series Product_p (1-(Kronecker(m, p)+1)*p^(-s)+Kronecker(m, p)*p^(-2s))^(-1) for m = -16.
If n=2^k*u*v, where u is product of primes 4m+1, v is product of primes 4m+3, then a(n)=0 unless v is a square, in which case a(n) = number of divisors of u (Jacobi).
Multiplicative with a(p^e) = 1 if p = 2; e+1 if p == 1 (mod 4); (e+1) mod 2 if p == 3 (mod 4). - David W. Wilson, Sep 01 2001
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = (u - v)^2 - (v - w) * (4*w + 1). - Michael Somos, Jul 19 2004
G.f.: Sum_{n>=1} ((-1)^floor(n/2)*x^((n^2+n)/2)/(1+(-x)^n)). - Vladeta Jovovic, Sep 15 2004
Expansion of (eta(q^2)^10 / (eta(q) * eta(q^4))^4 - 1)/4 in powers of q.
G.f.: Sum_{k>0} x^k / (1 + x^(2*k)) = Sum_{k>0} -(-1)^k * x^(2*k - 1) / (1 - x^(2*k - 1)). - Michael Somos, Aug 17 2005
a(4*n + 3) = a(9*n + 3) = a(9*n + 6) = 0. a(9*n) = a(2*n) = a(n). - Michael Somos, Nov 01 2006
a(4*n + 1) = A008441(n). a(3*n + 1) = A122865(n). a(3*n + 2) = A122856(n). a(12*n + 1) = A002175(n). a(12*n + 5) = 2 * A121444(n). 4 * a(n) = A004018(n) unless n=0.
a(n) = Sum_{k=1..n} A010052(k)*A010052(n-k). a(A022544(n)) = 0; a(A001481(n)) > 0.
- Reinhard Zumkeller, Sep 27 2008
a(n) = A001826(n) - A001842(n). - R. J. Mathar, Mar 23 2011
a(n) = Sum_{d|n} A056594(d-1), n >= 1. See the above comment on A056594(d-1) = h(d) of the Niven-Zuckerman reference. - Wolfdieter Lang, Apr 19 2013
Dirichlet g.f.: zeta(s)*beta(s) = zeta(s)*L(chi_2(4),s). - Ralf Stephan, Mar 27 2015
G.f.: (theta_3(x)^2 - 1)/4, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 17 2018
a(n) = Sum_{ m: m^2|n } A000089(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = A053866(n) + 2 * A025441(n). - Andrey Zabolotskiy, Apr 23 2019
a(n) = Im(Sum_{d|n} i^d). - Ridouane Oudra, Feb 02 2020
a(n) = Sum_{d|n} sin((1/2)*d*Pi). - Ridouane Oudra, Jan 22 2021
Sum_{n>=1} (-1)^n*a(n)/n = Pi*log(2)/4 (Covo, 2010). - Amiram Eldar, Apr 07 2022
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/4 = 0.785398... (A003881). - Amiram Eldar, Oct 11 2022
From Vaclav Kotesovec, Mar 10 2023: (Start)
Sum_{k=1..n} a(k)^2 ~ n * (log(n) + C) / 4, where C = A241011 =
4*gamma - 1 + log(2)/3 - 2*log(Pi) + 8*log(Gamma(3/4)) - 12*Zeta'(2)/Pi^2 = 2.01662154573340811526279685971511542645018417752364748061...
The constant C, published by Ramanujan (1916, formula (22)), 4*gamma - 1 + log(2)/3 - log(Pi) + 4*log(Gamma(3/4)) - 12*Zeta'(2)/Pi^2 = 2.3482276258576... is wrong! (End)

A000086 Number of solutions to x^2 - x + 1 == 0 (mod n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of elliptic points of order 3 for Gamma_0(n).
Equivalently, number of fixed points of Gamma_0(n) of type rho.
Values are 0 or a power of 2.
Shadow transform of central polygonal numbers A002061. - Michel Marcus, Jun 06 2013
Empirical: a(n) == A001615(n) (mod 3) for all natural numbers n. - John M. Campbell, Apr 01 2018
From Jianing Song, Jul 03 2018: (Start)
The comment above is true. Since both a(n) and A001615(n) are multiplicative we just have to verify that for prime powers. Note that A001615(p^e) = (p+1)*p^(e-1). For p == 1 (mod 3), p+1 == 2 (mod 3) so (p+1)*p^(e-1) == 2 (mod 3); for p == 2 (mod 3), p+1 is a multiple of 3 so (p+1)*p^(e-1) == 0 (mod 3). For p = 3, if e = 1 then p+1 == 1 (mod 3); if e > 1 then (p+1)*p^(e-1) == 0 (mod 3).
Equivalently, number of solutions to x^2 + x + 1 == 0 (mod n). (End)

Examples

			G.f. = x + x^3 + 2*x^7 + 2*x^13 + 2*x^19 + 2*x^21 + 2*x^31 + 2*x^37 + 2*x^39 + ...
		

References

  • Bruno Schoeneberg, Elliptic Modular Functions, Springer-Verlag, NY, 1974, p. 101.
  • Goro Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see p. 25, Eq. (3).

Crossrefs

Cf. A341422 (without zeros).

Programs

  • Haskell
    a000086 n = if n `mod` 9 == 0 then 0
      else product $ map ((* 2) . a079978 . (+ 2)) $ a027748_row $ a038502 n
    -- Reinhard Zumkeller, Jun 23 2013
  • Maple
    with(numtheory); A000086 := proc (n) local d, s; if modp(n,9) = 0 then RETURN(0) fi; s := 1; for d in divisors(n) do if isprime(d) then s := s*(1+eval(legendre(-3,d))) fi od; s end: # Gene Ward Smith, May 22 2006
  • Mathematica
    Array[ Function[ n, If[ EvenQ[ n ] || Mod[ n, 9 ]==0, 0, Count[ Array[ Mod[ #^2-#+1, n ]&, n, 0 ], 0 ] ] ], 84 ]
    a[ n_] := If[ n < 1, 0, Length[ Select[ (#^2 - # + 1)/n & /@ Range[n], IntegerQ]]]; (* Michael Somos, Aug 14 2015 *)
    a[n_] := a[n] = Product[{p, e} = pe; Which[p==1 || p==3 && e==1, 1, p==3 && e>1, 0, Mod[p, 3]==1, 2, Mod[p, 3]==2, 0, True, a[p^e]], {pe, FactorInteger[n]}]; Array[a, 105] (* Jean-François Alcover, Oct 18 2018 *)
  • PARI
    {a(n) = if( n<1, 0, sum( x=0, n-1, (x^2 - x + 1)%n==0))}; \\ Nov 15 2002
    
  • PARI
    {a(n) = if( n<1, 0, direuler( p=2, n, if( p==3, 1 + X, if( p%3==2, 1, (1 + X) / (1 - X)))) [n])}; \\ Nov 15 2002
    

Formula

Multiplicative with a(p^e) = 1 if p = 3 and e = 1; 0 if p = 3 and e > 1; 2 if p == 1 (mod 3); 0 if p == 2 (mod 3). - David W. Wilson, Aug 01 2001
a(A226946(n)) = 0; a(A034017(n)) > 0. - Reinhard Zumkeller, Jun 23 2013
a(2*n) = a(3*n + 2) = a(9*n) = a(9*n + 6) = 0. - Michael Somos, Aug 14 2015
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2*sqrt(3)/(3*Pi) = 0.367552... (A165952). - Amiram Eldar, Oct 11 2022

A091401 Numbers n such that genus of group Gamma_0(n) is zero.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 16, 18, 25
Offset: 1

Views

Author

N. J. A. Sloane, Mar 02 2004

Keywords

Comments

Equivalently, numbers n such that genus of modular curve X_0(n) is zero.

References

  • G. Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see Prop. 1.40 and 1.43.

Crossrefs

The table below is a consequence of Theorem 7.3 in Maier's paper.
N EntryID K alpha
1
2 A127776 4096 1
3 A276018 729 1
4 A002894 256 1
5 A276019 125 4
6 A093388 72 1
7 A276021 49 9
8 A081085 32 1
9 A006077 27 1
10 A276020 20 2
12 A276022 12 1
13 A276177 13 36
16 A276178 8 1
18 A276179 6 1
25 A276180 5 4

Programs

Formula

Numbers n such that A001617(n) = 0.

A001617 Genus of modular group Gamma_0(n). Or, genus of modular curve X_0(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 2, 1, 0, 2, 1, 2, 2, 3, 2, 1, 3, 3, 3, 1, 2, 4, 3, 3, 3, 5, 3, 4, 3, 5, 4, 3, 1, 2, 5, 5, 4, 4, 5, 5, 5, 6, 5, 7, 4, 7, 5, 3, 5, 9, 5, 7, 7, 9, 6, 5, 5, 8, 5, 8, 7, 11, 6, 7, 4, 9, 7, 11, 7, 10, 9, 9, 7, 11, 7, 10, 9, 11, 9, 9, 7, 7, 9, 7, 8, 15
Offset: 1

Views

Author

Keywords

Comments

Also the dimension of the space of cusp forms of weight two and level n. - Gene Ward Smith, May 23 2006

Examples

			G.f. = x^11 + x^14 + x^15 + x^17 + x^19 + x^20 + x^21 + 2*x^22 + 2*x^23 + ...
		

References

  • B. Schoeneberg, Elliptic Modular Functions, Springer-Verlag, NY, 1974, p. 103.
  • 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

Programs

  • Magma
    a := func< n | n lt 1 select 0 else Dimension( CuspForms( Gamma0(n), 2))>; /* Michael Somos, May 08 2015 */
    
  • Maple
    nu2 := proc (n) # number of elliptic points of order two (A000089) local i, s; if modp(n,4) = 0 then RETURN(0) fi; s := 1; for i in divisors(n) do if isprime(i) and i > 2 then s := s*(1+eval(legendre(-1,i))) fi od; s end:
    nu3 := proc (n) # number of elliptic points of order three (A000086) local d, s; if modp(n,9) = 0 then RETURN(0) fi; s := 1; for d in divisors(n) do if isprime(d) then s := s*(1+eval(legendre(-3,d))) fi od; s end:
    nupara := proc (n) # number of parabolic cusps (A001616) local b, d; b := 0; for d to n do if modp(n,d) = 0 then b := b+eval(phi(gcd(d,n/d))) fi od; b end:
    A001615 := proc(n) local i,j; j := n; for i in divisors(n) do if isprime(i) then j := j*(1+1/i); fi; od; j; end;
    genx := proc (n) # genus of X0(n) (A001617) #1+1/12*psi(n)-1/4*nu2(n)-1/3*nu3(n)-1/2*nupara(n) end: 1+1/12*A001615(n)-1/4*nu2(n)-1/3*nu3(n)-1/2*nupara(n) end: # Gene Ward Smith, May 23 2006
  • Mathematica
    nu2[n_] := Module[{i, s}, If[Mod[n, 4] == 0, Return[0]]; s = 1; Do[ If[ PrimeQ[i] && i > 2, s = s*(1 + JacobiSymbol[-1, i])], {i, Divisors[n]}]; s];
    nu3[n_] := Module[{d, s}, If[Mod[n, 9] == 0, Return[0]]; s = 1; Do[ If[ PrimeQ[d], s = s*(1 + JacobiSymbol[-3, d])], {d, Divisors[n]}]; s];
    nupara[n_] := Module[{b, d}, b = 0; For[d = 1, d <= n, d++, If[ Mod[n, d] == 0, b = b + EulerPhi[ GCD[d, n/d]]]]; b];
    A001615[n_] := Module[{i, j}, j = n; Do[ If[ PrimeQ[i], j = j*(1 + 1/i)], {i, Divisors[n]}]; j];
    genx[n_] := 1 + (1/12)*A001615[n] - (1/4)*nu2[n] - (1/3)*nu3[n] - (1/2)*nupara[n];
    A001617 = Table[ genx[n], {n, 1, 102}] (* Jean-François Alcover, Jan 04 2012, after Gene Ward Smith's Maple program *)
    a[ n_] := If[ n < 1, 0, 1 + Sum[ MoebiusMu[ d]^2 n/d / 12 - EulerPhi[ GCD[ d, n/d]] / 2, {d, Divisors @n}] - Count[(#^2 - # + 1)/n & /@ Range[n], ?IntegerQ]/3 - Count[ (#^2 + 1)/n & /@ Range[n], ?IntegerQ]/4]; (* Michael Somos, May 08 2015 *)
  • PARI
    A000089(n) = {
      if (n%4 == 0 || n%4 == 3, return(0));
      if (n%2 == 0, n \= 2);
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, if (f[k,1] % 4 == 3, 0, 2));
    };
    A000086(n) = {
      if (n%9 == 0 || n%3 == 2, return(0));
      if (n%3 == 0, n \= 3);
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, if (f[k,1] % 3 == 2, 0, 2));
    };
    A001615(n) = {
      my(f = factor(n), fsz = matsize(f)[1],
         g = prod(k=1, fsz, (f[k,1]+1)),
         h = prod(k=1, fsz, f[k,1]));
      return((n*g)\h);
    };
    A001616(n) = {
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, f[k,1]^(f[k,2]\2) + f[k,1]^((f[k,2]-1)\2));
    };
    a(n) = 1 + A001615(n)/12 - A000089(n)/4 - A000086(n)/3 - A001616(n)/2;
    vector(102, n, a(n))  \\ Gheorghe Coserea, May 20 2016

Formula

a(n) = 1 + A001615(n)/12 - A000089(n)/4 - A000086(n)/3 - A001616(n)/2.
From Gheorghe Coserea, May 20 2016: (Start)
limsup a(n) / (n*log(log(n))) = exp(Euler)/(2*Pi^2), where Euler is A001620.
a(n) >= (n-5*sqrt(n)-8)/12, with equality iff n = p^2 for prime p=1 (mod 12) (see A068228).
a(n) < n * exp(Euler)/(2*Pi^2) * (log(log(n)) + 2/log(log(n))) for n>=3 (see Csirik link).
(End)

A006278 a(n) is the product of the first n primes congruent to 1 (mod 4).

Original entry on oeis.org

5, 65, 1105, 32045, 1185665, 48612265, 2576450045, 157163452745, 11472932050385, 1021090952484265, 99045822390973705, 10003628061488344205, 1090395458702229518345, 123214686833351935572985
Offset: 1

Views

Author

Gene_Salamin(AT)cohr.com

Keywords

Comments

a(n)+2 is prime for n=1,2. No others are prime for n <= 200. Compare A002110 and A078586. - T. D. Noe, Dec 01 2002
Also, a(n) is least hypotenuse of exactly A003462(n) Pythagorean triangles of which 2^(n-1) are primitive. - Lekraj Beedassy, Dec 06 2003
Also, a(n) are the record setting values of m, for the number of solutions to "m*k-1 is a square", for some k, 1 <= k < m. There is one solution for m=2, and for a given m = a(n) there are 2^n solutions. For a given m there also 2^(n-1) solutions for primitively representing m as x^2 + y^2. See A008782. Also compare with A102476, which applies to "m*k+1 is a square". - Richard R. Forberg, Mar 18 2016
a(n) is the smallest m such that A000089(m) = 2^n. Also, numbers k for which A000089(k) sets a new record. - Jianing Song, Apr 27 2019

Crossrefs

Programs

  • Mathematica
    maxN=15; pLst={}; k=0; While[Length[pLst]Harvey P. Dale, Jun 16 2013 *)
  • PARI
    tree(v)=my(t=#v); if(t<4, factorback(v), tree(v[1..t\2])*tree(v[t\2+1..t]));
    a(n,x=9*n\4+2)=my(P=select(p->p%4==1, primes(x))); if(#PCharles R Greathouse IV, Jan 08 2018

Formula

a(n) = Product_{i=1..n} A002144(i). - Alois P. Heinz, Mar 01 2021

A304182 Number of primitive inequivalent mirror-symmetric sublattices of rectangular lattice of index n.

Original entry on oeis.org

1, 3, 2, 4, 2, 6, 2, 4, 2, 6, 2, 8, 2, 6, 4, 4, 2, 6, 2, 8, 4, 6, 2, 8, 2, 6, 2, 8, 2, 12, 2, 4, 4, 6, 4, 8, 2, 6, 4, 8, 2, 12, 2, 8, 4, 6, 2, 8, 2, 6, 4, 8, 2, 6, 4, 8, 4, 6, 2, 16, 2, 6, 4, 4, 4, 12, 2, 8, 4, 12, 2, 8, 2, 6, 4, 8, 4, 12, 2, 8, 2, 6, 2, 16, 4
Offset: 1

Views

Author

Andrey Zabolotskiy, May 07 2018

Keywords

Examples

			There are 6 = A001615(4) lattices in Z^2 whose quotient group is C_4. The reflection through an axis relates <(4,0), (1,1)> and <(4,0), (3,1)>. The remaining 4 = a(4) lattices are fixed.
		

Crossrefs

Cf. A069735 (not only primitive sublattices), A304183 (primitive oblique sublattices), A069734 (all sublattices).
Cf. other columns of tables 4 and 5 from [Rutherford, 2009]: A001615, A060594, A157223, A000089, A157224, A000086, A157227, A019590, A157228, A157226, A157230, A157231, A154272, A157235.

Programs

  • Mathematica
    f[p_, e_] := If[p == 2, If[e == 1, 3, 4], 2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 22 2022 *)

Formula

From Álvar Ibeas, Mar 18 2021: (Start)
For n odd, a(n) = A034444(n) = 2^(A001221(n)).
For n even, a(n) = A034444(n) + A034444(n/2). If 4|n, a(n) = 2^(A001221(n) + 1); otherwise, a(n) = 3 * 2^(A001221(n) - 1).
Multiplicative with a(2) = 3, a(2^e) = 4 (for e>1), and a(p^e) = 2 (for p>2).
Dirichlet g.f.: (1+2^(-s)) * zeta(s)^2 / zeta(2s).
(End)
Sum_{k=1..n} a(k) ~ (log(n) + 2*gamma - log(2)/3 - 2*zeta'(2)/zeta(2) - 1)*9*n/Pi^2, where gamma is Euler's constant (A001620). - Amiram Eldar, Dec 31 2022

A145392 Number of inequivalent sublattices of index n in square lattice, where two sublattices are considered equivalent if one can be rotated by a multiple of Pi/2 to give the other.

Original entry on oeis.org

1, 2, 2, 4, 4, 6, 4, 8, 7, 10, 6, 14, 8, 12, 12, 16, 10, 20, 10, 22, 16, 18, 12, 30, 17, 22, 20, 28, 16, 36, 16, 32, 24, 28, 24, 46, 20, 30, 28, 46, 22, 48, 22, 42, 40, 36, 24, 62, 29, 48, 36, 50, 28, 60, 36, 60, 40, 46, 30, 84, 32, 48, 52, 64, 44, 72, 34, 64, 48, 72
Offset: 1

Views

Author

N. J. A. Sloane, Feb 23 2009

Keywords

Comments

From Andrey Zabolotskiy, Mar 12 2018: (Start)
The parent lattice of the sublattices under consideration has Patterson symmetry group p4, and two sublattices are considered equivalent if they are related via a symmetry from that group [Rutherford]. For other 2D Patterson groups, the analogous sequences are A000203 (p2), A069734 (p2mm), A145391 (c2mm), A145393 (p4mm), A145394 (p6), A003051 (p6mm).
If we count sublattices related by parent-lattice-preserving reflection as equivalent, we get A145393 instead of this sequence. If we count sublattices related by rotation of the sublattice only (but not parent lattice; equivalently, sublattices related by rotation by angle which is not a multiple of Pi/2; see illustration in links) as equivalent, we get A054345. If we count sublattices related by any rotation or reflection as equivalent, we get A054346.
Rutherford says at p. 161 that a(n) != A054345(n) only when A002654(n) > 1, but actually these two sequences differ at other terms, too, for example, at n = 15 (see illustration). (End)

Crossrefs

Programs

Formula

a(n) = (A000203(n) + A002654(n))/2. [Rutherford] - N. J. A. Sloane, Mar 13 2009
a(n) = Sum_{ m: m^2|n } A000089(n/m^2) + A157224(n/m^2) = A002654(n) + Sum_{ m: m^2|n } A157224(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = Sum_{ d|n } A004525(d). - Andrey Zabolotskiy, Aug 29 2019

Extensions

New name from Andrey Zabolotskiy, Mar 12 2018

A157228 Number of primitive inequivalent inclined square sublattices of square lattice of index n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 25 2009

Keywords

Comments

From Andrey Zabolotskiy, May 09 2018: (Start)
Also, the number of partitions of n into 2 distinct coprime squares.
All such sublattices (including non-primitive ones) are counted in A025441.
The primitive sublattices that have the same symmetries (including the orientation of the mirrors) as the parent lattice are not counted here; they are counted in A019590, and all such sublattices (including non-primitive ones) are counted in A053866.
For n > 2, equals A193138. (End)

Crossrefs

Cf. A193138, A145393 (all sublattices of the square lattice), A025441, A019590, A053866, A157226, A157230, A157231, A000089, A304182, A224450, A224770, A281877, A024362.

Formula

a(n) = (A000089(n) - A019590(n)) / 2. - Andrey Zabolotskiy, May 09 2018
a(n) = 1 if n>2 is in A224450, a(n) = 2 if n is in A224770, a(n) is a higher power of 2 if n is in A281877 (first time reaches 8 at n = 32045). - Andrey Zabolotskiy, Sep 30 2018
a(n) = b(n) for odd n, a(n) = b(n/2) for even n, where b(n) = A024362(n). - Andrey Zabolotskiy, Jan 23 2022

Extensions

New name and more terms from Andrey Zabolotskiy, May 09 2018

A276183 Genus of the quotient of the modular curve X_0(n) by the Fricke involution.

Original entry on oeis.org

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

Views

Author

Gheorghe Coserea, Oct 21 2016

Keywords

Comments

a(n) is the genus of quotient space H/Gamma_0*(n), where H is the upper half plane and Gamma_0*(n) = Gamma_0(n) + W Gamma_0(n) is the extension of Gamma_0(n) via the involution z <-> W(z) = -n/z (see Cohn, 1988).

Examples

			G.f. = x^22 + x^28 + x^30 + x^33 + x^34 + x^37 + x^38 + x^40 + 2*x^42 + x^43 + x^44 + ...
		

Crossrefs

Programs

  • Mathematica
    f[n_] := If[n < 1, 0, 1 + Sum[MoebiusMu[d]^2 n/d/12 - EulerPhi[GCD[d, n/d]]/2, {d, Divisors@ n}] - Count[(#^2 - # + 1)/n & /@ Range@ n, ?IntegerQ]/3 - Count[(#^2 + 1)/n & /@ Range@ n, ?IntegerQ]/4];
    g[n_] := Ceiling[k0 = k /. FindRoot[EllipticK[1 - k^2]/EllipticK[k^2] == Sqrt@ n, {k, 1/2, 10^-10, 1}, WorkingPrecision -> 600, MaxIterations -> 100]; Exponent[MinimalPolynomial[RootApproximant[k0^2, 24], x], x]/2];
    r[n_] := If[MemberQ[{3, 7}, #], 3 + (# - 1)/2, 3] &@ Mod[n, 8]; a[n_] := If[n <= 4, 0, (1 + f@ n)/2 - r[n] g[n]/12]; Table[Print["a(", n, ") = ", an = a[n]]; an, {n, 102}] (* Michael De Vlieger, Oct 28 2016, after Michael Somos at A001617 and Jean-François Alcover at A000003 *)
    ClassList[n_?Negative] :=
    Select[Flatten[#, 1] &@Table[
        {i, j, (j^2 - n)/(4 i)}, {i, Sqrt[-n/3]}, {j, 1 - i, i}],
      Mod[#3, 1] == 0 && #3 >= # &&
          GCD[##] == 1 && ! (# == #3 && #2 < 0) & @@ # &]
    A001617[n_] := If[n < 1, 0,
      1 + Sum[MoebiusMu[d]^2 n/d/12 - EulerPhi[GCD[d, n/d]]/2, {d,
         Divisors@n}] -
       Count[(#^2 - # + 1)/n & /@ Range[n], _?IntegerQ]/3 -
       Count[(#^2 + 1)/n & /@ Range[n], _?IntegerQ]/4];
    a[n_] := If[0 <= n <= 4, 0, (A001617[n] + 1)/2 - If[Mod[n, 8] == 3, 4, If[Mod[n, 8] == 7, 6, 3]] Length[ClassList[-4 n]]/12] (* David Jao, Sep 07 2020 *)
  • PARI
    A000003(n) = qfbclassno(-4*n);
    A000089(n) = {
      if (n%4 == 0 || n%4 == 3, return(0));
      if (n%2 == 0, n \= 2);
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, if (f[k, 1] % 4 == 3, 0, 2));
    };
    A000086(n) = {
      if (n%9 == 0 || n%3 == 2, return(0));
      if (n%3 == 0, n \= 3);
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, if (f[k, 1] % 3 == 2, 0, 2));
    };
    A001615(n) = {
      my(f = factor(n), fsz = matsize(f)[1],
         g = prod(k=1, fsz, (f[k, 1]+1)),
         h = prod(k=1, fsz, f[k, 1]));
      return((n*g)\h);
    };
    A001616(n) = {
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, f[k, 1]^(f[k, 2]\2) + f[k, 1]^((f[k, 2]-1)\2));
    };
    A001617(n) = 1 + A001615(n)/12 - A000089(n)/4 - A000086(n)/3 - A001616(n)/2;
    a(n) = {
      my(r = if (n%8 == 3, 4, n%8 == 7, 6, 3));
      if (n < 5, 0, (1 + A001617(n))/2 - r * A000003(n)/12);
    };
    vector(102, n, a(n))

Formula

a(n) = (1 + A001617(n))/2 - r * A000003(n)/12 for all n > 4, where r=4 for n=3 (mod 8), r=6 for n=7 (mod 8) and r=3 otherwise.
a(n) <> 4884 for all n.

Extensions

New name from David Jao, Sep 07 2020

A054729 Numbers n such that genus of modular curve X_0(N) is never equal to n.

Original entry on oeis.org

150, 180, 210, 286, 304, 312, 336, 338, 348, 350, 480, 536, 570, 598, 606, 620, 666, 678, 706, 730, 756, 780, 798, 850, 876, 896, 906, 916, 970, 1014, 1026, 1046, 1106, 1144, 1170, 1176, 1186, 1188, 1224, 1244, 1260, 1320, 1350, 1356, 1366
Offset: 1

Views

Author

Janos A. Csirik, Apr 21 2000

Keywords

Comments

"Looking further in the list of integers not of the form g0(N), we do eventually find some odd values, the first one occurring at the 3885th position. There are four such up to 10^5 (out of 9035 total missed values), namely 49267, 74135, 94091, 96463." (see Csirik link) - Gheorghe Coserea, May 21 2016.
a(1534734) = 9999996. - Gheorghe Coserea, May 23 2016

Crossrefs

Programs

  • Mathematica
    a1617[n_] := a1617[n] = If[n < 1, 0, 1 + Sum[MoebiusMu[d]^2 n/d/12 - EulerPhi[GCD[d, n/d]]/2, {d, Divisors[n]}] - Count[(#^2 - # + 1)/n & /@ Range[n], ?IntegerQ]/3 - Count[(#^2+1)/n & /@ Range[n], ?IntegerQ]/4];
    seq[n_] := Module[{inv, bnd}, inv[_] = -1; bnd = 12 n + 18 Floor[Sqrt[n]] + 100; For[k = 1, k <= bnd, k++, g = a1617[k]; If[g <= n && inv[g+1] == -1, inv[g+1] = k]]; (Position[Array[inv, n+1], -1] // Flatten)-1];
    seq[1000] (* Jean-François Alcover, Nov 20 2018, after Gheorghe Coserea and Michael Somos in A001617 *)
  • PARI
    A000089(n) = {
      if (n%4 == 0 || n%4 == 3, return(0));
      if (n%2 == 0, n \= 2);
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, if (f[k,1] % 4 == 3, 0, 2));
    };
    A000086(n) = {
      if (n%9 == 0 || n%3 == 2, return(0));
      if (n%3 == 0, n \= 3);
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, if (f[k,1] % 3 == 2, 0, 2));
    };
    A001615(n) = {
      my(f = factor(n), fsz = matsize(f)[1],
         g = prod(k=1, fsz, (f[k,1]+1)),
         h = prod(k=1, fsz, f[k,1]));
      return((n*g)\h);
    };
    A001616(n) = {
      my(f = factor(n), fsz = matsize(f)[1]);
      prod(k = 1, fsz, f[k,1]^(f[k,2]\2) + f[k,1]^((f[k,2]-1)\2));
    };
    A001617(n) = 1 + A001615(n)/12 - A000089(n)/4 - A000086(n)/3 - A001616(n)/2;
    scan(n) = {
      my(inv = vector(n+1,g,-1), bnd = 12*n + 18*sqrtint(n) + 100, g);
      for (k = 1, bnd, g = A001617(k);
           if (g <= n && inv[g+1] == -1, inv[g+1] = k));
      apply(x->(x-1), Vec(select(x->x==-1, inv, 1)))
    };
    scan(1367)  \\ Gheorghe Coserea, May 21 2016
Showing 1-10 of 31 results. Next