« first day (1256 days earlier)      last day (2382 days later) » 

12:00 AM
10kers, but that doesn't mean what you think it means.
It doesn't mean 'mark this review as bad'.
It means 'see the list of everyone's reviews at /history instead of just your own'.
 
It's when, for example, Rubio tells me not to edit posts that are in LQP
and I forget within a week or so
 
@Mithrandir probability puzzles are on topic. bare probability problems are not.
@boboquack ;)
 
@Rubio probably
 
LQP?
 
Low Quality Posts
 
12:02 AM
Low Quality Posts
 
Low Qualit nvm
 
Available at 2k rep
 
Worked that one out as well...
 
Is it 'review initiation' time? ;)
 
12:06 AM
no, it's review initialism time. ;)
 
Now y'all need to get to 3k and help close stuff
 
Making my way slowly...
 
^^^ we can always use more reviewers
Ideally I should never have to cast a vote :)
 
BTW, since I can't find my IRL sudoku generator, if anyone can find a good one that'd be great
But now I should sleep
It is after 3
 
12:12 AM
I have a random sudoku generator encoded in the following image:
 
I'e got a sudoku solver
 
@Wen1now I made one for Project Euler
 
@boboquack Hmm? What do you mean?
@micsthepick I made one just for the fun of it :) It brute-forces the sudoku, efficiently compared to stupid brute-force but inefficiently compared to clever brute-force
 
If you have a reasonably fast sudoku solver then you have a sudoku generator, almost
 
@Wen1now It generates a random sudoku every time you reload the page.
 
12:15 AM
@Wen1now Mine works in a similar fashion.
 
(fill in a grid, then repeatedly remove numbers until you can no longer do so without rendering the sudoku unsolvable; for extra points, at that point try adding and removing numbers and explore to see if you can reduce the number of clues required)
 
@boboquack Not for me.. it's still the same sudoku
 
@Wen1now I think you should follow the link on the word "random"
 
Now, if it had linked an xkcd comic then I wouldn't've had to follow the link...
 
12:19 AM
@Wen1now It's a random sudoku, do you get the point?
 
For some reason I'd remembered that comic as 222. Oh well, one off isn't that bad
What's the time?
 
11:22 here
Can't you just look at the top/bottom right of your monitor? :P
 
01:23:45 about 5 seconds ago here.
 
What is the smallest prime that cannot be expressed as (pq+1)/(p+q) for p,q prime?
For example 2 doesn't count since p=3,q=5 gives (3*5+1)/(3+5)=2
 
just checking, it's not 3 is it?
 
12:29 AM
p=5,q=7
 
do you know that there is any prime that can't be so expressed?
 
Optimus Prime, Prime rib, Prime directive
 
for all logic puzzles I know of, a solver with a metric is all you need for a generator
 
@GarethMcCaughan I think so
I haven't checked by hand though so I might be stupid
 
well, the smallest that isn't so expressible with p,q < 100 seems to be 19
this seems like a question that's either really easy or really hard
 
12:34 AM
@micsthepick Now I so want to do some project Euler questions...
 
I mean, if there isn't a trivial obstruction then it'll be some Goldbach-like thing that boils down to whether there are monstrous coincidences in the structure of the primes
maybe
 
@Wen1now have you done 96 yet?
It should be easy enough if you already have a working solver
 
p=23, q=109
 
so (pq+1)/(p+q)=r is the same as (p-r)(q-r) = r^2-1 i.e. we're looking for a factorization of r^2-1 such that shifting both factors by r yields primes. so a place to look (if indeed there are prime r for which this doesn't work) would be r for which r^2-1 doesn't have too many factors.
 
can't be any of these: 2 3 5 7 11 13 19 17 23 29 31 37 41 53 43 47 59 61 71 67 89 79 113 103 127 109 139 149 151 167 163 181 199
 
12:38 AM
I'm not finding one for 73
 
yeah ^
 
