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

A025441 Number of partitions of n into 2 distinct nonzero squares.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A060306 gives records; A052199 gives where records occur.
Column k=2 of A341040.
Cf. A004439 (a(n)=0), A025302 (a(n)=1), A025303 (a(n)=2), A025304 (a(n)=3), A025305 (a(n)=4), A025306 (a(n)=5), A025307 (a(n)=6), A025308 (a(n)=7), A025309 (a(n)=8), A025310 (a(n)=9), A025311 (a(n)=10), A004431 (a(n)>0).

Programs

  • Haskell
    a025441 n = sum $ map (a010052 . (n -)) $
                          takeWhile (< n `div` 2) $ tail a000290_list
    -- Reinhard Zumkeller, Dec 20 2013
    
  • Mathematica
    Table[Count[PowersRepresentations[n, 2, 2], pr_ /; Unequal @@ pr && FreeQ[pr, 0]], {n, 0, 107}] (* Jean-François Alcover, Mar 01 2019 *)
  • PARI
    a(n)=if(n>4,sum(k=1,sqrtint((n-1)\2),issquare(n-k^2)),0) \\ Charles R Greathouse IV, Jun 10 2016
    
  • PARI
    a(n)=if(n<5,return(0)); my(v=valuation(n, 2), f=factor(n>>v), t=1); for(i=1, #f[, 1], if(f[i, 1]%4==1, t*=f[i, 2]+1, if(f[i, 2]%2, return(0)))); if(t%2, t-(-1)^v, t)/2-issquare(n/2) \\ Charles R Greathouse IV, Jun 10 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A025441(n):
        f = factorint(n).items()
        return -int(not (any((e-1 if p == 2 else e)&1 for p,e in f) or n&1)) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1) if n else 0 # Chai Wah Wu, Sep 08 2022

Formula

a(A025302(n)) = 1. - Reinhard Zumkeller, Dec 20 2013
a(n) = Sum_{ m: m^2|n } A157228(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = [x^n y^2] Product_{k>=1} (1 + y*x^(k^2)). - Ilya Gutkovskiy, Apr 22 2019
a(n) = Sum_{i=1..floor((n-1)/2)} c(i) * c(n-i), where c is the square characteristic (A010052). - Wesley Ivan Hurt, Nov 26 2020
a(n) = A000161(n) - A093709(n). - Andrey Zabolotskiy, Apr 12 2022

A145393 Number of inequivalent sublattices of index n in square lattice, where two sublattices are considered equivalent if one can be rotated or reflected to give the other, with that rotation or reflection preserving the parent square lattice.

Original entry on oeis.org

1, 2, 2, 4, 3, 5, 3, 7, 5, 7, 4, 11, 5, 8, 8, 12, 6, 13, 6, 15, 10, 11, 7, 21, 10, 13, 12, 18, 9, 22, 9, 21, 14, 16, 14, 29, 11, 17, 16, 29, 12, 28, 12, 25, 23, 20, 13, 39, 16, 27, 20, 29, 15, 34, 20, 36, 22, 25, 16, 50, 17, 26, 29, 38, 24, 40, 18, 36, 26, 40
Offset: 1

Views

Author

N. J. A. Sloane, Feb 23 2009

Keywords

Comments

From Andrey Zabolotskiy, Mar 12 2018: (Start)
If reflections are not allowed, we get A145392. If any rotations and reflections are allowed, we get A054346.
The parent lattice of the sublattices under consideration has Patterson symmetry group p4mm, 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), A145392 (p4), A145394 (p6), A003051 (p6mm).
Rutherford says at p. 161 that a(n) != A054346(n) only when A002654(n) > 2, but actually these two sequence differ at other terms, too, for example, at n = 30 (see illustration). (End)

Crossrefs

Programs

  • Mathematica
    terms = 70;
    CoefficientList[Sum[(1/((1-x^m)(1-x^(4m)))-1), {m, 1, terms}] + O[x]^(terms + 1), x] // Rest (* Jean-François Alcover, Aug 05 2018 *)

Formula

a(n) = (A000203(n) + A002654(n) + A069735(n) + A145390(n))/4. [Rutherford] - N. J. A. Sloane, Mar 13 2009
G.f.: Sum_{ m>=1 } (1/((1-x^m)(1-x^(4m))) - 1). [Hanany, Orlando & Reffert, eq. (6.8)] - Andrey Zabolotskiy, Jul 05 2017
a(n) = Sum_{ m: m^2|n } A019590(n/m^2) + A157228(n/m^2) + A157226(n/m^2) + A157230(n/m^2) + A157231(n/m^2) = A053866(n) + A025441(n) + Sum_{ m: m^2|n } A157226(n/m^2) + A157230(n/m^2) + A157231(n/m^2). [Rutherford] - Andrey Zabolotskiy, May 07 2018
a(n) = Sum_{ d|n } A008621(d) = Sum_{ d|n } (1 + floor(d/4)). [From the above-given g.f.] - Andrey Zabolotskiy, Jul 17 2019

Extensions

New name from Andrey Zabolotskiy, Mar 12 2018

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

A157230 Number of primitive inequivalent sublattices of square lattice having mirrors parallel to the diagonals of the unit cell of the parent lattice of index n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 25 2009

Keywords

Comments

After a(2), this matches A034380 except for n = 63, 65, 80, 85, ... - R. J. Mathar, Feb 27 2009 [Updated by Andrey Zabolotskiy, May 09 2018]

Crossrefs

Cf. A145393 (all sublattices of the square lattice), A019590, A157228, A157226, A157231, A304182, A060594, A046072, A033948, A272592.

