MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Numbers and their reversals

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53706] Re: Numbers and their reversals
  • From: "Scout" <user at domain.com>
  • Date: Mon, 24 Jan 2005 03:37:27 -0500 (EST)
  • References: <csvia0$asu$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Let
     n * k = z
     Rev(n) * k = Rev(z)

--------------------------------------------------------------
ris={}; (* list of results in the form {number n, constant k} *)

Do[

    If[Mod[n,10]¹ 0, (* no closing zeroes *)

    nr=FromDigits[Reverse[IntegerDigits[n]]];

    Do[

            z=k*n;

            zr=FromDigits[Reverse[IntegerDigits[z]]];

            If[zr¹ z, (* no palindromes *)

                If[nr*kSzr,AppendTo[ris,{n,k}]]

            ],{k,2,99} (* first and last k *)

    ]

    ],{n,11,101} (* first and last n *)

];

Print[ris];

-----------------------------------------------------

That's all.

~Scout~



"F. omari"
>
> 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
>
> 


  • Prev by Date: Re: Re: PlotLegend not an option for PLot? 5.1
  • Next by Date: Re: Preventing Times[x,x] from becoming Power[x,2]
  • Previous by thread: Re: Numbers and their reversals
  • Next by thread: Re: Numbers and their reversals