login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A350811
a(n) = ceiling((n-R(n))^2/(n+R(n))), where R(n) is the digit reversal of n.
1
0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 3, 8, 14, 20, 27, 34, 41, 48, 15, 3, 0, 2, 5, 10, 15, 21, 27, 33, 23, 8, 2, 0, 2, 4, 8, 12, 17, 23, 30, 14, 5, 2, 0, 1, 3, 7, 10, 15, 37, 20, 10, 4, 1, 0, 1, 3, 6, 9, 45, 27, 15, 8, 3, 1, 0, 1, 3, 5, 52, 34, 21, 12, 7, 3, 1, 0, 1, 2, 59, 41
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
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
Sequence in context: A175574 A195342 A307184 * A154214 A330448 A354635
KEYWORD
nonn,base,easy,look
AUTHOR
STATUS
approved