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.

A193773 Number of ways to write n as 2*x*y - x - y with 1 <= x <= y.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 02 2013

Keywords

Comments

a(A005097(n)) = 1; for n > 1: a(A047845(n)) > 1. - Reinhard Zumkeller, Jan 02 2013
Number of ways to write 2*n+1 as a difference of two squares. Note that 2*(2*x*y - x - y) + 1 = (2*x - 1) * (2*y - 1) = (y + x - 1)^2 - (y - x)^2. - Michael Somos, Dec 23 2018

Examples

			G.f. = 1 + x + x^2 + x^3 + 2*x^4 + x^5 + x^6 + 2*x^7 + x^8 + x^9 + 2*x^10 + ... - _Michael Somos_, Dec 23 2018
		

Crossrefs

Programs

  • Haskell
    a193773 n = length [() | x <- [1 .. n + 1],
                             let (y,m) = divMod (x + n) (2 * x - 1),
                             x <= y, m == 0]
    
  • Mathematica
    a[ n_] := If[ n < 0, 0, Ceiling[ DivisorSigma[0, 2 n + 1] / 2]]; (* Michael Somos, Dec 23 2018 *)
  • PARI
    {a(n) = if(n < 0, 0, (numdiv(2*n+1) + 1)\2)}; /* Michael Somos, Dec 23 2018 */

Formula

a(n) = ceiling(A000005(2*n+1) / 2). - Michael Somos, Dec 23 2018