@user430580 BTW some lines in this image are a little wrong, the examples are all correct but for example it says :0x2008 = 8200 (1 rotation to the left)" while it is actually 1 rotation to the right
Here is a new image with correct labeling. And there are a lot of more examples if you start looking for left rotations instead of right, at least in the 7 digit range
If there are any larger than 0x0795040 = 7950400 that are reasonably possible to find with this code, I'm not sure. But I suspect there is no reason why they shouldn't go on forever. And brute force search is probably not the optimal method :P
Wow, I was honestly not having too much hope, but I left this script running overnight and woke up to this baby! 0x036915494 = 915494036 (3 rotations to the left)
@Dave Hello, welcome to the chat, always happy to see new faces!
And the script is still running BTW, looking forward to more findings!
@user430580 it's a nice idea, ask if there's any way to predict such occurrences... maybe i'll get to it... BTW i don't mind if you ask a question about it if you're interested, i claim no rights on the concept or something , lolz
@user430580 yes i bet one can at least optimize the brute force search. for instance if you are looking at 0x2000 ... there's no sense comparing to decimal numbers that are manifestly smaller, 2, 20, 200... so one basic check one can make is to ensure you compare a decimal larger than the (apparent) decimal that the hex looks like
although you're just rotating it right, so maybe it's a bit trickier to implement this optimization, nvm :)
@PM2Ring Hello, welcome to the chat! Always happy to see new faces pop in!
@Amit Please consider asking such a question, I have read some of your other questions and see that you definitely have a better way with words and would certainly phrase the question better that I could
@Amit I am open to any new ideas. BTW this thing has been grinding for about 20 hours and 0x036915494 = 915494036 is still the highest so far, no new findings
In every base, there are numbers (related to reciprocals of primes) that have a cyclic pattern. One famous example in decimal is 142857, which comes from 1/7 = 0.142857142857...
A cyclic number is an integer for which cyclic permutations of the digits are successive integer multiples of the number. The most widely known is the six-digit number 142857, whose first six integer multiples are
142857 × 1 = 142857
142857 × 2 = 285714
142857 × 3 = 428571
142857 × 4 = 571428
142857 × 5 = 714285
142857 × 6 = 857142
== Details ==
To qualify as a cyclic number, it is required that consecutive multiples be cyclic permutations. Thus, the number 076923 would not be considered a cyclic number, because even though all cyclic permutations are multiples, they are not consecutive integer...
The "trick" is to work backwards, to turn the division into multiplication. Let $a, b$ be the digits. So $3(10a+b) - 1 = 10b+a$ Thus $30a + 3b - 10b - a = 1$ $29a - 7b = 1$ That's just a linear Diophantine equation, so you can solve it using Euclid's Greatest Common Divisor algorithm.. But the answer should be pretty obvious, by inspection.
Yesterday I got an upvote on a SO answer from 2017 that I'd totally forgotten about. It involves sequences of pairs of numbers from 1 to n. Here's an example for n=7. Can you see the pattern?
@Amit In my mind, these two are really similar, even though the second idea does not operate on different bases, but that's just for me. Here's the big disclaimer: my mathematical intuition is somewhere between "zero" and "very bad" :P
@PM2Ring Thanks, you explained it really well. Looks simple to understand, but to find it out myself, it would probably take me quite a long time, and result in lots of frustration :P
I'm going to use this prompt instead: Imagine a scene featuring four dragons. The first dragon perched atop a majestic mountain peak is a glossy black dragon with webbed wings spread wide against the cloudy sky. The second dragon, a fiery red one, is poised near a molten lava river deep within a volcano. The third dragon is a magnificent green dragon, wandering in a lush forest. The last dragon is a pure white dragon, calmly floating on a serene, icy glacier. They are all mighty creatures of ...
their own elements, showcasing their strength in their natural environments.
Yes, there are a few faster ways to make Langford sequences.
Firstly, here's a fairly simple way. Rather than testing all of the permutations containing the pairs of numbers from 1 to n, we generate the permutations of numbers from 1 to n and then try to build Langford sequences from those permu...
@Amit I'd have a lot more by now, but I got fed up with all the low quality questions on SO. It was always a busy site, but the company made various changes to make the site more friendly, which ended up encouraging quantity over quality. :(
@Amit The proof that it's always possible for n=0 or 3 mod 4 is a bit harder. I've read over it, but I don't fully understand it. And at one point it just says: this construction will always produce a valid sequence, without exactly showing how they found that construction. But they do show that the construction does work.
@user430580 There's a Python room on SO. It used to be really busy, but it's gotten a lot quieter over the last couple of years. chat.stackoverflow.com/rooms/6/python
Here's a sequence for 15. My recursive code can easily find solutions for large n, but of course there will be a lot of solutions. [15, 13, 14, 8, 5, 12, 7, 11, 4, 10, 5, 9, 8, 4, 7, 13, 15, 14, 12, 11, 10, 9, 6, 3, 1, 2, 1, 3, 2, 6]
In combinatorics and in experimental design, a Latin square is an n × n array filled with n different symbols, each occurring exactly once in each row and exactly once in each column. An example of a 3×3 Latin square is
The name "Latin square" was inspired by mathematical papers by Leonhard Euler (1707–1783), who used Latin characters as symbols, but any set of symbols can be used: in the above example, the alphabetic sequence A, B, C can be replaced by the integer sequence 1, 2, 3. Euler began the general theory of Latin squares.
== History ==
The Korean mathematician Choi Seok-jeong was the...
On a vaguely related note, there's a thing called the Hadamard matrix, which is a binary matrix. In a 8×8 Hadamard matrix, every pair of rows matches in 4 columns, and every pair of columns matches in 4 rows. See puzzling.stackexchange.com/a/126953/36040
@Amit It's just a gut feeling. Also, I don't think it was mentioned on any of the Langford sequence pages I read yesterday. ;)
Note that we can extend a Langford sequence to include zero by appending (0, 0) to the start or end of the normal sequence.
Haha I remember how some time ago I read that the algorithm used to generate gravatars (generic default avatars on SE network like the avatar I have right now) had to be tweaked really hard because it was especially prone to accidentally generate swastikas :D which has to do with the 2-axis symmetry behavior
The Nazis stole the swastika from India, where it was a symbol of social harmony... but I guess it could also be interpreted as a symbol of oppression to conform to the expected social order. But in any case, the swastika in India is now tainted by the Nazi association.
Automatically generated gravatars, for SE users without their own profile picture, used to have 4-fold rotational symmetry. Some time recently, there's been a very subtle change and they now have reflectional symmetry in the y-axis instead. They haven't changed much, but I notice it every time I ...
I am using this PHP script to generate identicons. It uses Don Park's original identicon algorithm.
The script works great and I have adapted it to my own application to generate identicons. The problem is that sometimes swastikas are generated. While swastikas have peaceful origins, people do t...
@Amit To an extent. A lot of people just got sick of the constant stream of no-effort homework-dump questions. We still get a few of those, but it got pretty bad a few years ago. And they tend to get closed fairly quickly these days.
But also there was drama on the site, involving a clash of some big egos. I don't know the details because it happened before I joined. One prominent member ended up getting quite nasty to various people, including mods and staff. Bad mistake. Mods can ban someone from their site for a year or two, IIRC. But staff have greater powers... That guy is banned over the whole network for a couple of centuries.
It's a shame. We used to have a lot more professors and textbook authors. We even had a Nobel prize winner.
The logic is that if someone is banned they should be allowed a fresh start, without them being haunted by their past. But I guess that logic doesn't really apply when someone is banned for life. But still, it'd be bad if people were discussing you on a site where you can't defend yourself.