MathGroup Archive 2005

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

Search the Archive

A list of numbers without "73"

  • To: mathgroup at
  • Subject: [mg63005] A list of numbers without "73"
  • From: "Thomas Schmelzer" <thomas.??? at>
  • Date: Sat, 10 Dec 2005 06:03:40 -0500 (EST)
  • Organization: Balliol College
  • Reply-to: "Thomas Schmelzer" <thomas.??? at>
  • Sender: owner-wri-mathgroup at


S(i) should be a list of positive integers without the substring "73".

My code seems to be very inefficient. I multiply all numbers with 0 if they 
contain "73", sort the new list, make the union (remove double elements) and 
delete the first element. Therefore it is necessary to use an if statement 
in order not to delete the first element of the numbers 1-9. Any more 
sophisticated ideas?

L := Table[k, {k, 1, 9}]

S[i_] := S[i] =
If[i == 1, L,
Table[k*(1 - Boole[StringMatchQ[ToString[k], "*73*"]]), {k,
10^(i - 1), 10^i - 1}]], 1]]



  • Prev by Date: Re: Types in Mathematica
  • Next by Date: Re: Skewness problem
  • Previous by thread: Re: Assign a value to a variable
  • Next by thread: Re: A list of numbers without "73"