A032789 Numbers k such that (k*(k+1)*(k+2)) / (k+(k+1)+(k+2)) is a palindrome.
0, 1, 3, 4, 9, 21, 42, 99, 154, 237, 405, 999, 9999, 18991, 19291, 22021, 23587, 40293, 45072, 99999, 137652, 999999, 1278343, 1360456, 3162199, 3162499, 4029705, 4365396, 4418236, 6052891, 9999999, 31496589, 40289205, 41276535, 44295036, 56353251, 99999999
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..48
Programs
-
Mathematica
palQ[n_]:=Module[{c=(2n+n^2)/3,id},id=If[IntegerQ[c],IntegerDigits[c],{1,2}];id==Reverse[id]]; Select[Range[0,10^7],palQ] (* Harvey P. Dale, Sep 02 2015 *)
-
Python
from itertools import count, islice def ispal(n): s = str(n); return s == s[::-1] def agen(): for k in count(0): q, r = divmod(k*(k+2), 3) if r == 0 and ispal(q): yield k, q print([k for k, q in islice(agen(), 31)]) # Michael S. Branicky, Jan 24 2022
Extensions
Definition clarified by Harvey P. Dale, Sep 02 2015
a(32) and beyond from Michael S. Branicky, Jan 24 2022
Comments