at least not for any prime in the first 10,000 primes
 
yeah 73 was the answer
 
it's not hard to verify that 73 does it
 
I only checked the first 100 primes
 
12:39 AM
but proving that nothing smaller does seems really painful
 
3, 5, 2
5, 7, 3
7, 17, 5
11, 19, 7
13, 71, 11
19, 41, 13
29, 41, 17
23, 109, 19
31, 89, 23
31, 449, 29
37, 191, 31
41, 379, 37
43, 881, 41
71, 109, 43
71, 139, 47
59, 521, 53
71, 349, 59
71, 433, 61
89, 271, 67
73, 2591, 71
huzzah computers.
(those are p, q, prime triplets)
107 and 131 also have no solutions in the first 10k primes
 
Wait are you going (p,q) -> prime OR prime -> (p,q)?
 
has to be the former, if I'm understanding the question right, not only because he said so but because otherwise 5,7,3 doesn't work
 
my listing is p,q, prime. so p=3 q=5 give (pq+1)/(p+q) of 2.
 
(I don't expect any of the others work either the wrong way around, except maybe by coincidence, but that was the only one I bothered checking)
 
12:44 AM
how do you prove that 107 cannot be done?
 
find 107^2-1. factorize. try shifting all pairs of factors down by 107 and see that none of them yields two primes.
 
What I mean is, are you generating all possible (p,q) and finding the value (pq+1)/(p+q) or are you choosing a prime and testing it against (p,q) values?
 
I'm just brute-forcing the search space with the first 10k primes - it's big but not absurdly big, so it doesn't take that long
 
@Rubio you mean by generating prime pairs?
 
cuz I'm not as mathsy as Gareth, but I can write perl code pretty quickly :)
 
12:46 AM
for each prime p: for each prime q: compute (pq+1)/(p+q); if an integer, record it. When done, go through small primes and report what was found.
 
If anyone cares, up to 223 all primes can be decomposed into p,q where each p,q are within the first 10k primes, except: 73, 107, 131, 157, 173, 179, and 193.
I'm now reducing my contributions to global warming by stopping my script. :)
 
now find the first such prime that is a palindrome, ;)
 
11, actually :)
 
eh? 11 was doable
 
12:48 AM
oh. the first non-match? yeah 131
 
duh
 
if you mean the first match, that would be 2, not 11
 
Hi @Doorknob!
 
@GarethMcCaughan Pah. trivial palindromes are boring.
:)
 
what about 107 with bad handwriting?
 
12:49 AM
71 has a lot of low solutions: (79, 701), (83, 491), (101, 239), (107, 211), (113, 191) e.g. -- I just find that slightly amusing
 
so if r is a large prime then r^2-1 has about log log r factors, typically of size about r, and each has probability 1/log r of being prime. so I expect most big primes can't be represented in this way
 
what about 73 in unary?
 
oh no wait
 
What are we waiting for?
 
about log log r prime factors, about log r factors
but that still isn't enough to make it usually work
 
12:51 AM
Hmm... my program, I think, agrees with you there
 
obviously r^2-1 always has a bunch of small factors so for smaller r taking d(r)=log r is typically a substantial underestimate, which is handwavily why most small primes seem to work
 
Find the first prime that follows that rule and contains a pandigital string (digits 1-9 together)
 
Pandigital string?
 
er, of course I mean each has probability 1/log r of being prime after adding r (I said subtracting before, I think, but that was wrong)
 
Does that include 0?
 
12:53 AM
@micsthepick I conjecture that none exist.
 
@GarethMcCaughan Didn't you just say that most large primes work?
 
no, it does not include 0
 
no, I said that most large primes don't work
if you have evidence that most large primes do work then I have probably goofed somewhere in my handwavy argument above
 
Okay okay, I think I see the confusion
I say 'work' = cannot be represented
 
ah, oops
 
12:55 AM
0
Q: Your mission is to break this mastermind code

