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.

A317596 a(n) is the number of k with 1 <= k <= n-1 such that a(k) + 2 * a(n-k) <= n.

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 10, 11, 12, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 20, 23, 25, 29, 31, 33, 34, 36, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39
Offset: 1

Views

Author

Rémy Sigrist, Aug 01 2018

Keywords

Comments

See A317582 for similar sequences.

Examples

			For n = 5:
- a(1) + 2 * a(4) = 0 + 2 * 3 = 6 > 5,
- a(2) + 2 * a(3) = 1 + 2 * 2 = 5 <= 5,
- a(3) + 2 * a(2) = 2 + 2 * 1 = 4 <= 5,
- a(4) + 2 * a(1) = 3 + 2 * 0 = 3 <= 5,
- hence a(5) = 3.
		

Crossrefs

Cf. A317582.

Programs

  • Mathematica
    a[n_] := a[n] = Length@ Select[ Range[n - 1], a[#] + 2a[n - #] <= n &]; a[0] = 0; Array[a, 70] (* Robert G. Wilson v, Aug 03 2018 *)
  • PARI
    a = vector(73); for (n=1, #a, a[n] = sum(k=1, n-1, a[k] + 2*a[n-k] <= n); print1 (a[n] ", "))