login
Greatest nonnegative integer k such that k(3k+1)/2 <= n.
2

%I #10 Sep 15 2024 06:50:06

%S 0,0,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,

%T 4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,

%U 6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8

%N Greatest nonnegative integer k such that k(3k+1)/2 <= n.

%F a(n) = floor((sqrt(24n+1)-1)/6).

%F a(A005449(n)) = n.

%o (PARI) a(n)=if(n<0,0,(sqrtint(24*n+1)-1)\6)

%Y Cf. A005449.

%K nonn,easy

%O 0,8

%A _Michael Somos_, Jun 19 2003