« first day (1 day earlier)      last day (1223 days later) » 

02:08
@NathanMerrill oeis.org/A052149 - 52149 in decimal is 1100101110110101 in binary.
And the name is - surprise! - "Nonsquare rectangles on an n X n board."
It's also our room number
... ooooooh...
Anyways, I still cant think of a good name for the room, so I'll keep playing with that number
It's neat how the last three digits are squares.
"Primes and Squares"?
Sure. I'll see how it sits
room topic changed to Primes and Squares: For discussion about programming, math, and science, and related topics. Not about PPCG (the site itself) or golfing. (no tags)
02:33
> Square Primes
Well my first implementation of a quantum string gave wildly incorrect answers for superpositions.
I guess my approximation didn't work out so well.
03:07
@NathanMerrill That last one - holy crap!
03:33
So... I have an object with a known initial velocity and known acceleration. How do I solve for its trajectory when the magnitude of acceleration is constant and is at a fixed angle relative to velocity?
When angle = 0 or 180, it's linear acceleration, when angle = 90 it's circular motion.
Those are the easy cases.
Well, technically, isn't it circular motion in all non-linear cases?
Erm...now I'm not sure since we're talking about acceleration.
Oh, it'll be a spiral.
is it a spiral?
actually, this doesn't sound all that dissimilar to the different types of conics
but I'm just throwing out guesses
@PhiNotPi Specifically, a logarithmic spiral.
03:51
@El'endiaStarman yes, this looks like a logarithmic spiral
I just solved it out.
wait... maybe I made a mistake
04:10
logarithmic spiral confirmed
Did you write a simulation for it?
redid all my math
actually.... I did the math correctly but misinterpreted it... the object's velocity vector follows an exact logarithmic spiral
04:46
I'm gonna have to take a break from this problem.
Losing sleep over it? :P
 
5 hours later…
09:47
@PhiNotPi that seems to be a differential equation. Let x be the position, v = x' be the velocity, and a = v' = x'' be the acceleration. you want the angle (i.e. the scalar product) between v and a to be constant, that means (v/||v|| , a/||a||) = (x'/||x'|| , x''/||x''||) = const. This does not seem to be trivial to solve. And I'm not sure whether a logarithmic spiral actually solves this. (there the angle between the velocity and the origin is constant)
(here x(t) is a vector and (...,...) a scalar product)
10:03
Such MathJax, wow
 
6 hours later…
15:36
rotation of the 1st harmonic of a quantum wavefunction: gist.github.com/PhiNotPi/325d76a5466c029e802469d4d9b71dc9
I'm very happy with the accuracy.
What is a harmonic?
Same sense as in music, the 1st harmonic is the base frequency, 2nd harmonic has 1/2 the wavelength, 3rd has 1/3 the wavelength, etc.
so each step is one part of the rotation?
yes
And the first and last lines are identical
What is the significance of the 5 points? I mean, why 5 in one rotation?
15:51
That's just how long I made the string for that simulation.
Is it supposed to be a straight line?
Hi
What were you talking
@KritixiLithos I'm not sure what you're asking?
here's my issue with superpositions:
< 0.00000, 0.00000>  < 0.70711, 0.00000>  < 1.00000, 0.00000>  < 0.70711, 0.00000>  < 0.00000, 0.00000>
< 0.00000, 0.00000>  < 0.70370, 0.06931>  < 0.99518, 0.09802>  < 0.70370, 0.06931>  < 0.00000, 0.00000>
< 0.00000, 0.00000>  < 0.69352, 0.13795>  < 0.98079, 0.19509>  < 0.69352, 0.13795>  < 0.00000, 0.00000>

