%I #8 Feb 25 2025 15:05:36
%S 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,
%T 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,
%U 6,6,6,6,6,6,6,6,6,6,6,6,5,7,7,7,7,7,7
%N 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.
%e 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.
%o (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]]))));
%o a(n) = #f(n);
%Y Cf. A381226, A381227, A381228.
%K nonn
%O 1,2
%A _N. J. A. Sloane_ and _Jinyuan Wang_, Feb 25 2025