%I #59 May 18 2024 21:39:27
%S 0,1,1,2,3,5,8,55
%N Palindromic Fibonacci numbers.
%C Also, Luca proved that 0,1,1,2,3,5,8,55 are the only Fibonacci numbers containing a single distinct digit.
%C Probably 55 is the last term. Indices of the palindromic Fibonacci numbers are 0,1,2,3,4,5,6,10. - _Robert G. Wilson v_, Jun 29 2007
%C There are no further terms up to Fibonacci(10^8), found in 36 processor minutes. Note that one typically only needs to check a few digits at the start and the end to rule out being a palindrome. - _D. S. McNeil_, Dec 30 2010
%H Florian Luca, <a href="http://www.emis.de/journals/PM/57f2/9.html">Fibonacci and Lucas numbers with only one distinct digit</a>, Portugal. Math. (2000) 57 (2), 243-254.
%e 55 is the 10th Fibonacci number and it is also palindromic in base 10.
%t fQ[n_] := Block[{id = IntegerDigits@ Fibonacci@ n}, id == Reverse@ id]; lst = {}; Do[ If[ fQ@n, AppendTo[lst, n]], {n, 0, 1000}]; Fibonacci /@ lst (* _Robert G. Wilson v_, Jun 29 2007 *)
%t SelectFibonacciPalindrome[n_] := Select[Table[Fibonacci[i], {i, 0, n}], PalindromeQ]; SelectFibonacciPalindrome[1000] (* _Navvye Anand_, May 11 2024 *)
%o (Magma) IsPalindromic := func<Fn|forall{i:i in[1..d div 2]|digit_seq[i]eq digit_seq[d+1-i]}where d is #digit_seq where digit_seq is IntegerToString(Fn)>; [Fn:n in[1..10^4]|IsPalindromic(Fn)where Fn is Fibonacci(n)]; /* _Jason Kimberley_, Dec 29 2010 */
%o (PARI) ispal(n)=my(d=digits(n));for(i=1,#d\2,if(d[i]!=d[#d+1-i], return(0))); 1
%o is(n)=my(k=n^2); k+=(k+1)<<2; n >= 0 && (issquare(k) || issquare(k-8)) && ispal(n) \\ _Charles R Greathouse IV_, Feb 04 2013
%Y Cf. A000045, A002113, A372729.
%K nonn,base,more,hard
%O 1,4
%A _Jeff Burch_
%E Edited by _Max Alekseyev_, Oct 09 2009