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.

A058498 Number of solutions to c(1)t(1) + ... + c(n)t(n) = 0, where c(i) = +-1 for i>1, c(1) = t(1) = 1, t(i) = triangular numbers (A000217).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 2, 0, 6, 8, 13, 0, 33, 52, 105, 0, 310, 485, 874, 0, 2974, 5240, 9488, 0, 30418, 55715, 104730, 0, 352467, 642418, 1193879, 0, 4165910, 7762907, 14493951, 0, 50621491, 95133799, 179484713, 0, 637516130, 1202062094, 2273709847, 0, 8173584069
Offset: 1

Views

Author

Naohiro Nomoto, Dec 20 2000

Keywords

Examples

			a(8) = 2 because there are two solutions: 1 - 3 + 6 + 10 + 15 - 21 + 28 - 36 = 1 - 3 - 6 + 10 - 15 + 21 + 28 - 36 = 0.
		

Crossrefs

Cf. A000217.

Programs

  • Maple
    b:= proc(n, i) option remember; local m; m:= (2+(3+i)*i)*i/6;
          `if`(n>m, 0, `if`(n=m, 1,
          b(abs(n-i*(i+1)/2), i-1) +b(n+i*(i+1)/2, i-1)))
        end:
    a:= n-> `if`(irem(n, 4)=1, 0, b(n*(n+1)/2, n-1)):
    seq(a(n), n=1..40);  # Alois P. Heinz, Oct 31 2011
  • Mathematica
    b[n_, i_] := b[n, i] = With[{m = (2+(3+i)*i)*i/6}, If[n>m, 0, If[n == m, 1, b[Abs[n - i*(i+1)/2], i-1] + b[n + i*(i+1)/2, i-1]]]]; a[n_] := If[Mod[n, 4] == 1, 0, b[n*(n+1)/2, n-1]]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Jan 30 2017, after Alois P. Heinz *)

Formula

a(n) = [x^(n*(n+1)/2)] Product_{k=1..n-1} (x^(k*(k+1)/2) + 1/x^(k*(k+1)/2)). - Ilya Gutkovskiy, Feb 01 2024

Extensions

More terms from Sascha Kurz, Oct 13 2001
More terms from Alois P. Heinz, Oct 31 2011