Programs

  • Mathematica
    a[n_] := If[n <= 2, 0, Sum[Boole[Mod[k^2, n] == 1], {k, 1, n}]/2];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Apr 12 2023 *)

Formula

From Andrey Zabolotskiy, Sep 30 2018: (Start)
a(n) = (A060594(n) - A019590(n))/2.
a(n) = 2^(A046072(n)-1) for n>2. Thus a(n) = 1 if n>2 is in A033948, a(n) = 2 if n is in A272592, etc. (End)

Extensions

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

A157226 Number of primitive inequivalent sublattices of square lattice having mirrors parallel to the sides of the unit cell of the parent lattice of index n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 25 2009

Keywords

Comments

Andrey Zabolotskiy's new formula confirms that a(n) indeed is a function of A305891(n). - Antti Karttunen, Oct 01 2018

Crossrefs

Cf. A145393 (all sublattices of the square lattice), A019590, A157228, A157230, A157231, A304182, A007875, A029744.

Programs

Formula

From Andrey Zabolotskiy, Sep 30 2018: (Start)
Let b(n) = A007875(n) for n>1, b(1) = 0. Then
a(n) = b(n) for odd n,
a(n) = b(n) + b(n/2) for even n.
Thus the sorted list of all terms (except for a(1)=0) is A029744. (End)

Extensions

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

A157231 Number of primitive inequivalent oblique sublattices of square lattice of index n (equivalence and symmetry of sublattices are determined using parent lattice symmetries).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 25 2009

Keywords

Crossrefs

Cf. A145393 (all sublattices of the square lattice), A019590, A157228, A157226, A157230, A001615, A304182.

Formula

a(n) = (A001615(n) - A019590(n) - 2 * (A157228(n) + A157226(n) + A157230(n))) / 4. - Andrey Zabolotskiy, May 09 2018

Extensions

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

A193138 Number of square satins of order n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 16 2011

Keywords

Comments

a(n) = A157228(n) for all entries known. - R. J. Mathar, Aug 10 2011
This sequence is conjectured to coincide with the multiplicities of the representation of n >= 3 as primitive sums of two squares. Neither the order of the squares nor the signs of the numbers to be squared are taken into account. a(n) = 0 if no such representation exists. Checked for n = 3,4, ..., 1000 (using the program below). The two squares are in each case nonzero and distinct. If one includes also 0 as a square in the primitive sum of two squares one could take a(0) = 0, a(1) = 1, a(2) = 1. If only nonzero squares are considered, then one could take a(0) = 0, a(1) = 0, a(2) = 1.
For the numbers n with a(n) > 0 (in this conjectured interpretation of a(n)) see A008784. - Wolfdieter Lang, Apr 17 2013
The stated conjecture is true because it follows immediately from Theorem 3.22, p. 165, of the Niven-Zuckerman-Montgomery reference. There r(n) gives the number of primitive solutions of n = x^2 + y^2 with ordered and signed pairs of integers x,y. Because x and y are distinct if n >= 3 one needs here a(n) = r(n)/2^3. This then coincides with the formula for u(n) given in the Grünbaum-Shephard Theorem 5. - Wolfdieter Lang, Apr 18 2013
The equality noted by R. J. Mathar above indeed holds for all n > 2. Regarding n = 2 case: if we consider periodic twills as satins (which seems more consistent), we'll get a(2) = 1 from the plain weave; otherwise (following Grünbaum and Shephard), a(1) = a(2) = 0 (so we get A157228). In the former case, the all-black pattern can formally be counted as a(1) = 1, but physically it is dubious (this pattern corresponds to unweaved warp and weft). - Andrey Zabolotskiy, May 09 2018

Examples

			Primitive sums of two squares stated as a comment above: a(3) = 0  because 3 is not a sum of two squares.  a(5) = 1 because 5 = 1^2 + 2^2, denoted by the unique (primitive) doublet [1, 2].  a(65) = 2 from the two (primitive) doublets [1, 8] and [4, 7]. a(85) = 2 with the (primitive) doublets [2, 9] and  [6, 7]. a(8) = 0 because the doublet [2, 2] is imprimitive. - _Wolfdieter Lang_, Apr 18 2013
		

References

  • Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, An Introduction to the Theory Of Numbers, Fifth Edition, John Wiley and Sons, Inc., NY 1991.

Crossrefs

Programs

  • Maple
    U:=proc(n) local nop,p3,i,t1,t2,al,even;
    t1:=ifactors(n)[2];
    t2:=nops(t1);
    if (n mod 2) = 0 then even:=1; al:=t1[1][2]; else even:=0; al:=0; fi;
    nop:=t2-even;
    p3:=0;
    for i from 1 to t2 do if t1[i][1] mod 4 = 3 then p3:=1; fi; od:
    if (al >= 2) or (p3=1) then RETURN(0) else RETURN(2^(nop-1)); fi;
    end;
    [seq(U(n),n=3..120)];
  • Mathematica
    a[n_] := Select[ PowersRepresentations[n, 2, 2], GCD @@ # == 1 &] // Length; a[2] = 0; Table[a[n], {n, 3, 120}] (* Jean-François Alcover, Apr 18 2013 *)

Formula

Take the prime number factorization (symbolically) as n = 2^a*product(p^b)*product(q^c) with primes p == 1(mod 4) and primes q == 3(mod 4) and n>=3. If a = 0 or 1 and all c's vanish then a(n) = 2^(t-1) with t the number of distinct primes congruent 1(mod 4). Otherwise a(n) = 0. (See the Niven-Zuckerman-Montgomery reference, Theorem 3.22, p. 165, and the Grünbaum-Shephard Theorem 5 formula for u(n)). - Wolfdieter Lang, Apr 18 2013
Showing 1-7 of 7 results.