Can you write a program to find all swastikas in the binary representation of pi?

Can you write a program to find all swastikas in the binary representation of pi?
Rules:
you have to find a 5x5 swastika like pic rel
wrap the image after 5 columns
post the offset for verification.
use this hex data converted to binary ignoring the dot. pi2e.ch/blog/2017/03/10/pi-digits-download/#download
>I found 2 in the first billion digits

Attached: 1654467070977.png (784x649, 9.97K)

Other urls found in this thread:

pastebin.com/pLSZjfYR
twitter.com/AnonBabble

ez pz
whats the catch?

>Can you write a program to find all swastikas in the binary representation of pi?
Not one that halts

All sequences from 0 to n decimal digits.
There is no catch.

>all

lol.

HAHA SO FUNNY
now let's see if you can do it for the first 1 billion digits, smartass.

01110
00001
10100
1

Nope. No swastikas.

>you have to find a 5x5 swastika like pic rel
>wrap the image after 5 columns
>post the offset for verification.
Your rules are unclear nigger. What am I generating? An image? The digits? The offset?

You are generating the offset which would display a swastika if you generated the image.
The digits are already available to be downloaded but you can generate your own if you want.

>shut it down

Yeah it's incredibly easy, I would just check every 5th digit if the proceeding digits were 1011110100111110010111101 and if they were you had a swastika.

I wouldn't have any idea how to do this efficiently but that approach should be fast enough for just a billion digits...

write it.
the fun begins when you realize one hex number is 4 bits, but one line of the swastika is 5.

in theory it sounds easy, but in practice its more interesting
especially if your fav language doesnt support binary operations

So literally finding 0x17A7CBD in the number?

This is my code pastebin.com/pLSZjfYR
It only finds one at bit offset 2127667875.
I haven't fully checked the code, I think the pattern matching works but I'm not sure if I don't have an off by one error in the modulo 25 bit filter.
Output:
detected input size 1000000002
searching...
found sequence at vector1_copy: 8d2fe97c, vector2_copy: bc8f8c43, byte_offset: 531916969, local bit offset: 3, global bit offset: 2127667875

actually, now that i think of it, without binary operations it is still possible and would involve less writing, albeit the code will run slower

i think ima drop the bin op myself

Pi is infinite, so the answer is infinity.

>the fun begins when you realize one hex number is 4 bits, but one line of the swastika is 5.

Then check 4*5 = 20 bits at a time? How is this interesting again?

The tricky part is checking which ones of those instances of the pattern found will have the right 25 bit alignment to form the correct pattern when arranged on a 5x5 grid.

Then drop your solution and we will point why it's wrong.
If you think it's so trivial then you are misunderstanding the challenge.

bits can be offset user

then you check for the beginning of the swastika once every 20 bits.
but you need to check once every 5 bits

multiline grep

Pointer in the hex/string input
Buffer of binary data
Add to the buffer from the hex pointer until buffer is above 25
check for target string
pop first 5 values in buffer
loop

It can be done with standard shell utils but it'd be very slow.

It can be solved with a fucking for loop advancing 5 digits and checking the next 25 digits. This is so obviously trivial that I have no desire to paste my own solution just to humour you. I honestly don't know why you would think the program not advancing in hex digits is such a large problem.

As somebody else pointed out you can literally fucking grep for the swastika.