Re: Numbers and their reversals

*To*: mathgroup at smc.vnet.net*Subject*: [mg53705] Re: [mg53687] Numbers and their reversals*From*: Bob Hanlon <hanlonr at cox.net>*Date*: Mon, 24 Jan 2005 03:37:26 -0500 (EST)*Reply-to*: hanlonr at cox.net*Sender*: owner-wri-mathgroup at wolfram.com

reverseDigits[n_Integer] := FromDigits[Reverse[IntegerDigits[n]]]; f[m_Integer, maxRange_Integer:3000] := Select[Range[maxRange], reverseDigits[#]*m==reverseDigits[#*m]&]; f[17] {242,484,2420,2442,2662,2684} f[17,5000] {242,484,2420,2442,2662,2684,4840,4862} Length[f[91]] 746 Bob Hanlon > > From: "F. omari" <towtoo2002 at yahoo.com> To: mathgroup at smc.vnet.net > Date: 2005/01/23 Sun AM 02:02:17 EST > To: mathgroup at smc.vnet.net > Subject: [mg53705] [mg53687] Numbers and their reversals > > > i want to investigate the following two equations: > a * const = z > a_Reversed * const = z_Reversed > where a, z, and their reversed form and const are all positive integers > ie such that: > 2684 * 17 = 45628 > 4862 * 17 = 82654 > 2986 * 91 = 271726 > 6892 * 91 = 627172 > it happened that many multipliers of 91 have such a property. > while the multipliers of 17 have only 5 cases in the interval of 1 to 3000 > the following code will investigate the multipliers of 17, to investigate another number just replace 17. and you may increase the interval of investigation. i am sure that my code is an old fashion one, please any other ideas about a more functional code. > a = Table[i, {i, 1, 3000}]; zR = ""; aR = 0; z = ""; > Do[aR = ToExpression[StringReverse[ToString[a[[i]]]]]; > z = ToString[a[[i]]*17]; > zR = StringReverse[ToString[aR*17]]; > If[zR == z, Print[a[[i]]]], {i, 1, 3000}] > > 242 > 484 > 2442 > 2662 > 2684 > regards > > >