A350810 a(n) = ceiling((n-R(n^2))^2/(n+R(n^2))), where R(n^2) is the digit reversal of n^2.
0, 1, 3, 50, 39, 48, 75, 27, 3, 8, 92, 407, 923, 651, 479, 606, 933, 372, 114, 11, 92, 422, 859, 607, 456, 602, 850, 410, 81, 12, 96, 4106, 9703, 6410, 5117, 6814, 9521, 4329, 1139, 5, 1742, 4547, 9353, 6261, 5069, 5976, 8882, 3891, 904, 1, 919, 3919, 8925, 6032, 5041, 6147, 9254
Offset: 1
Examples
For n = 1, R(n^2) = 1, thus a(1) = ceiling((1-1)^2/(1+1)) = 0. For n = 10, R(n^2) = 1, thus a(10) = ceiling((10-1)^2/(10+1)) = 8. For n = 21, R(n^2) = 144, thus a(21) = ceiling((21-144)^2/(21+144)) = 92.
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[Ceiling[(n-FromDigits[Reverse[IntegerDigits[n^2]]])^2/(n+FromDigits[Reverse[IntegerDigits[n^2]]])],{n,57}] (* Stefano Spezia, Jan 18 2022 *)
-
PARI
a(n) = my(x = fromdigits(Vecrev(digits(n^2))));r = ceil((n-x)^2/(n+x)); for(n = 1,2000,print1(a(n)", "))
-
Python
def R(n): return int(str(n)[::-1]) def a(n): Rn2 = R(n**2) q, r = divmod((n-Rn2)**2, n+Rn2) return q if r == 0 else q + 1 print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Jan 17 2022
Comments