OFFSET
1,10
COMMENTS
If n is a palindrome, R(n) = n and n-R(n) = 0, thus a(n) = 0. So, for a given length of the sequence, the number of zeros is equal to the number of palindromic n's. For example, in the interval {0, 100} there are 18 zeros corresponding to the 18 palindromic n's: 1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88 and 99.
From the 11th term, the sequence can be seen as a series of subsequences separated by a zero. Between two zeros, the terms start by increasing, then go through a maximum and finally decrease as shown for example by the zero separated subsets: [3,8,14,20,27,34,41,48,15,3]; [2,5,10,15,21,27,33,23,8,2]; [2,4,8,12,17,23,30,14,5,2].
The above described characteristics of the sequence give well-structured patterns to nice graphs.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 1, R(n) = 1, thus a(1) = ceiling((1-1)^2/(1+1)) = 0.
For n = 10, R(n) = 1, thus a(10) = ceiling((10-1)^2/(10+1)) = 8.
For n = 22, R(n) = 22, thus a(22) = ceiling((22-22)^2/(22+22)) = 0.
MATHEMATICA
Table[Ceiling[(n-FromDigits[Reverse[IntegerDigits[n]]])^2/(n+FromDigits[Reverse[IntegerDigits[n]]])], {n, 81}] (* Stefano Spezia, Jan 18 2022 *)
PROG
(PARI) a(n)=my(x=fromdigits(Vecrev(digits(n)))); 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):
Rn = R(n)
q, r = divmod((n-Rn)**2, n+Rn)
return q if r == 0 else q + 1
print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Jan 17 2022
CROSSREFS
KEYWORD
AUTHOR
Claude H. R. Dequatre, Jan 17 2022
STATUS
approved