Wikipedia:Reference desk/Archives/Mathematics/2007 April 21

= April 21 =

How many different ways can I express 1,-1,1,-1, ... as a one-variable function?
Infinitely many, I suppose, but what I'm looking for is all the interesting variations. For example, f(x) = -1^(x-1) I guess works, but how could I represent this using only modular arithmetic, or trig, or boolean algebra, topology, fractal geometry, or some other area of mathematics that I have never even heard of yet. Basically I'm wondering if there is a list somewhere that shows all the (interestingly) different ways to do it. I know it's not a well-defined question, but I'm curious. NoClutter 00:16, 21 April 2007 (UTC)
 * Ah, but what is interesting? You have stuff like various periodic sine and cosine graphs, you can use f(n)=(-1)n+1, f(n)=-(i2)n=-i2n, or a function you think is interesting enough and when you put a value in you get -1, then power it to n.  If you get bored, look around at this on OEIS.   x42bn6  Talk 00:26, 21 April 2007 (UTC)
 * Is a function for that possible in modular arithmetic? Say f(n) = 2n + 1 (mod 4) which gives 1, 3, 1, 3, ... And 3 ≡ -1 (mod 4), so does this work? –Pomte 00:41, 21 April 2007 (UTC)

How about some infinite series? =).

$$f(x) = \sgn(x) \times \left( \frac{1}{2} + \frac{1}{4} + \frac{1}{8} + \cdots \right)$$

lol.--Kirby♥time 01:24, 21 April 2007 (UTC)

Test question
Hi Reference desk. I got a question on a math test wrong, but I don't know why. I've tried to solve it, but don't understand. I was wondering if you could help. The question is as follows:

How many square meters is 7,000,000 square centimeters ?

[A] 70,000,000,000 m square [B] 7,000 m square [C] 700 m square [D] 0.007 m square [E] None of these

I chose E, thinking the answer is 70,000 (7,000,000 divided by 100 = 70,000). What did I do wrong? Thanks in advance, Nick.


 * A meter is 100 cm, so a square meter is not 100 square cm but 100^2 square cm.
 * Imagine a square with side length 1 meter. How many small centimeter squares fit into this large square? –Pomte 00:43, 21 April 2007 (UTC)

Ah, okay. So it would be 7,000 square meters, with 1,000 square centimeters per square meter. Thank you very much Pomte! Nick.


 * Not quite. 100^2 is 10,000, not 1,000, so there are 10,000 square centimeters per square meter. Gandalf61 14:32, 21 April 2007 (UTC)

Just remember it like this

1 metre = 100 cm

(1 meter)^2 = (100 cm)^2

1^2 meter^2 = 100^2 cm^2

1 meter^2 = 10,000 cm^2

202.168.50.40 01:46, 22 April 2007 (UTC)

Prime Numbers
Is (10^n)+1 always prime for all positive whole numbers?It seems to be as far as I cancalculate. If so, whose law haxe I rediscovered?


 * You have demonstrated the law of laziness. We can, for example, factor 109+1 as
 * $$ 7 \times 11 \times 13 \times 19 \times (\text{a five digit number}) . \,\!$$
 * Furthermore, that factor of 11 will show up whenever n is odd.
 * $$\begin{align}

10^{2n+1} &\equiv 100^n \times 10 + 1 \pmod{11} \\ &\equiv (9 \times 11 + 1)^n \times 10 + 1 \pmod{11} \\ &\equiv (9 \times 0 + 1)^n \times 10 + 1 \pmod{11} \\ &\equiv 1^n \times 10 + 1 \pmod{11} \\ &\equiv 10 + 1 \pmod{11} \\ &\equiv 0 \pmod{11} \end{align}$$
 * No simple formula is known to guarantee primes, but this one fails early and easily. --KSmrqT 03:36, 21 April 2007 (UTC)
 * The Fibonacci sequence has something with primes (not the actual sequence, but something that uses it). -- TeckWiz is now R Parlate Contribs@(Lets go Yankees!) 03:39, 21 April 2007 (UTC)
 * Actually, as formula for primes mentions, there is a simple formula for primes of the form floor(A3 n ), where A is Mills' constant. But perhaps what KSmrq meant is that there is no simple and easily computable formula... Mills' formula is not easily computable, because it's much easier to generate primes by other means than to calculate A sufficiently accurately to use the formula. —David Eppstein 04:06, 21 April 2007 (UTC)
 * I pondered what phrase to use, and decided "simple" was simplest. ;-)
 * Even so, I'm sure I spent more time in answering the question than was spent in generating it. Ah, well; primes seem to hold an endless fascination for some folks. We should mention Mersenne primes, which presently have no serious competition as the largest known primes. However, these numbers, of the form 2p−1 (where p is a prime) are not guaranteed to be prime; hence the Great Internet Mersenne Prime Search (GIMPS).
 * I mention the factor of 11 for three reasons. First, it demolishes the proposal by eliminating half of the candidates at one stroke. Second, it gives me another chance to illustrate the utility of ring homomorphisms from the integers to the integers modulo n, which I mentioned in response to a recent post. And third, it rewards those who know this supplemental variation of casting out nines.
 * For, casting out elevens is almost as easy, and another handy check on arithmetic. Where casting out nines sums all the digits, casting out elevens alternately adds and subtracts. Consider 267583; working from right to left, we have 3−8+5−7+6−2 = −3, which is congruent to 8 modulo 11. Thus any number of the form 10…01, with an even number of zeros, is immediately seen to be divisible by 11. (It's interesting to note that the designers of ISBN-10 knew that this check catches digit transpositions, a common mistake that ISBN-13 does not guard against.) --KSmrqT 07:54, 21 April 2007 (UTC)


 * Kenneth Rosen's "Elementary Number Theory and its applications" states that no polynomial in n (n a positive integer) variables generates only primes and says the proof is beyond the scope of the book. StatisticsMan 05:41, 23 April 2007 (UTC)
 * Formula for primes gives a proof in three lines, but I suppose it's not quite elementary. Algebraist 16:21, 23 April 2007 (UTC)