login
Numbers k such that the sum of the first k palindromes is a palindrome.
3

%I #19 Jan 31 2020 12:06:17

%S 1,2,3,12,16,47,314

%N Numbers k such that the sum of the first k palindromes is a palindrome.

%H Patrick De Geest, <a href="http://www.worldofnumbers.com/index.html">World!Of Numbers</a>

%e a(n)=47 so 1+2+3+...+373+383 (47 terms) = 7557.

%t palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t = Select[Range[25000], palQ[#] &]; Flatten[Rest[Position[Accumulate[t], _?palQ]]] (* _Jayanta Basu_, Jun 26 2013 *)

%t Position[Accumulate[Select[Range[100000],PalindromeQ]],_?PalindromeQ] // Flatten (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jan 31 2020 *)

%Y Cf. A002113, A046487, A046488.

%K nonn,hard,base

%O 1,2

%A _Patrick De Geest_, Sep 15 1998