## prime numbers – Big O notation for OEIS A015617

I am having difficulty finding the exact Big O notation for the size of the search space of OEIS A015617 as a function of n. I am researching a theory that A015617 may have useful applications in cryptography. you can see that this is a subset of A000292. more precisely, A015617 and A000292 are the size (Big O) of the set defined by n and the procedure to generate the permutations that meet some conditions. A000292 and A015617 are themselves Big O notation but they do not explicitly show the permutations of the original set. to find the original sets you can use mathematica code examples here

``````n = 5
fullset_A000292 = Subsets(Range(n), {3}))
fullset_A015617 = Select(Subsets(Range(n), {3}), Apply(CoprimeQ))
``````

It should be obvious then that elements of fullset_A000292 that are not in fullset_A015617 have at least 1 common factors in 2 or more members of {a,b,c} that makes them easier to reduce the Big O of A000292 compared to A015617 which is presumed to be irreducible in computational complexity.
I have attempted to approximate some guesses that fit the function with a graph to show the results

``````a = 140
f = Table(Length(Subsets(Range(x), {3})), {x, 3, a})
g = Table(Length(Select(Subsets(Range(x), {3}), Apply(CoprimeQ))), {x, 3, a})
e = Table(Floor((x/2.7)^3), {x, 3, a})
d = Table(Floor(((x - (x/Log(x)))/2.2)^3 - (x^2)/3), {x, 3, a})
FindGeneratingFunction(f, x)
(*FindGeneratingFunction(g,x) this has been commented out because mathematica fails to give an answer*)
ListLinePlot({f, g, d, e})
``````

as you can see mathematica fails to find a function that fits the discrete function returned and stored in g. e, d are found by trial and error. they are my best guesses but they are not in any way rigorous. Can you help me find the generating function that best fits the plot of A015617? is there a rigorous upper bound and a rigorous lower bound for A015617 with proof? would this be a problem that can be solved using linear regression and gradient descent with AI assuming that the model e or d would be suitable? what is the method for determining if the generating function will intersect or not intersect A015617? is this simply a difficult problem on the order of PNT n/ln(n)? not solvable? I see the Legendre correction constant to the PNT is -1.08366 which makes me think that gradient descent for linear regression may actually return numbers that are not integers or logs of integers. This is somewhat encouraging although completely mysterious to me intuitively. Help or comments of any sort are greatly appreciated.

Note that A000292 is an nCr function with known Big O notation therefor A000292 has already been solved.

## mathematics – I just wanted to prove Fermat’s last theorem true for the first 1000 numbers using a python script, but there is an error I’m not able to find

Fermat’s last theorem states that there are no natural numbers (1, 2, 3,…) x, y, and z such that x^n + y^n = z^n, in which n is a natural number greater than 2.

Here is the code, you can ignore the first 2 functions.

``````
def diff(n, mid) :
if (n > (mid * mid * mid)) :
return (n - (mid * mid * mid))
else :
return ((mid * mid * mid) - n)

def cubicRoot(n):
start = 0
end = n

e = 0.0000001
while (True):

mid = (start + end) / 2
error = diff(n, mid)

if (error <= e):
return mid

if ((mid * mid * mid) > n):
end = mid

else:
start = mid

def proof(n):
for a in range(1,n):
for b in range(a, n):
c = cubicRoot(a * a * a + b * b * b)
if c.is_integer() and c <= n:
print(f"{a},{b},{int(c)}")
else:
print(f"{a},{b}")
proof(1000)

``````

Although for some reason my program stops with the output ‘1,728’ in the console and doesn’t print anything further. Any help on improving the code and fixing this solution will be appreciated.

Thank you.

Posted on Categories Articles

## turing machines – Is the set of recursive subsets of the set of natural numbers not r.e.?

I think that the set of recursive subsets of the set of natural numbers is not r.e. (meaning the set of codes of those subsets according to an admissible numbering).
I think I can provide the sketch of the proof of such statement and I would like to ask if what I write is correct.

PROOF SKETCH

This statement is equivalent to prove that the set of characteristic functions of recursive sets of natural numbers is not r.e., we are talking about recursive functions of this form: $$f: mathbb{N} longrightarrow {0,1}$$.
To be precise we are talking of the set of the codes according to an admissible numbering of those functions.

For any such function $$f_k$$ there is an infinite recursive binary sequence: $$f_k(0), f_k(1),…,f_k(i),…: i in mathbb{N}$$.
Let $$TM_k$$ be a Turing machine that on empty input outputs the binary sequence associated to $$f_k$$.

Let $$widetilde{TM}$$ be a Turing machine that enumerates those Turing machines $$TM_k: k in mathbb{N}$$ (to be precise it enumerates the codes of those Turing machines).

We can build a Turing machine $$widehat{TM}$$ that given as input the code of any Turing machine $$TM_x$$ runs both $$TM_x$$ and $$widetilde{TM}$$.
Then one of those two things must happen, either $$TM_x$$ halts or $$widetilde{TM}$$ outputs the code of
$$TM_x$$ which means $$TM_x$$ does not halt. So $$widetilde{TM}$$ can decide the halting problem (restricted to $$TM$$‘s with empty input but it is equivalent to the general halting problem, see this link), which is a contradiction.
So $$widetilde{TM}$$ can not be built, the set of $$TM_k$$ is not r.e. and so the set of recursive subsets of the set of natural numbers is not r.e. $$blacksquare$$

I assume the Turing degree of this set is $$mathbf{0}’$$ because an oracle for the halting problem make this set recursive.

Posted on Categories Articles

## warning messages – Finding the number of even numbers in Pascal’s triangle (code gives memory error)

I have the following code:

