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-1 of 1 results.

A331165 a(n) = a(n-1) + p(n) if p(n) > a(n-1), otherwise a(n) = a(n-1) - p(n), where p is the partition function A000041 (assuming a(n) = 0 for n < 0).

Original entry on oeis.org

1, 0, 2, 5, 0, 7, 18, 3, 25, 55, 13, 69, 146, 45, 180, 4, 235, 532, 147, 637, 10, 802, 1804, 549, 2124, 166, 2602, 5612, 1894, 6459, 855, 7697, 16046, 5903, 18213, 3330, 21307, 42944, 16929, 48114, 10776, 55359, 2185, 65446, 140621, 51487, 157045, 32291, 179564
Offset: 0

Views

Author

Alois P. Heinz, Jan 11 2020

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<0, 0, ((s, t)-> s+
         `if`(s
    				
  • Mathematica
    a[n_] := a[n] = If[n<0, 0, With[{a1 = a[n-1], p = PartitionsP[n]}, If[p>a1, a1 + p, a1 - p]]];
    a /@ Range[0, 70] (* Jean-François Alcover, Jan 05 2021 *)
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(p = numbpart(n-1)); va[n] = va[n-1] - p; if (va[n] < 0, va[n] += 2*p);); va;} \\ Michel Marcus, Jan 06 2021
Showing 1-1 of 1 results.