%I #5 Mar 30 2012 18:40:02
%S 0,-1,2,3,22,151,222,232,323,333,353,37273,77577,7772777,377777773,
%T 5777777775,77777777777,27777777777772,577777757777775,
%U 577777777777775,37777777777777773,2777777775777777772,7777777775777777777
%N a(n) = smallest palindrome > a(n-1) (for n > 0) such that the sum of its prime digits is equal to palindrome with index n, or -1 if none exists.
%C Palindrome with index n is A002113(n).
%e a(0) = 0 since A002113(0) = 0 and the prime digits of 0 sum to 0.
%e a(1) = -1 since A002113(1) = 1 and there is no number (all the more no palindrome) whose prime digits sum to 1.
%e a(5) = 151 since A002113(5) = 5 and 151 is the smallest palindrome > a(4) = 22 whose prime digits sum to 5.
%Y Cf. A002113.
%K base,sign
%O 0,3
%A _Giovanni Teofilatto_, Feb 23 2006
%E Edited, corrected and extended by _Klaus Brockhaus_, Mar 13 2006
%E a(16) and a(19) corrected, a(21) and a(22) added by _Klaus Brockhaus_, May 23 2007
|