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 A005369 #65 Jun 07 2025 18:45:09 %S A005369 1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0, %T A005369 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, %U A005369 0,0,0,0,1,0,0,0,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,0,0,0,0 %N A005369 a(n) = 1 if n is of the form m(m+1), else 0. %C A005369 This is essentially the q-expansion of the Jacobi theta function theta_2(q). (In theta_2 one has to ignore the initial factor of 2*q^(1/4). See also A010054.) - _N. J. A. Sloane_, Aug 03 2014 %C A005369 For n > 0, a(n) is the number of partitions of n into two parts such that the larger part is equal to the square of the smaller part. - _Wesley Ivan Hurt_, Dec 23 2020 %D A005369 S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55. %H A005369 Reinhard Zumkeller, <a href="/A005369/b005369.txt">Table of n, a(n) for n = 0..10000</a> %H A005369 Robert Price, <a href="/A005369/a005369.txt">Comments on A005369 concerning Elementary Cellular Automata</a>, Jan 29 2016 %H A005369 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/JacobiThetaFunctions.html">Jacobi Theta Functions</a> [From _Franklin T. Adams-Watters_, Jun 29 2009] %H A005369 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ElementaryCellularAutomaton.html">Elementary Cellular Automaton</a> %H A005369 S. Wolfram, <a href="http://wolframscience.com/">A New Kind of Science</a> %H A005369 <a href="/index/Ce#cell">Index entries for sequences related to cellular automata</a> %H A005369 <a href="https://oeis.org/wiki/Index_to_Elementary_Cellular_Automata">Index to Elementary Cellular Automata</a> %H A005369 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a> %F A005369 Expansion of q^(-1/4) * eta(q^4)^2 / eta(q^2) in powers of q. %F A005369 Euler transform of period 4 sequence [ 0, 1, 0, -1, ...]. %F A005369 G.f.: Product_{k>0} (1 - x^(4*k)) / (1 - x^(4*k-2)) = f(x^2, x^6) where f(, ) is Ramanujan's general theta function. %F A005369 From _Michael Somos_, Apr 13 2005: (Start) %F A005369 Given g.f. A(x), then B(q) = (q*A(q^4))^2 satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = v^3 + 4*v*w^2 - u^2*w. %F A005369 Given g.f. A(x), then B(q) = q*A(q^4) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1*u2^2*u6 - u1*u6^3 - u3^3*u2. (End) %F A005369 a(n) = b(4*n + 1) where b() = A098108() is multiplicative and b(2^e) = 0^e, b(p^e) = (1 + (-1)^e)/2 if p>2. - _Michael Somos_, Jun 06 2005 %F A005369 G.f.: 1/2 x^{-1/4}theta_2(0,x), where theta_2 is a Jacobi theta function. - _Franklin T. Adams-Watters_, Jun 29 2009 %F A005369 a(A002378(n)) = 1; a(A078358(n)) = 0. - _Reinhard Zumkeller_, Jul 05 2014 %F A005369 a(n) = floor(sqrt(n+1)+1/2)-floor(sqrt(n)+1/2). - _Mikael Aaltonen_, Jan 02 2015 %F A005369 a(2*n) = A010054(n). %F A005369 a(n) = A000729(n)(mod 2). - _John M. Campbell_, Jul 16 2016 %F A005369 For n > 0, a(n) = Sum_{k=1..floor(n/2)} [k^2 = n-k], where [ ] is the Iverson bracket. - _Wesley Ivan Hurt_, Dec 23 2020 %e A005369 G.f. = 1 + x^2 + x^6 + x^12 + x^20 + x^30 + x^42 + x^56 + x^72 + x^90 + ... %e A005369 G.f. = q + q^9 + q^25 + q^49 + q^81 + q^121 + q^169 + q^225 + q^289 + ... %p A005369 A005369 := proc(n) %p A005369 if issqr(1+4*n) then %p A005369 if type( sqrt(1+4*n)-1,'even') then %p A005369 1; %p A005369 else %p A005369 0; %p A005369 end if; %p A005369 else %p A005369 0; %p A005369 end if; %p A005369 end proc: %p A005369 seq(A005369(n),n=0..80) ; # _R. J. Mathar_, Feb 22 2021 %t A005369 a005369[n_] := If[IntegerQ[Sqrt[4 # + 1]], 1, 0] & /@ Range[0, n]; a005369[100] (* _Michael De Vlieger_, Jan 02 2015 *) %t A005369 a[ n_] := SquaresR[ 1, 4 n + 1] / 2; (* _Michael Somos_, Feb 22 2015 *) %t A005369 a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, x] / (2 x^(1/4)), {x, 0, n}]; (* _Michael Somos_, Feb 22 2015 *) %t A005369 QP = QPochhammer; s = QP[q^4]^2/QP[q^2] + O[q]^100; CoefficientList[s, q] (* _Jean-François Alcover_, Dec 01 2015, adapted from PARI *) %t A005369 nmax = 200; CoefficientList[Series[Sum[x^(k*(k + 1)), {k, 0, Sqrt[nmax]}], {x, 0, nmax}], x] (* _Vaclav Kotesovec_, Nov 12 2020 *) %o A005369 (PARI) {a(n) = if( n<0, 0, issquare(4*n + 1))}; %o A005369 (PARI) {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^4 + A)^2 / eta(x^2 + A), n))}; %o A005369 (Haskell) %o A005369 a005369 = a010052 . (+ 1) . (* 4) -- _Reinhard Zumkeller_, Jul 05 2014 %o A005369 (Python) %o A005369 from sympy.ntheory.primetest import is_square %o A005369 def A005369(n): return int(is_square((n<<2)|1)) # _Chai Wah Wu_, Jun 07 2025 %Y A005369 Cf. A002378. Partial sums give A000194. %Y A005369 Cf. A010052, A010054, A016813, A240025. %K A005369 nonn,easy %O A005369 0,1 %A A005369 _N. J. A. Sloane_ %E A005369 Additional comments from _Michael Somos_, Apr 29 2003 %E A005369 Erroneous formula removed by _Reinhard Zumkeller_, Jul 05 2014