``````α = 10^6;
L = Total@*Map[Length];
[DoubleStruckCapitalT][i_, j_] := Binomial[i, j - 1];
L[ParallelTable[
If[TrueQ[
EvenQ[[DoubleStruckCapitalT][n, k]] && [DoubleStruckCapitalT][
n, k] != 0], {n, k}, Nothing], {n, 0, α - 1}, {k,
1, α}] //. {} -> Nothing]
``````

But this code gives an error memory message, how can I edit my code such that I want to compute this code for large values of `[Alpha]`?

Posted on Categories Articles

## c++ – Ask for suggestion: data type for parsing stringified fractional numbers

I am the author of a C library for parsing INI files. So far I have delegated the task of parsing values as numbers to the standard `atoi()` family of functions. However I think time has come that I provide my specific functions for parsing numbers, since in INI files a number can be notated in octal, hexadecimal, etc., and there are a few more things in which I would like to specialize my own code.

Everything good so far. I have written two functions that are nearly-identical except for the data type. One parses integers, the other one parses fractional numbers. I have no doubts that the one that parses integers should return an `intmax_t` type. But what about the one that parses fractional numbers? Should that return a `double` or a `long double`?

Mine is a very general purpose library, it can be used in all kind of contexts, from embedded systems to desktop applications, and the INI files can be of all kinds. Whatever I choose now I will have to stick to it for a while, since changing the data type will break the binary compatibility.

So the question is: `double` or `long double` for parsing fractional INI values?

Posted on Categories Articles

## complex numbers – Simplifying inverses of polynomials to real functions

For example, I have a polynomial:
$$f(x)=-frac{1}{4}x^3 + frac{3}{4}x + frac{1}{2}$$
And one of its inverses is:
$$f^{-1}(x) = frac{-(1 + i sqrt{3}) (-2 x + 2 sqrt{(x – 1) x} + 1)^{2/3} + i sqrt{3} – 1}{2 sqrt(3){-2 x + 2 sqrt{(x – 1) x} + 1}}$$
In the real domain 0<x<1 it has a real codomain -1<y<1.

Is it possible to simplify inverses of polynomials to “real functions”? By which I mean I want the new function to have same values in a given domain as the original one and I want to be able to find any value in that domain by doing real number calculations only.

Posted on Categories Articles

## 8 – Symbols for certain locales missing in multilingual sites when using the number formatter moule to format integers to ordinal numbers

I was looking for a module that converts integers entered in a field into ordinal numbers, For eg 22 to 22nd and 33 to 33rd.

I ran into the https://www.drupal.org/project/number_formatter and it works

The module works really well for English (en) converting 1 to 1st, 2 to 2nd, and so on.

However, for other languages like Arabic with locale ‘ar’ it is not converting accurately. The symbol seems to be missing and instead, we get a ‘.’. The same happens for ru as well. “

I debugged the module and I found that it was using the core PHP class NumberFormatter.

``````use NumberFormatter as IntlNumberFormatter;

\$language = \$this->languageManager->getCurrentLanguage()->getId();
\$numberFormatter = new IntlNumberFormatter(\$language, \$this->settings('style'));
``````

Dumping the \$numberFormatter led me to the following output.

``````^ NumberFormatter {#2773 ▼
locale: "ar"
pattern: """
%digits-ordinal:

0: =#,##0=.;

-x: −>%digits-ordinal>;

"""
attributes: {▶}
text_attributes: {▶}
symbols: {▶}
error_code: 16
error_message: "Error getting symbol value: U_UNSUPPORTED_ERROR"
}
``````

I tested this code separately and found that the problem exists outside the module and is likely a core PHP bug. Is there something additional we need to do get this fixed?

Posted on Categories Articles

## exiftool – Changing Date on large numbers of scanned files

I have thousands of scanned photos and would like to change the EXIF data to have the proper dates.
I can do this all with exiftool, but am looking for a way to process the files after I have organized the files into groups by date.

I created subfolders with the format mmddyy and placed each photo for that date within.

I would like a script to do the following (Windows based computer, so DOS, powershell, or VBscript would work):

Step through each folder, take the date from the folder and apply the following commands:

``````exiftool -datetimeoriginal="19yy:mm:dd 12:00:00" directory*.jpg
exiftool "-datetimeoriginal+<0:0:\${filesequence;\$_*=3}" directory*.jpg
move *.jpg e:Fixed
``````

Any suggestions? I haven’t scripted in years and am definitely rusty.

Posted on Categories Articles

## ms office – How to import text to columns and import numbers to text in macOS Numbers?

Windows Excel allows me to paste a body of text and in the bottom right corner of the pasted content, a menu prompt will pop up that can initiate the “Text Import Wizard” to import delimited text into columns (text separated by commas or spaces, for example). In Numbers, such an option doesn’t exist that I know of.

Second, how can I import text (including numbers) as text? With windows I can do both of these functions with the Text Import Wizard and with Numbers I can’t do either.

The only solution I’ve found to the first problem is to download a custom workflow that I found in this Apple Community thread: https://discussions.apple.com/thread/8293955

And a less elegant solution is also discussed here but it’s much more clunky: How can I do text-to-columns in Numbers?

Regardless, I still haven’t found a way to import numbers as text.

## machine precision – Avoid MachinePrecision numbers in Message

Can I change the output of `Message` to not show `MachinePrecision` numbers? E.g.

``````Bleh::test = "test `1`";
``````

This is tolerable:

``````Message(Bleh::test, 0.01)
(* Bleh::test -- test 0.01` *)
``````

This is not:

``````xx = 0.01;
Do(xx += 0.04, {5})
Message(Bleh::test, xx)
(* Bleh::test -- test 0.21000000000000002` *)
``````

Is there a way for `Message` to display this rounded off as:

``````xx
(* 0.21 *)
``````

Posted on Categories Articles