Need help with making code work on Mathematica

    Num = 150;     arr = ConstantArray[1, Num + 1];     For[m = 2, m <= Floor[Sqrt[Num/2] + 1], m++,      For[n = 1, n <= m, n++,      If[! OddQ[m + n], If[GCD[m, n] != 1, L = Min[2*m*(n + m), Num];     arr[[L+1 ;; All ;; L]] = arr[[L+1 ;; All ;; L]] - 1]]]]     Num + 1 - Count[arr, u_ /; u != 0] 

this is the question, its suppose to be written in mathematica but this one doesnt work..

Question

It turns out that 12 cm is the smallest length of wire that can be bent to form an integer sided right angle triangle in exactly one way, but there are many more examples.

12 cm: (3,4,5) 24 cm: (6,8,10) 30 cm: (5,12,13) 36 cm: (9,12,15) 40 cm: (8,15,17) 48 cm: (12,16,20)

In contrast, some lengths of wire, like 20 cm, cannot be bent to form an integer sided right angle triangle, and other lengths allow more than one solution to be found; for example, using 120 cm it is possible to form exactly three different integer sided right angle triangles.

120 cm: (30,40,50), (20,48,52), (24,45,51)

Given that L is the length of the wire, for how many values of L ≤ 1,500,000 can exactly one integer sided right angle triangle be formed?

HELP ME !!!

I am facing a weird problem. the URLs contain “%” in it, got broken once I post to the blogs.

After posting, if i click on the link, it says 404, I mean referring to a different page.

Any solution ??

Need Really Help !!!!

I am facing a weird problem. the URLs contain “%” in it, got broken once I post to the blogs.

After posting, if i click on the link, it says 404, I mean referring to a different page.

Any solution ??

Multi Classing Help

I am new to multi classing and new to spells with 5e. Can someone help explain it to me. Currently I am a Level 3 Rogue (Arcane Trickster) and just leveled up to level 4. For my fourth level I was going to put a level into the wizard class as it makes sense for my backstory. My current spells are [Cantrips]: Firebolt, Mage Hand, and light. [Level 1]: sleep, find familiar, and color spray.

My Stats are Str: 11 Dex: 18 Con: 14 Int: 17 Wis: 14 Cha: 7.

Specifically The spell slots is what is confusing me. I am not sure about the calculation for them. According to the PBH I would take my wizard levels (1) and my rogue level / 3 rounded down (1) and add them together for a total of 2.

Then using the table on page 165 it would seem that I’d have 3 first level spell slots.

But that doesn’t make sense to me as I originally had 2 spell slots as an arcane trickster and a first level wizard has 2 1st level spell slots. So would I have 4 spell slots or only 3?

Lastly can I use my spell slots on any of the spells I have (no matter whether it is from the wizard class or the Rogue (Arcane Trickster))?

C++ Help with Separating Axis Theorem

I am trying to detect collision between two triangles using Separating Axis Theorem however I am unaware what is wrong with my code. The CollisionHelper::isTriangleIntersectingTriangle is called every frame and passes in the vertices of both triangles. It never returns true, however. I’ve been stuck on this for days now. Any help is appreciated.

