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.
%I A002173 M4467 N1895 #76 Nov 16 2024 17:39:59 %S A002173 1,1,-8,1,26,-8,-48,1,73,26,-120,-8,170,-48,-208,1,290,73,-360,26,384, %T A002173 -120,-528,-8,651,170,-656,-48,842,-208,-960,1,960,290,-1248,73,1370, %U A002173 -360,-1360,26,1682,384,-1848,-120,1898,-528,-2208,-8,2353,651,-2320,170 %N A002173 a(n) = Sum_{d|n, d == 1 mod 4} d^2 - Sum_{d|n, d == 3 mod 4} d^2. %C A002173 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 %D A002173 Nathan J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 85, Eq. (32.7). %D A002173 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A002173 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A002173 Reinhard Zumkeller, <a href="/A002173/b002173.txt">Table of n, a(n) for n = 1..10000</a> %H A002173 J. W. L. Glaisher, <a href="http://gdz.sub.uni-goettingen.de/en/dms/loader/img/?PPN=PPN600494829_0020&DMDID=DMDLOG_0012">On the function chi(n)</a>, Quarterly Journal of Pure and Applied Mathematics, 20 (1884), 97-167. %H A002173 J. W. L. Glaisher, <a href="/A002171/a002171.pdf">On the function chi(n)</a>, Quarterly Journal of Pure and Applied Mathematics, 20 (1884), 97-167. [Annotated scanned copy] %H A002173 J. W. L. Glaisher, <a href="https://books.google.com/books?id=bLs9AQAAMAAJ&pg=RA1-PA1">On the representations of a number as the sum of two, four, six, eight, ten, and twelve squares</a>, Quart. J. Math. 38 (1907), 1-62 (see p. 4 and p. 8). %H A002173 Frazer Jarvis and Helena A. Verrill, <a href="https://doi.org/10.1007/s11139-009-9218-5">Supercongruences for the Catalan-Larcombe-French numbers</a>, Ramanujan J. (22) (2010), 171. %H A002173 Jan Stienstra, <a href="https://arxiv.org/abs/math/0502197">Mahler measure, Eisenstein series and dimers</a>, arXiv:math/0502197 [math.NT], 2005. %H A002173 <a href="/index/Ge#Glaisher">Index entries for sequences mentioned by Glaisher</a>. %F A002173 a(n) = A050450(n) - A050453(n). %F A002173 A120030(n) = -4*a(n), if n>0. %F A002173 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] %F A002173 G.f.: Sum_{n>=1} A056594(n-1)*n^2*q^n/(1-q^n). %F A002173 Expansion of (1 - theta_4(q)^2 * theta_4(q^2)^4)/4 in powers of q. - _Michael Somos_, Aug 09 2006 %F A002173 Expansion of (1-eta(q)^4*eta(q^2)^6/eta(q^4)^4)/4 in powers of q. %F A002173 G.f.: q*G'(q)/G(q), with G(q) = Product_{n>=1} (1-q^n)^(4n*A056594(n+1)). %F A002173 a(n) = Sum_{d|n} d^2*sin(d*Pi/2). - _Ridouane Oudra_, Feb 21 2023 %F A002173 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 %e A002173 The divisors of 15 are 1,3,5,15, so a(15)=(1^2+5^2)-(3^2+15^2) = -208. %e A002173 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 %p A002173 with(numtheory): %p A002173 A002173:= proc(n) %p A002173 local count1, count3, d; %p A002173 count1 := 0: %p A002173 count3 := 0: %p A002173 for d in numtheory[divisors](n) do %p A002173 if d mod 4 = 1 then %p A002173 count1 := count1+d^2 %p A002173 elif d mod 4 = 3 then %p A002173 count3 := count3+d^2 %p A002173 fi: %p A002173 end do: %p A002173 count1-count3; %p A002173 end proc: # _Ridouane Oudra_, Feb 21 2023 %p A002173 # second Maple program: %p A002173 a:= n-> add(`if`(d::odd, d^2*(-1)^((d-1)/2), 0), d=numtheory[divisors](n)): %p A002173 seq(a(n), n=1..100); # _Ridouane Oudra_, Feb 21 2023 %t A002173 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 *) %t A002173 a[ n_] := SeriesCoefficient[ (1 - EllipticTheta[ 4, 0, q]^2 EllipticTheta[ 4, 0, q^2]^4) / 4, {q, 0, n}]; (* _Michael Somos_, Jun 25 2019 *) %t A002173 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 *) %o A002173 (PARI) {a(n) = if( n<1, 0, sumdiv(n, d, d^2 * kronecker(-4, d)))} /* _Michael Somos_, Aug 09 2006 */ %o A002173 (Haskell) %o A002173 a002173 n = a050450 n - a050453 n -- _Reinhard Zumkeller_, Jun 17 2013 %o A002173 (Python) %o A002173 from math import prod %o A002173 from sympy import factorint %o A002173 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 %Y A002173 Cf. A050450, A050453, A120030. %Y A002173 Cf. A056594. %K A002173 sign,easy,mult,look %O A002173 1,3 %A A002173 _N. J. A. Sloane_ %E A002173 More terms from _David W. Wilson_