OFFSET
0,2
COMMENTS
Partial sums of A136522. [Typo fixed by Colin Barker, Apr 26 2015]
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..20202
FORMULA
a(n) = inv_A002113(A261423(n)), where inv_A002113 is the inverse of A002113, i.e., it yields the index of a palindrome. - M. F. Hasler, Sep 10 2018
MATHEMATICA
palQ[n_]:=Module[{idn=IntegerDigits[n]}, idn==Reverse[idn]]; Accumulate[ Table[ If[palQ[n], 1, 0], {n, 0, 80}]] (* Harvey P. Dale, May 11 2014 *)
PROG
(Python)
def A136687(n):
l = len(s:=str(n))
k = l+1>>1
return n//10**(l-k)-(int(s[k-1::-1])>n%10**k)+10**(k-1+(l&1^1)) # Chai Wah Wu, Jul 24 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Apr 21 2008
STATUS
approved