2022-05-29 08:40:53 +0200 | received badge | ● Popular Question (source) |
2016-12-15 19:56:03 +0200 | commented question | Clean up recursive function Yes, that is the point I was trying to make. The function approximates the number of expected composites by dividing the range. But using |
2016-12-13 10:56:03 +0200 | asked a question | Clean up recursive function I've written a recursive function to approximate the count of k < K with 6*k +-1 both composite. It's accurate enough that now I want to:
I confess that I'm stumped by the recursion to equation/theory part. All my attempts at combinatoric, iterative, etc. failed. Can you help me clean it up and put it in it's best form? I may also have to do a print trace to help me see the math. I'm worried a code to math theory question won't fit anywhere. *Examples
This is a coding detail that affects the underlying and any derived math. Function Test program Update: Originally the flag was two bits for 0..3. While I was writing pseudo-code I realized that a boolean parameter can be eliminated with a pair of recursive functions. This looks closer to something that can be turned into an equation, yes? Alternate (pseudo-code) |
2016-08-29 14:59:12 +0200 | received badge | ● Teacher (source) |
2016-08-28 11:53:17 +0200 | asked a question | Finding lower bounds of a combinatoric function. I am working on a counting function involving prime numbers and managed to construct a sage function that is correct: Now I need a lower bounds function for this: $$ S = prime~range(5, n)$$ $$f(S) = \sum_{k=0}^{|S|-1} {\left(\left(2^{|S|-k}-2\right)\sum_{T\in \mathcal{P}_{k}(S)} {\prod_{t\in T} {t}}\right)}$$ None of the literature I've found covers anything close to it. (I have a vague memory of an Euler project problem that involved subset products). |
2016-08-28 10:56:32 +0200 | received badge | ● Editor (source) |
2016-08-28 10:53:26 +0200 | answered a question | Generating a LabelledBinaryTree from its string representation Ironically, the LabelledBinaryTree() command only lets you label the root. But you can apply a canonical labeling and then map those labels to the desired ones. This doesn't check if the string has a valid structure, and it expects all nodes to have labels. You could replace ' [' with 'None[' Testing: |
2016-05-24 21:50:02 +0200 | answered a question | Washed out colors when saving plots to file I think when the png is being constructed it doesn't handle the interaction between the opacity of the implicit plot and the point. Try adjusting your opacity. I also tested this: The inline image shows a line of six red points from up-left to down-right ( \ ), with a center gap where four are completely blocked by the sphere. The saved png shows all ten points in a line from down-left to up-right ( / ), with the center four slightly hazy. So the png is also swapping x with y for the points (the axis labels are correct). |
2016-05-23 06:52:32 +0200 | commented question | How do I inform the sage webmaster regarding search results? Could someone post a wiki suggestion regarding redirects? Then my question can be de-wiki-fied. |
2016-05-23 06:48:38 +0200 | commented answer | How do I inform the sage webmaster regarding search results? Thank you, I will make a habit of reporting both the old and new links to the site whenever I get redirected. |
2016-05-23 06:48:31 +0200 | received badge | ● Scholar (source) |
2016-05-23 06:48:26 +0200 | received badge | ● Supporter (source) |
2016-05-23 02:08:42 +0200 | received badge | ● Student (source) |
2016-05-22 04:50:33 +0200 | received badge | ● Organizer (source) |
2016-05-22 04:16:37 +0200 | answered a question | Is there a functional way to manipulate cycles extracted from a digraph? With the help of a PARI programmer and OEIS regular I cleaned up my code: and posted it to OEIS sequence A271100 Wieferich n-tuples. I used it to increase the number of listed terms from 15 to 300. We'll probably bump that to nearly 10k soon : ) |
2016-05-22 03:12:41 +0200 | asked a question | How do I inform the sage webmaster regarding search results? The Sage/Sagemath webmasters need to do the fix described below for all search engines: When I search for documentation: "sage intersection of lists" When I click the links I get: FIX: Google Search Help* says that the sage webmaster needs to: *https://productforums.google.com/forum/#!topic/websearch/st2z6P9Q7F8;context-place=topicsearchin/websearch/search returns old site url |
2016-05-17 15:13:30 +0200 | asked a question | Is there a functional way to manipulate cycles extracted from a digraph? I wrote a worksheet that defines a digraph and extracts all of its simple cycles. Then it uses mostly procedural code to:
The worksheet is adequate - it performs step 5 correctly, but a listing of the code will be posted as the PROG paragraph of an OEIS entry. So I would really like to reduce the numbered steps to as few lines as possible. Are there more graceful ways to tweak the output of one function before passing it on to another? |