« first day (3297 days earlier)      last day (1184 days later) » 

9:10 AM
check[x_] := If[x == -1, 1, 0];
{-(1/((check[{##}[[6]]])[[1]] (1 - d) + (check[{##}[[3]]])[[
1]] d))} & @@@ {{0, 0, -1, 1, 0, -1}, {0, 0, -1, 1, 0, 0}, {0,
0, -1, 1, 1, -1}}
This is the result:
{{-(1/((1 - d) 1[[1]] + d 1[[1]]))}, {-(
1/((1 - d) 0[[1]] + d 1[[1]]))}, {-(
1/((1 - d) 1[[1]] + d 1[[1]]))}}
Part::partd: Part specification 1[[1]] is longer than depth of object.
Why does this happen?
I want to get the values of third and sixth element of each list.
 
9:40 AM
hm I found the problem
 
 
4 hours later…
1:21 PM
How can I make background of a plot?
For example I want to make this plot with black background.
Plot[{Sin[2*x], Cos[3*x]}, {x, 0, 1}, Filling -> Bottom]
Filling doesn't have any option to fill the whole area.
 
@anhnha Note that any option that Graphics accepts, Plot accepts too. So you may use Background as documented for Graphics.
 
Thank you. It works.
 
 
3 hours later…
4:44 PM
Hi, I don't have mathematica I was just playing with wolframalpha.com so I don't think posting a question is in place but was wondering if maybe here I could get a little help
I wanted to calculate the continued fraction of $[1/2,1/3,1/5,1/7,...]=? $ where the terms are the prime numbers, from another question I found that I need to write FromContinuedFraction[{1/2, 1/3, 1/5, 1/7}] but haven't found how I could add the first n primes automatically instead of manually, is that possible in wolframalpha?
 
@DanielD. I'm not sure if you can do that easily in Wolfram Alpha, so I wrote a small function to do it for you on the cloud: wolframcloud.com/obj/ba2a99ca-5040-4ca6-8726-a0f2cf970e22
n is the max prime you want, so eg 4 will give you FromContinuedFraction[{1/2, 1/3, 1/5, 1/7}], 6 will give you FromContinuedFraction[{1/2, 1/3, 1/5, 1/7, 1/11, 1/13}], and so on.
Here's the source, in case it does something for anyone:
CloudDeploy[
 FormFunction[{"n" -> "Integer"},
  FromContinuedFraction[Table[1/p, {p, Table[Prime[a], {a, #n}]}]] &],
  Permissions -> "Public"]
And here is the value plotted up to n=500:
And here's a relevant Math.SE post that also talks about this :) math.stackexchange.com/questions/483093/…
( just did it for the first million primes and got 1.4463. In that Math.SE post they suggest another approach that shows the value around 1.31072836773768, so using this approach you would probably need to use many more primes than we have time for ;)
I notice now that you in fact commented on that Math.SE post a few times!
 
6:02 PM
wow that was pretty fast just 6 mins after and yes exactly I was thinking in that question, I made another one asking about how to prove the known result that [1,1/1,1/2,1/3,1/4,..] =pi/2 where the terms are the reciprocals on the natural numbers I received two proofs and I was trying to see if I could adapt the second one to the case of the reciprocals of the primes
thank you very much this is very helpful
 
 
2 hours later…
9:04 PM
@DanielD. Happy to help! Most of this Real Maths stuff is totally opaque to me so I was glad to find something I could vaguely understand and help with :)
 
10:06 PM
@CarlLange Is opaque to me too but as you say it may be difficult to prove but is easy to understand so it got me relatively hooked, I had thought about it sometime ago and then forgotten about it and now it came back to my mind once again, I'm just trying my luck before someone solve it.
now I realize that if I understand correctly the code should be using your own space that I suppose you pay for on wolfram so if you need to save it please just do it, I have bookmarked the permalink to your message so that I can access the code later and try to reproduce the it myself if not on mathematica maybe octave
 
10:30 PM
@DanielD. It's no problem, I'm happy to leave it there for a couple of months. If it disappears, just ping me.
The cost of it is nanopennies, it's not an issue at all.
 
10:50 PM
@CarlLange great! thank you very much once again
 

« first day (3297 days earlier)      last day (1184 days later) »