OFFSET
1,2
COMMENTS
See A187645.
FORMULA
a(n) = n + floor(((1/4)*n^3 - 1/8)^(1/2)).
EXAMPLE
Write preliminary separate rankings:
1/4...2....27/4....16.....125/4...
....1...4.......9..16..25........36..49
Then replace each number by its rank, where ties are settled by ranking the top number before the bottom.
MATHEMATICA
PROG
(Python)
from math import isqrt
from sympy.ntheory.primetest import is_square
def A186148(n): return n+(isqrt(n**3)>>1)-(is_square(n)&(n&1^1)) # Chai Wah Wu, Oct 15 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 13 2011
STATUS
approved
