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.

A002173 a(n) = Sum_{d|n, d == 1 mod 4} d^2 - Sum_{d|n, d == 3 mod 4} d^2.

Original entry on oeis.org

1, 1, -8, 1, 26, -8, -48, 1, 73, 26, -120, -8, 170, -48, -208, 1, 290, 73, -360, 26, 384, -120, -528, -8, 651, 170, -656, -48, 842, -208, -960, 1, 960, 290, -1248, 73, 1370, -360, -1360, 26, 1682, 384, -1848, -120, 1898, -528, -2208, -8, 2353, 651, -2320, 170
Offset: 1

Views

Author

Keywords

Comments

Multiplicative because it is the Inverse Moebius transform of [1, 0, -3^2, 0, 5^2, 0, -7^2, ...], which is multiplicative. - Christian G. Bower, May 18 2005

Examples

			The divisors of 15 are 1,3,5,15, so a(15)=(1^2+5^2)-(3^2+15^2) = -208.
G.f. = x + x^2 - 8*x^3 + x^4 + 26*x^5 - 8*x^6 - 48*x^7 + x^8 + 73*x^9 + ... - _Michael Somos_, Jun 25 2019
		

References

  • Nathan J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 85, Eq. (32.7).
  • 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

  • Haskell
    a002173 n = a050450 n - a050453 n  -- Reinhard Zumkeller, Jun 17 2013
    
  • Maple
    with(numtheory):
    A002173:= 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+d^2
            elif d mod 4 = 3 then
                count3 := count3+d^2
            fi:
        end do:
        count1-count3;
    end proc: # Ridouane Oudra, Feb 21 2023
    # second Maple program:
    a:= n-> add(`if`(d::odd, d^2*(-1)^((d-1)/2), 0), d=numtheory[divisors](n)):
    seq(a(n), n=1..100);  # Ridouane Oudra, Feb 21 2023
  • Mathematica
    QP = QPochhammer; s = (1-QP[q]^4*(QP[q^2]^6/QP[q^4]^4))/(4*q) + O[q]^60; CoefficientList[s, q] (* Jean-François Alcover, Nov 27 2015 *)
    a[ n_] := SeriesCoefficient[ (1 - EllipticTheta[ 4, 0, q]^2 EllipticTheta[ 4, 0, q^2]^4) / 4, {q, 0, n}]; (* Michael Somos, Jun 25 2019 *)
    f[p_, e_] := If[Mod[p, 4] == 1, ((p^2)^(e+1)-1)/(p^2-1), ((-p^2)^(e+1)-1)/(-p^2-1)]; f[2, e_] := 1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 60] (* Amiram Eldar, Aug 28 2023 *)
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, d^2 * kronecker(-4, d)))} /* Michael Somos, Aug 09 2006 */
    
  • Python
    from math import prod
    from sympy import factorint
    def A002173(n): return prod(((m:=p**2*(0,1,0,-1)[p&3])**(e+1)-1)//(m-1) for p, e in factorint(n).items()) # Chai Wah Wu, Jun 21 2024

Formula

a(n) = A050450(n) - A050453(n).
A120030(n) = -4*a(n), if n>0.
Multiplicative with a(p^e) = 1 if p = 2; ((p^2)^(e+1)-1)/(p^2-1) if p == 1 (mod 4); ((-p^2)^(e+1)-1)/(-p^2-1) if p == 3 (mod 4). - David W. Wilson, Sep 01 2001 [This can be written as a single formula: a(p^e) = ((p^2*Chi(p))^(e+1) - 1)/(p^2*Chi(p) - 1), Chi = A101455. - Jianing Song, Oct 30 2019]
G.f.: Sum_{n>=1} A056594(n-1)*n^2*q^n/(1-q^n).
Expansion of (1 - theta_4(q)^2 * theta_4(q^2)^4)/4 in powers of q. - Michael Somos, Aug 09 2006
Expansion of (1-eta(q)^4*eta(q^2)^6/eta(q^4)^4)/4 in powers of q.
G.f.: q*G'(q)/G(q), with G(q) = Product_{n>=1} (1-q^n)^(4n*A056594(n+1)).
a(n) = Sum_{d|n} d^2*sin(d*Pi/2). - Ridouane Oudra, Feb 21 2023
G.f.: Sum_{n>=0} (4*n + 1)^2*x^(4*n + 1)/(1 - x^(4*n + 1)) - (4*n + 3)^2*x^(4*n + 3)/(1 - x^(4*n + 3)). - Miles Wilson, Oct 26 2024

Extensions

More terms from David W. Wilson

A050453 Sum_{d|n, d=3 mod 4} d^2.

Original entry on oeis.org

0, 0, 9, 0, 0, 9, 49, 0, 9, 0, 121, 9, 0, 49, 234, 0, 0, 9, 361, 0, 58, 121, 529, 9, 0, 0, 738, 49, 0, 234, 961, 0, 130, 0, 1274, 9, 0, 361, 1530, 0, 0, 58, 1849, 121, 234, 529, 2209, 9, 49, 0, 2610, 0, 0, 738, 3146, 49, 370, 0, 3481, 234, 0, 961, 4027
Offset: 1

Views

Author

N. J. A. Sloane, Dec 23 1999

Keywords

Crossrefs

Programs

  • Haskell
    a050453 = sum . map (^ 2) . filter ((== 3) . (`mod` 4)) . a027750_row
    -- Reinhard Zumkeller, Jun 17 2013

A050448 a(n) = Sum_{d|n, d==1 (mod 4)} d^4.

Original entry on oeis.org

1, 1, 1, 1, 626, 1, 1, 1, 6562, 626, 1, 1, 28562, 1, 626, 1, 83522, 6562, 1, 626, 194482, 1, 1, 1, 391251, 28562, 6562, 1, 707282, 626, 1, 1, 1185922, 83522, 626, 6562, 1874162, 1, 28562, 626, 2825762, 194482, 1, 1, 4107812, 1, 1, 1
Offset: 1

Views

Author

N. J. A. Sloane, Dec 23 1999

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSum[n, #^4 &, Mod[#, 4] == 1 &]; Array[a, 50] (* Amiram Eldar, Jul 08 2023 *)
  • PARI
    a(n) = sumdiv(n, d, if ((d%4)==1, d^4)); \\ Michel Marcus, Aug 16 2021

Extensions

Offset corrected by Sean A. Irvine, Aug 15 2021

A363972 Expansion of Sum_{k>0} k^2 * x^(4*k-3) / (1 - x^(4*k-3)).

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 1, 1, 10, 5, 1, 1, 17, 1, 5, 1, 26, 10, 1, 5, 37, 1, 1, 1, 54, 17, 10, 1, 65, 5, 1, 1, 82, 26, 5, 10, 101, 1, 17, 5, 122, 37, 1, 1, 158, 1, 1, 1, 170, 54, 26, 17, 197, 10, 5, 1, 226, 65, 1, 5, 257, 1, 46, 1, 310, 82, 1, 26, 325, 5, 1, 10, 362, 101, 54, 1, 401, 17, 1, 5, 451, 122, 1
Offset: 1

Views

Author

Seiichi Manyama, Jun 30 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSum[n, ((#+3)/4)^2 &, Mod[#, 4] == 1 &]; Array[a, 100] (* Amiram Eldar, Jun 30 2023 *)
  • PARI
    a(n) = sumdiv(n, d, (d%4==1)*((d+3)/4)^2);

Formula

a(n) = Sum_{d|n, d==1 mod 4} ((d+3)/4)^2.
Showing 1-4 of 4 results.