A217789 Least difference between 2 palindromic numbers of length n.
1, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
Offset: 1
Examples
a(1)=1 for instance 8-7. a(2)=11 for instance 22-11. a(3)=10 for instance 111-101. a(n)=11 for n >= 4, for instance 2002-1991, resp. generalization to n digits (cf. comment).
Links
- Cédric Villani, Les défis mathématiques du Monde, épisode 1 : les palindromes
- Index entries for linear recurrences with constant coefficients, signature (1).
Programs
-
PARI
A217789(n)=11-(n==3)-(n==1)*10 \\ [M. F. Hasler, Mar 25 2013]
Formula
G.f.: x*(1+10*x-x^2+x^3)/(1-x). [Bruno Berselli, Mar 25 2013]
Comments