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”).

A084019
a(n) = 9's complement of n-th palindrome (A002113).
2
9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 88, 77, 66, 55, 44, 33, 22, 11, 0, 898, 888, 878, 868, 858, 848, 838, 828, 818, 808, 797, 787, 777, 767, 757, 747, 737, 727, 717, 707, 696, 686, 676, 666, 656, 646, 636, 626, 616
OFFSET
1,1
COMMENTS
Leading zeros in the 9's complement are omitted.
For palindromes of the form 10^k-1 the corresponding entry is zero. Apart from this the entries are distinct.
LINKS
EXAMPLE
The 20th palindromic number A002113(20) is 101 having 9's complement 898 (999 - 101 = 898). So a(20) = 898. - Indranil Ghosh, Jan 30 2017
PROG
(Python)
# Program for generating the b-file
def a(n):
return 10**len(str(n))-n-1
i=0
j=1
while j<=250:
if i==int(str(i)[::-1]):
print(str(j)+" "+str(a(i)))
j+=1
i+=1 # Indranil Ghosh, Jan 30 2017
(Python)
def A084019(n):
if n == 1: return 9
y = 10*(x:=10**(len(str(n>>1))-1))
if n<x+y:
c = n-x
c = 10**len(str(c))-1-c
return c*x+int(str(c)[-2::-1]or 0)
else:
c = n-y
c = 10**len(str(c))-1-c
return c*y+int(str(c)[-1::-1]or 0) # Chai Wah Wu, Jun 13 2024
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 23 2003
STATUS
approved