OFFSET
1,7
COMMENTS
Blocks of consecutive numbers, duplicates, gaps and irregularities in the sequence explain the separated segments with small oscillations as shown by the graphs.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
For n = 1, R(ceiling(n^(1/2))) = 1, thus a(1) = ceiling((1-1)^2/(1+1)) = 0.
For n = 16, R(ceiling(n^(1/2))) = 4, thus a(16) = ceiling((16-4)^2/(16+4)) = 8.
For n = 21, R(ceiling(n^(1/2))) = 5, thus a(21) = ceiling((21-5)^2/(21+5)) = 10.
MATHEMATICA
Table[Ceiling[(n-FromDigits[Reverse[IntegerDigits[Ceiling[n^(1/2)]]]])^2/(n+FromDigits[Reverse[IntegerDigits[Ceiling[n^(1/2)]]]])], {n, 73}] (* Stefano Spezia, Jan 18 2022 *)
Table[With[{c=IntegerReverse[Ceiling[Sqrt[n]]]}, Ceiling[(n-c)^2/(n+c)]], {n, 100}] (* Harvey P. Dale, Jul 15 2025 *)
PROG
(PARI) a(n)=my(x=fromdigits(Vecrev(digits(ceil(sqrt(n)))))); r=ceil((n-x)^2/(n+x));
for(n=1, 2000, print1(a(n)", "))
(Python)
from math import isqrt
def R(n): return int(str(n)[::-1])
def a(n):
root = isqrt(n)
Rcroot = R(root) if root**2 ==n else R(root+1)
q, r = divmod((n-Rcroot)**2, n+Rcroot)
return q if r == 0 else q + 1
print([a(n) for n in range(1, 94)]) # Michael S. Branicky, Jan 17 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Claude H. R. Dequatre, Jan 17 2022
STATUS
approved
