The Stack Overflow podcast is back! Listen to an interview with our new CEO.

All Questions

Filter by
Sorted by
Tagged with
2
votes
2answers
284 views

How can I solve the Ramanujan problem by using Wolfram language? [on hold]

The problem like this: find all integers n, 1 ≤ n ≤ 10, 000 such that n is the sum of two cubes of positive integers in two different ways. I want to solve the problem as a procedure in mathematica.
2
votes
1answer
37 views

how to run a specific cell in a notebook from another notebook

I have a long Mathematica code in a notebook, denoted by NB1. Since it is a very long code, and I need only some of the outputs from NB1 to be used in another ...
0
votes
1answer
56 views

How to make a table for loops?

I have a code given by ...
3
votes
1answer
431 views

Iterating FindRoot to solve a differential equation

I am new to Mathematica style programming, better at traditional programming. I would like to know if I can create a table of results using FindRoot, where the ...
4
votes
5answers
299 views

How to build these functions without nested For loops?

I am trying to solve the 8-puzzle using two heuristics, which are: Pieces out of place and Distance Manhattan. After consulting several websites for example see and some books, I'm with some doubts, ...
0
votes
1answer
283 views

Collatz Conjecture [duplicate]

By definition of Collatz Conjecture or $3n+1$, regardless of the sequence (ie.$ m1,m2,m3....mn$), at the end, it eventually produces 1 at the end. For example, if ...
1
vote
1answer
404 views

Allan Deviation Algorithm

I am trying to write my own Allan Deviation calculator in Mathematica using the definition, $$\sigma(\tau)^{2}=\frac{1}{2M-2}\sum_{i=1}^{N-1}(\bar{y}_{i+1} - \bar{y}_{i})^{2}\text{.}$$ Where the $\bar{...
1
vote
1answer
156 views

Add two functions in a table with the same variables

How can I print the values of the function expere in the table of the function exper ... Note that I use this code ...
-1
votes
1answer
101 views

Repeating Calculations/Iterations without a specific function

I am trying to repeat an initial condition many times such that I get a desired final output. ONE final output depends on many subsequent calculations from ONE initial condition. But I want to get a ...
1
vote
1answer
83 views

Challenging antiderivative loop

I am attempting to create a loop (either Do, For or While) that will continue to take antiderivatives of f(x)= x until the area under it between 0 and 10 is greater than 1000. And whichever function ...
56
votes
5answers
6k views

Are there any cases when For[] loops are reasonable?

To my mind the only reason for the existence of For[] loops in Mathematica is to allow new users with some experience in procedural programming languages to write ...
8
votes
1answer
217 views

How would one return from a place of a pure function's body using Return?

From previous answers, replies and discussions it is known, while not formally documented (even in the most recent Wolfram Language Documentation Center), that Return can be used in a two-argument ...