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.

A367315 a(1) = 1, and for any n > 0, a(2*n) is the number of k's among 1..n such that a(k) <= a(n), a(2*n+1) is the number of k's among 1..n such that a(k) >= a(n).

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 4, 1, 5, 2, 6, 1, 7, 2, 8, 1, 4, 9, 10, 1, 7, 7, 12, 1, 5, 13, 14, 1, 9, 10, 16, 1, 6, 17, 14, 6, 19, 1, 20, 1, 7, 21, 19, 5, 20, 6, 24, 1, 8, 25, 18, 10, 27, 1, 28, 1, 9, 29, 26, 6, 28, 5, 32, 1, 10, 33, 22, 14, 35, 1, 34, 4, 23, 17, 38
Offset: 1

Views

Author

Rémy Sigrist, Nov 14 2023

Keywords

Comments

This sequence is unbounded: for any m > 0, a(4*m) + a(4*m+1) >= 2*m + 1, as both terms are positive, at least one of them must be >= m.
This sequence contains infinitely many 1's: if a(n) > a(k) for all k < n, then a(2*n + 1) = 1, and as the sequence is unbounded, we have infinitely many such n.
This sequence contains all positive integers: for any n > 0, if k is the index of the n-th 1, then a(2*k) = n.

Examples

			a(1) = 1 by definition.
a(1) <= a(1) hence a(2) = 1.
a(1) >= a(1) hence a(3) = 1.
a(1) and a(2) <= a(2) hence a(4) = 2.
a(1), a(2), a(3) and a(4) <= a(4) hence a(8) = 4.
a(1), a(2) and a(3) < a(4), a(4) >= a(4) hence a(9) = 1.
		

Crossrefs

Cf. A272727.

Programs

  • PARI
    { for (n = 1, #a = vector(76), print1 (a[n] = if (n==1, 1, sum (k=1, n\2, if (n%2==0, a[k] <= a[n\2], a[k] >= a[n\2])))", ")) }

Formula

a(2*n) + a(2*n+1) >= n + 1.