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.

A381229 a(n) is the number of distinct positive integers that can be obtained by starting with n, and optionally applying the operations square root, floor, and ceiling, in any order.

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 4, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 7, 7, 7, 7, 7, 7
Offset: 1

Views

Author

N. J. A. Sloane and Jinyuan Wang, Feb 25 2025

Keywords

Examples

			For n = 15, sqrt(15) = 3.872..., floor and ceiling give 3 and 4. Sqrt(3) = 1.732..., and floor and ceiling give 1 and 2. 4 gives nothing new. In all, we get a(15) = 5 different numbers: 15, 3, 4, 1, 2.
		

Crossrefs

Programs

  • PARI
    f(n) = my(t); if(n<4, [1..n], t=sqrtint(n); if(issquare(n), concat(f(t), n), Set(concat([f(t), f(t+1), [n]]))));
    a(n) = #f(n);