glm::vec3 CalcSurfaceNormal(glm::vec3 tri1, glm::vec3 tri2, glm::vec3 tri3) {     //Subtracts each coordinate respectively     glm::vec3 u = tri2 - tri1;     glm::vec3 v = tri3 - tri1;      glm::vec3 nrmcross = glm::cross(u, v);     nrmcross = glm::normalize(nrmcross);     return nrmcross; }  bool SATTriangleCheck(glm::vec3 axis, glm::vec3 tri1vert1, glm::vec3 tri1vert2, glm::vec3 tri1vert3, glm::vec3 tri2vert1, glm::vec3 tri2vert2, glm::vec3 tri2vert3) {     int t1v1 = glm::dot(axis, tri1vert1);     int t1v2 = glm::dot(axis, tri1vert2);     int t1v3 = glm::dot(axis, tri1vert3);     int t2v1 = glm::dot(axis, tri2vert1);     int t2v2 = glm::dot(axis, tri2vert2);     int t2v3 = glm::dot(axis, tri2vert3);      int t1min = glm::min(t1v1, glm::min(t1v2, t1v3));     int t1max = glm::max(t1v1, glm::max(t1v2, t1v3));     int t2min = glm::min(t2v1, glm::min(t2v2, t2v3));     int t2max = glm::max(t2v1, glm::max(t2v2, t2v3));       if ((t1min < t2max && t1min > t2min) || (t1max < t2max && t1max > t2min))             return true;     if ((t2min < t1max && t2min > t1min) || (t2max < t1max && t2max > t1min))             return true;      return false; }  bool CollisionHelper::isTriangleIntersectingTriangle(glm::vec3 tri1, glm::vec3 tri2, glm::vec3 tri3, glm::vec3 otherTri1, glm::vec3 otherTri2, glm::vec3 otherTri3) {     //Triangle surface normals, 2 axes to test     glm::vec3 tri1FaceNrml = CalcSurfaceNormal(tri1, tri2, tri3);     glm::vec3 tri2FaceNrml = CalcSurfaceNormal(otherTri1, otherTri2, otherTri3);      glm::vec3 tri1Edge1 = tri2 - tri1;     glm::vec3 tri1Edge2 = tri3 - tri1;     glm::vec3 tri1Edge3 = tri3 - tri2;     glm::vec3 tri2Edge1 = otherTri2 - otherTri1;     glm::vec3 tri2Edge2 = otherTri3 - otherTri1;     glm::vec3 tri2Edge3 = otherTri3 - otherTri2;      //axes     //TODO: may need to (un)normalize the cross products     glm::vec3 axis1 = tri1FaceNrml;     glm::vec3 axis2 = tri2FaceNrml;     glm::vec3 axis3 = glm::normalize(glm::cross(tri1Edge1, tri2Edge1));     glm::vec3 axis4 = glm::normalize(glm::cross(tri1Edge1, tri2Edge2));     glm::vec3 axis5 = glm::normalize(glm::cross(tri1Edge1, tri2Edge3));     glm::vec3 axis6 = glm::normalize(glm::cross(tri1Edge2, tri2Edge1));     glm::vec3 axis7 = glm::normalize(glm::cross(tri1Edge2, tri2Edge2));     glm::vec3 axis8 = glm::normalize(glm::cross(tri1Edge2, tri2Edge3));     glm::vec3 axis9 = glm::normalize(glm::cross(tri1Edge3, tri2Edge1));     glm::vec3 axis10 = glm::normalize(glm::cross(tri1Edge3, tri2Edge2));     glm::vec3 axis11 = glm::normalize(glm::cross(tri1Edge3, tri2Edge3));      //Perform SAT     if (SATTriangleCheck(axis1, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis2, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis3, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis4, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis5, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis6, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis7, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis8, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis9, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis10, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;     if (SATTriangleCheck(axis11, tri1, tri2, tri3, otherTri1, otherTri2, otherTri3)) return true;      return false; } 

Does Enhance Ability spell help with saving throws?

Background: I was hoping to use Enhance Ability and its Bear’s Endurance option to speed up our travelling a bit. But now I am not sure if it will work, hence this question.

Enhance Ability – Bear’s Endurance lasts for 1 hour with concentration, and gives advantage on constitution checks (also 2d6 temp HP, but that’s not relevant here). It does not specify "ability check", just "check".

Things like forced march, spell concentration and holding your breath actually call for constitution saving throws (see this related queston).

Does Enhance Ability help with saving throws?

In other words, is Bear’s Endurance useful for the above, or does it only help with constitution ability checks (of which there are precious few, it’s almost always a saving throw)?