< 0.00000, 0.00000>  < 1.00000, 0.00000>  < 0.00000, 0.00000>  <-1.00000, 0.00000>  < 0.00000, 0.00000>
< 0.00000, 0.00000>  < 0.92388, 0.38268>  < 0.00000, 0.00000>  <-0.92388,-0.38268>  < 0.00000, 0.00000>
the first two blocks added pair-wise should equal the third block.
They appear to be following that rule
16:07
but not exactly... the error builds up way too quickly
0.69352 + 0.70711 - 1.40786 = -0.00723
I might need to look at higher-order approaches.
and/or use much smaller time steps
That is what I get when I plot all the points and it seems more or less constant to me
which points did you plot?
All of them
in my original gist? Or the points I just posted above
I multiplied them by 100 so that they would be visible
The original gist
16:14
The original gist points are fine and aren't the problem
Oh, so your issue is with the points you posted above
Those are messy...
In what ways do the points from the gist actually differ from the points you posted above? Can't you apply the same method you used for the gist points here too?
The first two blocks are simulations of the 1st and 2nd harmonic, respectively. They are pretty much perfect. The third is the sum of those two harmonics, and there are some errors in it.
@PhiNotPi Are you using the Euler Method? You might be better off with a Runge-Kutta method: en.wikipedia.org/wiki/List_of_Runge%E2%80%93Kutta_methods
16:26
@El'endiaStarman I'm actually using a bizarre method of my own creation to make pure harmonics run perfectly.
Oh boy. What's the gist of it?
For each point on the string, I calculate its current velocity and current acceleration (I'm referring to the trajectory of a complex number on the complex plane).
Now, the problem is that, when I discretize a cosine wave, the values for acceleration/velocity for the individual points don't match up with what the values should be.
for example, halving the wavelength should quadruple the velocity, but it doesn't when you calculate it using discrete points.
for example, the wave (0,1/sqrt(2),1,1/sqrt(2),0) should have twice the velocity of (0,1,0)
But here, the velocities are actually calculated to be 1/sqrt(2)-1 = -29289 and 0-1 = -1 repsectively
so I basically had to write an equation that relates the calculated velocity to the real velocity
@PhiNotPi I'm not sure I follow. Aren't those the same wave? The former has five points and the latter has three.
@El'endiaStarman First wave has wavelength 8 and second has wavelength 4.
I perform v^2/a to determine which point the complex number is rotating around, and then perform a bunch of corrections to figure out how fast the complex number is rotating.
it's really a mess
I need to leave now... I might be back in an hour or so?
17:08
^ reallyc ool idea: in contary to fourier series the direction of rotation switches at each stage
^^ My own creation, using basically the same idea(s).
@El'endiaStarman Really nice!!
I just found it on reddit with a link to this guy
I made it after discovering HAKMEM. (Specifically, item 123 - Fourier clocks.)
17:12
@El'endiaStarman what is this?
btw: I was recently looking for a way to parametrize the mandelbrot set. And Perhaps this migth lead to something, as the first big "blob" contains a cardioid!
@flawr A bunch of interesting problems and ideas.
(I though a parametrization would be nice for drawing buddhabrot images, as we there need the points that diverge, but do so very slowly. These are the points that are very close to the border of the set.)
@flawr What do you mean by "parameterize"?
@El'endiaStarman Find a function f : [0,1] -> {border of mandelbrot set}, preferably continuous and surjective
That seems terrifyingly hard.
IIRC the Mandelbrot set is connected, meaning that all points within the set can be reached from another point in the set by passing through points within the set.
Which I suppose does mean that it has a border, but still, seems like it'd be really hard to figure out a parameterization.
17:22
20
Q: Parametrization of the boundary of the Mandelbrot set

David RichterDoes anyone know how to parametrize the boundary of the Mandelbrot set? I am not a fractal-geometer or a dynamical systems person. I just have some idle curiosity about this question. The Mandelbrot set is customarily defined as the set $M$ of all points $c\in\mathbb{C}$ such that the iterates...

Too bad it converges only very slowly.
hey, I'm considering having "states" for classes. A good example is a File class: It can have the "unopened", "opened", and "closed" states. Certain methods could be defined as unavailable/available under certain states, which would require a check for that state unless the compiler can deduce the state
@NathanMerrill That actually sounds a lot like the State pattern that I'm currently reading about: gameprogrammingpatterns.com/state.html
right. It's useful when you have a finite number of states
though, I may call it something other than "state", as that often refers to the entire state of the class, including variables
also, on a completely different tangent: I had no idea favorite rooms was a thing
but its so useful
I know right, you can rejoin all your favourite rooms once you come back
@NathanMerrill So you're thinking of making it a language feature?
17:36
well, it'll be a subfeature of my attributes type checking
you can already write methods that work when parameters have certain attributes
but it'll be special syntax to make it easier, I think
18:31
Thanks for the inspiration :)
@KritixiLithos Oh, I like that. How'd you make it?
Huh, that actually looks a lot like Blitz 2D.
Changing the red to 255,100,100 and the blue to cyan gives even better results (brighter colours)
How hard is it to draw lines instead of dots?
18:42
Do you mean drawing a curved line or a straight? The latter is the easier of the two.
I'm basically drawing a point at each circle's centre at every frame. But by increasing the width of the points, the overall pattern looks more like a line
@KritixiLithos Haha, yeah, the latter is definitely easier (and it's what I meant).
All I need to do is to store the positions into an array (length 2 to keep it simple), and draw a line from the current pos to the previous pos while updating the array with the newer positions.
Yeah, pretty much.
19:19
Looking at this chatroom as an experiment, I'd say that it has been going well. I'm finding the conversation here more interesting and more worthwhile than on TNB
Even though I haven't found time to participate yet, I have been following the conversation and I agree. It will be interesting to see how this room develops as more people become aware of it.
I definitely like this room a lot more than TNB right now. I feel like this room is, in a way, like what TNB used to be. A year ago, there was definitely a lot more "noise", but at the same time, users were better at prioritizing interesting conversations.
I like the idea of changing the room topic.
(although I'm not entirely sure what primes and squares entails)
@quartata It's a reference to the room number.
The digits are primes or squares.
Well now I feel dumb. I had seen the name change a few times based on the topic so I assumed that was the case here too..
19:31
At least you didn't have to suffer through Nathan making you figure it out. ;)
It used to be "Nonsquare rectangles on an n X n board" and then "1100101110110101". The latter is 52149 in binary, and the former is the title of OEIS sequence A052149.
But the first was something you were talking about I thought. The zoning game thing.
24 hours ago, by Nathan Merrill
@KritixiLithos nope. It was inspiration for my koth, not the other way around
@NathanMerrill How will you know what state the object is in a compile time
I thought much the same as you.
hahahaha
 
2 hours later…
21:27
@quartata @El'endiaStarman Traits (I said attributes earlier mistakenly) are declared with a variety of "proofs", and can also be attached to a variable type or a return type.
So, for example, the trait "positive" has a proof of "T>0"
If you make that check, or the exact value is known, and it passes that check, then you know that trait at compile time
For my earlier example, the proof of a file being in the open state is either calling the method open() or can be checked via isOpen()
Alternatively, you could also have a function that returns a File[FileState=Open]
22:21
@KritixiLithos Ha, I just started playing around with it too=)
I like where this is going. :D
22:40
A line which turns at 90 degrees counter clockwise at primes.
Yeah, I saw that Math.SE question. Amazing stuff.
What would it look like if it turned 60 degrees instead of 90?
It looks like America-
I want to know this.
I think I've written a piece of code for my challenge proposal.
Let me see.
(I'm still feeling guilty for stealing this idea.)
At n<=30k
How are you generating these?
22:46
LÖVE2D code.
n<=3k
That's pretty cool. What about 120 degrees (n <= 30k)?
@ATaco There was a SE question about that, someone answered with an incredibly detailed picture
I am aware.
That's why I wrote this code.
It's interesting that there's a right turn at the end there.
Because uh, that shouldn't be possible.
which question was that?
222
Q: Help with a prime number spiral which turns 90 degrees at each prime

KarlI awoke with the following puzzle and I would like to investigate but the answer may require some programming (it may not either). I have asked on the meta site and believe the question to be suitable and hopefully interesting for the community. I will try to explain the puzzle as best I can th...

22:51
Should I bring up the idea of using 60°..?
What do you mean?
This answer has stuff on multiple angles.
Oh, I didn't notice that.
To be fair, it wasn't there last time I looked at that question. :P
@ATaco do a change of direction depending whether a prime is 3 mod 4 or 1 mod 4 :)
That's interesting.
n<=3k moving CCW at n%4==3 and CW at n%4==1
at 60d
22:57
Ooooh, interesting...
Does this pattern have any special properties compared to other random walks?
It looks cool.
And has mathmatical basis.
What would happen if you changed direction based off of the prime mod 360?
When I get pack to a computer, in about 3 minutes, I'll show you
@PhiNotPi I was about to suggest to ATaco that they do the path-drawing part but with random odd numbers when I realized that the spacing between primes is responsible for this pattern, so it's not really that easy to specify a random distribution that has approximately the same distribution.
23:08
There's some kind of systemic error occurring with my current quantum simulator, and I can't figure out how to fix it.
First thirty thousand primes in which dir is = n%360 at each prime.
Not very interesting, but neat.
This is the same, yet it only moves forwards by one anytime it hits a prime.
@ATaco Hmm, I guess that makes sense. Primes modulo 360 are probably fairly evenly distributed.
@El'endiaStarman I think mod 360 they are rather oddly distributed
:D
Why
23:12
@flawr Ugh.
Although any progression in that one may be considered a rounding error because Lua.
math.cos(math.rad(90))==6.1230317691119e-017
Thanks.
@ATaco not too bad=)
It's really close to 0 I guess.
But uh, I need it to be 0.
Probably as close as you can get.
@ATaco I think that's too small to really have an effect on anything.
23:13
You'd think.
After the first 10^17 primes you're probably gonna notice the effect.
This line only exists at angles 270 and 90
And yet, as can be seen, it clearly progresses either right or left (Hard to tell where the start is)
I have discovered it is moving right to left.
Lua makes me sad sometimes.
I could hardcode all 360 values of cos and sin and interpolate between decimals for more accurate results.
Which is kind of sad.
I'm still not convinced that that ~10e-17 error is the problem.
print(math.cos(math.rad(dir)),math.sin(math.rad(dir)),dir)
x = x + math.cos(math.rad(dir))
y = y + math.sin(math.rad(dir))
Which gives values to STDOUT...
6.1230317691119e-017	1	90
-1.8369095307336e-016	-1	270
< 0.00000, 0.00000>  < 1.70711, 0.00000>  < 1.00000, 0.00000>  <-0.29289, 0.00000>  < 0.00000, 0.00000>
640< 0.00000, 0.00000>  < 1.71325,-0.11184>  < 1.00154,-0.16934>  <-0.28538,-0.11039>  < 0.00000, 0.00000>
23:18
OH
I see where my issue kind of lives.
^^ the above is the initial data and the bottom is what I end up with after 1 full rotation, they should ideally match but don't.
Although it would be unnoticeable to the human eye, I've been auto fitting the walk between the minx and maxx as well as miny and maxy
6400< 0.00000, 0.00000>  < 1.70168,-0.11169>  < 0.98473,-0.16511>  <-0.29671,-0.11135>  < 0.00000, 0.00000>
So, although the actual amount is ~0, I've automatically exaggerated the effect.
furthermore, dividing the timestep by 10 makes almost no difference.
23:19
@ATaco Oh yeah, that would do it.
One solution is to fix or at least cover the issues brought on by Lua's math module.
The other, is to remove my auto-exaggeration and just ignore it.
Okay that's awesome.
@ATaco I think this is the better option. If you manage to produce a line that doesn't move horizontally at all, then what will the auto-scaling do?
the first 10^4 primes with angles from 2*pi/3 to 2*pi/4
23:22
Probably nothing, seeming as Lua is happy with me doing n/0 and will simply refuse to draw a line with an x coord of nan.
Now it does that.
Hazzar
What exactly are you trying to do?
I think an even better option is to auto-scale when the line wanders over a fairly significant region of space. I.e. the extremes are more than 1 pixel apart or whatever.
Dir is set to n%8 * (360/8) at primes.
n<=3k dir=(dir+1)%i where i = [1,8]
user image
6
primes up to 10^4 with angle varying from 0 to 360, scaling the whole path such that the first and the last point are fixed.
@flawr Okay, that's clever and fun to watch. Did you just normalize it so that the start and end are anchored to the same pixels?
23:33
Are you using mathematica because that's cheating
Nope I'm using Matlab
EQUALLY CHEATING
I think I have to eat some chocolate to compensate for my guilt of cheating.
It feels like a living thing...
@El'endiaStarman It is just such an easy thing to do with complex numbers: Just divide every intermediate one by the very last.
I wonder if there is such a thing as a maximal displacement, or if such a sequence stays bounded within a certain area for all upper bounds and all angles.
I find it implausible that the sequence could be bounded.
Oh, that's easy to prove, isn't it? There are arbitrarily long sequences of [n!+2, n!+3, ..., n!+n].
@El'endiaStarman I did not express myself that clearly sorry
I mean if you look at the sequence of images in the gif.
The line always stays withing some box.
And I wondered if that box is bounded if you consider all upper bounds of primes (not only 10^4)
23:46
If you anchor the start and end points, then of course it's bounded.
Couldn't it still be unbounded if the path returns close to the origin arbitrarily often?
(Assuming not restricting to just 10^4)
@El'endiaStarman I thought when we also vary the number of primes i.e. the first 100 primes, the first 101 primes etc...
@trichoplax Hm, if the path actually returns to the origin it is obviously unbounded.
Each time it reaches a new most distance point, and then returns close to the origin, the image will be magnified as it approaches the origin and make the most distant point a new outer bound
Right. It now would be interesting to know whether it actually returns to the origin at some point for some angle=)
Oh...you're basically asking if there's a maximum ratio between the greatest displacement from the origin and the displacement between the start and end points?
23:51
@flawr Well yes :)
@El'endiaStarman Right=)
Are we including the prime 2?
It is kinda the (ahem) odd one out...
This is a line showing the end points of all prime spirals with rotations periods from 0 through 360 inclusive.
For primes n <= 300
Lowering or raising this number always looks roughly the same.
Primes n <= 30
And n <= 3000
@ATaco Probably needs more sampling=)
For that last one, yes.
However, if I only look at Degrees [90,270], I get.
Equally symmetrical, Equally chaotic.

« first day (1 day earlier)      last day (1223 days later) »