SeyedHere is an altered mastermind puzzle which instead of colored pegs I used digits from 1 to 9 without any repetition. The picture below shows four guesses and their corresponding scores.The black pegs are for every correct digit and correct position and the white pegs are only for the correct digi...

 
So many mastermind questions... I might try writing a script that solves mastermind problems
 
so let's be a bit more careful about @micsthepick's question. If r is a large enough prime then r^2-1 can be split into two factors in about log r ways (on average, and the distinction between "on average" and "almost always" may make the argument I'm making rubbish, but never mind) and each has probability about 1/(log r)^2 of working. So a given prime r is representable with probability about 1/log r.
so actually
there are probably enough pandigital primes for plenty of them to be representable
e.g. I guess most length-20 primes are pandigital, and there are zillions of them, and 1/log(10^20) is pretty big so plenty of them will be representable
 
> pandigital string (digits 1-9 together)
Doesn't that mean that the digits must be together? I'm sure your argument still works, but you'll probably need to take like 10000 digit primes or something
Well, 10000 digit primes for most of them to be pandigital
 
10123465789^2-1 (from the second-smallest pandigital prime) seems not to have too many factors. It might possibly work.
(i.e., 10123465789 may turn out not to be representable)
 
but would it be the first case
 
1:01 AM
the only smaller pandigital prime has a lot more factors and I wouldn't be so optimistic about that one
 
It works
 
works in which sense?
 
wait nvm
I inputted the wrong thing
I'll just let my program have a chance to run...
Okay I may need to efficientise my algorithms
 
10 hours later...
 
For primes ~10000000 it takes a few seconds
 
1:07 AM
no
it has to be 2^x not x^2, derp
 
Okay I think it's my factor generation algorithm that slows it down
 
btw Gareth re:C4 yesterday, how does opposition -> CON? (is it as in "pros and cons", or...?)
 
I think that second pandigital prime is irrepresentible
@Sp3000 yes, I was thinking pros and cons. It isn't exactly great, as I think I said at the time, and my guess is that CON is not in fact what "opposition" indicates.
 
Is there any easyish way to find all factors of a number?
Wait that's NP-complete right?
 
not known NP-complete
probably not NP-complete
but also not known polynomial time
 
1:11 AM
(Ah k, just checking it didn't have some definition I hadn't heard of :P)
Also I'd recommend using a library than rolling your own factoring for efficiency, unless it's for learning how to write a factoring algorithm
 
there are algorithms that take time that looks like n^f(n) where f(n) is some ridiculous thing like log(n)^1/3 log(log(n))^2/3. Something like that, anyway
 
Quote Wikipedia:
 
actually applying the most efficient such algorithms to large numbers involves really big linear-algebra operations and stuff and tends to be done on large networks of fast computers
 
Unsolved problem in computer science:
 
for numbers of more reasonable size, other simpler algorithms are usually preferred
 
1:13 AM
Can integer factorization be done in polynomial time?
 
but nothing is super-fast once the numbers get fairly large
 
It's not exactly factorisation, but rather finding all factors
 
the best way to find all factors is to factorize first and use that
unless your number is small and has outrageously many factors, like 60
 
The best time according to wikipedia is (bear with me while I mathjax this up):
 
1:14 AM
(Nothing super-fast... yet. Something something Shor's algorithm? Or have I misunderstood the effectiveness of that one)
 
well, OK, if you have a quantum computer of sufficient size then you can use Shor's algorithm and it's pretty quick
 
@GarethMcCaughan p^2-1 generally has a lot of factors right?
 
but no one (so far as we know) is close to having such a thing
p^2-1 is always a multiple of 24
and of course factors as (p+1)(p-1)
but neither of those is obliged to have a lot of small factors
 
Good point, I should probably be doing this on my qpc
 
oops
 
1:16 AM
@GarethMcCaughan p = 0 is a counterexample :P
 
let's try that again
 
none the less, for numbers of that form you might prefer something like the elliptic curve method that gives answers quicker when the factors are smaller
@micsthepick 0 is not prime
however, I should have excluded 2 and 3 as well
since they are primes and actual counterexamples to what I said
 
so p must be prime for that to work?
 
but any prime other than 2,3 -- indeed, anything that isn't a multiple of 2 or 3 -- has the property that r^2-1 is a multiple of 24
 
Wen are you using Python?
 
1:17 AM
(8 because odd numbers squared are 1 mod 8; 3 because nonmultiples-of-3 squared are 1 mod 3)
@boboquack I do not believe your formula as it currently stands
though perhaps it is an anagram of the correct formula
 
By definition of O I don't think the constant terms out the front are necessary
 
or perhaps some exponents have moved to the wrong place
 
@Sp3000 Yeah I'm pythoning
 
I think some of those constant terms are meant to be exponents
 
no, that didn't quite work
 
1:18 AM
@Wen1now Try pip install'ing sympy and in code import sympy.ntheory.factorint or something maybe?
 
anyway, the formula is basically what I said: constant times log(n)^1/3 times log(log(n))^2/3
 
nope, still messed up @boboquack
 
Still got constant terms
 
there we go
 
1:20 AM
@Wen1now still still
 
unless it's displaying differently for me and for boboquack, it's still all wrong
but if you square the log log n factor then I think it might be right
 
@GarethMcCaughan 'Math formula anagramming class': try anagramming 'T(n+1)/2=n_n
 
that would be fun: progress to more and more intricate and obscure formulae
 
^screenshot
 
might be a good way of developing students' intuition
@boboquack yeah, that's right, where b = log n
 
1:21 AM
Hey. Nobody has solved my formula yet :(
 
where b=number of bits in n, so roughly log n
 
@Wen1now of course they have, it was just too obvious to bother stating explicitly
 
oh whoops, missed out ^2
 
Okay harder question comming up
 
I give up
 
1:23 AM
_T(n)=1/n+2n
VTC too broad
 
T_n=n(n+1)/2
@Sp3000 I think it has to be the correct formula
 
For n sufficiently large, anagram this to give a commonly known sequence undo(rn^hip)
What I mean of course is n=k,k+1,k+2,k+3... this gives a sequence for some k
 
so, anyway, the first pandigital prime in base 10, namely 10123457689, is in fact irrepresentible
so is the second
but the third, 10123465897, has two representations: (11909959879, 67489772641), (67489772641, 11909959879)
@Wen1now yeah, that one is phamous too
 
How did you get that so fast?
 
the hip was a giveaway
or do you mean the representations?
 
1:27 AM
I mean the representations
 
def reps(p):
  t = p*p-1
  for d in sympy.ntheory.divisors(t, generator=True):
    e = t//d
    u,v = d+p,e+p
    if sympy.ntheory.isprime(u) and sympy.ntheory.isprime(v): yield (u,v)
obviously the indentation is screwed [EDITED: not any more]
and then I just pasted in the list of the first few pandigital primes from OEIS
incidentally, I question just how well known the Lucas sequence really is
 
@Wen1now you like big numbers, here is a question for you:
17
Q: Golf a number bigger than TREE(3)

PyRulezThe function TREE(k) gives the length of the longest sequence of trees T1, T2, ... where each vertex is labelled with one of k colours, the tree Ti has at most i vertices, and no tree is a minor of any tree following it in the sequence. TREE(1) = 1, with e.g. T1 = (1). TREE(2) = 3: e.g. T1 = (1...

 
is there a 1-9 pandigital prime that comes before though?
 
@micsthepick oh, I don't know
 
the OIES sequence appears to include the 0
 
1:31 AM
no, wait, I do know
oh, no, wait, I don't know
give me a minute, though
1123465789 False
1123465879 False
1123468597 True
1123469587 False
1123478659 False
1123485967 True
False means not representable, True means representable
so once again we get lucky and the first pandigital prime is not representable
 
or are we lucky?
 
for digits in itertools.permutations('1123456789'):
p = int(''.join(digits))
if sympy.ntheory.isprime(p):
print(p, len(list(reps(p)))>0)
 
just indent before copying
 
what do you mean by "indent before copying"?
oh, I see
you mean indent for Markdown rather than indent for Python
 
use ctrl/command ] then copy
 
1:37 AM
does that actually work, though? I know that Markdown mostly doesn't work in multiline chat comments
for digits in itertools.permutations('1123456789'):
   p = int(''.join(digits))
   if sympy.ntheory.isprime(p):
     print(p, len(list(reps(p)))>0)
that was all indented by two spaces. do I need more, or does it just not work?
ah, four spaces is enough
 
golf tip: if sympy.ntheory.isprime(p):print(p,len(list(reps(p)))>0)
 
I wasn't golfing
 
... we're not golfing here :/
 
I can see that
 
(why the hell would I be golfing?)
 
1:39 AM
Why do we have a 1 at the front?
 
It also saves time while writing code, because you don't have to worry about indentation
 
because 1+2+...+9 is a multiple of 9
 
what about something like 1234567289?
 
bigger than 11...
(if we really needed all the pandigital numbers then of course we'd need to include those too)
 
oh, there is a 10-digit pandigital prime which starts with 11?
 
1:40 AM
I am actually so dumb...
 
(Golfed code is much less readable, so even in quick hack scripts it may be useful to actually have proper indentation)
 
@boboquack if you define "pandigital" as @micsthepick did above to permit having no zeros
 
Hmm
 
ok, it's killing me, what is this prime?
 
7 mins ago, by Gareth McCaughan
1123465789 False
1123465879 False
1123468597 True
1123469587 False
1123478659 False
1123485967 True
 
1:42 AM
first one is 1123465789
 
pie=0+i^1
 
all of them are prime
 
Might be a bit easy to some of us
 
e^ipi+1=0
 
1:42 AM
@Wen1now Any time you feel that way, just remember the story of the Grothendieck prime.
 
e^(i*pi)
 
2^a^b^c=2+2
Sorry I'm just stalling for time
 
not possible for integers
 
@micsthepick you do realise it's an anagram?
though I can't help thinking there might be a missing +
 
There we go, it's also solvable in integers now
 
1:46 AM
ah, there is no longer a missing +
 
2,1,1
 
Interesting number: \sqrt(v)+c^2^2-1/1
I hope that's correct...
Hey, somebody else make some. I want to give these a shot as well
 
I'm trying to work out your latest, which is the first one that wasn't obvious :-)
oh, I see
no, wait, maybe I don't see
yeah, I do
 
It's not really a formula (no =) but it gives an interesting number
 
Dubious: .1+.2/1.3=-1+2
 
1:50 AM
I think I see
 
yeah, I was a bit put off by "interesting number" because I was trying to find a way to make it actually give a single number rather than something depending on a parameter :-)
 
@Wen1now see mine?
 
Try this one (for n staying natural)
@boboquack yep
 
@Wen1now were you actually going to post "this one"? :-)
 
No...
I'm still working on ti
{} means fractional part btw
 
1:56 AM
1.2/.3=1+1+2.?
 
@micsthepick urgh, what is 2.?
 
spotlight parses 2. as a number perfectly fine
 
Just call it floating point precision
Oh oops
 
1:58 AM
You have brackets as well
Why'd I try to follow the url... I noticed it seemed like a weird name for a site too
 
lim n->2 {n} = sqrt(1)^3
 
@Sp3000 that has the drawback of being false
 
@Wen1now easiest way to see contents
 
The fractional part of an integer is 0
 
though if you constrain it to limits "from below" it works
 

« first day (1256 days earlier)      last day (2382 days later) »