Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Yet another simple question.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47148] Yet another simple question.
  • From: gtsavdar at auth.gr (George)
  • Date: Sat, 27 Mar 2004 01:35:14 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

As i'm new to this amazing world of Mathematica, i'm not able yet to
do
simple things that for an experienced user seem ridiculous.

 So i want to ask a simple question. If:
+++++++++++++++++++++++++++++++++++++++++++++++
y,m,day : integer positive variables

yr,mr   : integer positive variables which depend on y and m

fff[day_] = Mod[day + 2*mr + Quotient[3*(mr + 1), 5] + yr + 2 + 
Quotient[yr, 4] + Quotient[yr, 400] - Quotient[yr, 100], 7];
+++++++++++++++++++++++++++++++++++++++++++++++

 Now for a specific day=D i want to find the value of the integer
variable Q which belongs to (D,D+7], so fff[Q]=1 would be true.

So i write: 

Do[Q = Which[fff[x] == 1, x], {x, D + 1, D + 7, 1}]

and i expect Q to take the appropriate value. But this doesn't work.
Can anyone show me the way to the light?

Thank you.


  • Prev by Date: Re: exporting fonts in postscript
  • Next by Date: Re: NDSolve Repeated convergence test failure
  • Previous by thread: Re: solving nonlinear equation with mathematica !!
  • Next by thread: Re: Yet another simple question.