#elementary-number-theory

1 messages · Page 40 of 1

hardy iron
#

you're assuming the fractions aren't in simplified form yet

#

i think?

#

or even things like 6/3

#

15/5

#

etc.

unkempt hedge
#

oh shit

#

yes

#

That is a big mistake

hardy iron
#

lol dw i was convinced by it the first time i saw it

unkempt hedge
#

hmmm, what to do now

hardy iron
#

solve for k instead of m maybe?

#

2 - 13k = m(53 + 11k)

#

still looks ugly af

#

=tex /frac{2-53m}{11m+13}

stoic basinBOT
hardy iron
#

=tex \frac{2-53m}{11m+13}

unkempt hedge
#

I know

stoic basinBOT
hardy iron
#

oh wait

#

can't you solve it like the way you solved the first part?

unkempt hedge
#

I thought so too

hardy iron
#

oh i guess it's hard finding that first solution

#

oh

unkempt hedge
#

like if m = a/b then gcd(a,b) = b so ax+by = b

#

or something like that

#

but I don't know how I should do that

hardy iron
#

(2 -13k) = a(53 +11k) where a must be an integer?

#

idk how that would help

#

oh wtf... that's just a=m

#

i think you're more on the right track than me

unkempt hedge
#

@hardy iron You could rewrite m as -2 + (9k + 108)/(11k + 53)

unkempt hedge
#

@hardy iron I have been trying for a while now.
I found out that you could rewrite m as
11(m+1)(k+1) + 2(21m+k) = 13
which gives us another diophantine equation
(m+1)(k+1) = a
21m + k = b
11a + 2b = 13
a= 1 and b = 1 is a solution, so if we generalize we get
a = 1 + 2t and b = 1 - 11t

I: (m+1)(k+1) = 1 + 2t
II: 21m + k = 1 - 2t

II: k + 1 = 1 - 2t -21m + 1
substitute in "I"

I: (m+1)(1-2t-21m + 1) = 1+2t
now we have a solution for m given any integer value of t.

if you expand you will get a polynomial

21m^2 + m(19 + 11t) + (13t + 1) = 0

use quadratic formula, and then the possible values of t should be bounded between (some value which makes the square root negative) < t < (some value which makes the square root negative) because t is squared in under the square root, we get a polynomial.

#

(very unsure about this though)

#

Hmm, m is not forced to be an integer though 🤔 nvm, then

sacred junco
#

Has anybody thought of a solution for how to find prime numbers

mossy folio
#

Eratosthenes did.

sacred junco
#

@mossy folio how about a formula to get you from one prime number to the next consecutive one

mossy folio
#

No such formula which is efficiently computable is known.

#

@sacred junco

north orbit
#

a = (4d^2-30d)/(30-3d)
If a and d are positive integers, find all possible pairs of a and d

#

Could somebody help me with this please?

drifting trench
#

Long division probably?

north orbit
#

Ok I ended up with a remainder of 100/(30-3d)

#

First of all 0<d<10

#

What do I do from here? Do I find a value for d that makes 100/(30-3d) an integer?

#

Or what other ways are there to do this?

unkempt hedge
#

@north orbit
100/(30-3d) cannot be equal to an integer if d is an integer because we can rewrite the fraction as
100/ 3(10-d)
and we only get an integer if gcd(100, 3(10-d)) = 3(10-d)
and this cannot happen because
3 does not divide 100.

sturdy dirge
#

$$a=d\cdot\frac{4d-30}{30-3d}=d\left(\frac{-4}{3}+\frac{10}{30-3d}\right)$$.

stoic basinBOT
unkempt hedge
#

@sturdy dirge 11(m+1)(k+1) + 2(21m+k) = 13 help me too😢

sturdy dirge
#

What is it ?

unkempt hedge
#

integer solutions

#

for m, k elem_dark Z

sturdy dirge
#

$$11u+2v=13\iff (u, v)\in{(13+2w, -60-11w)|,\forall w\in\mathbb{Z}}$$\$$\left{\begin{matrix}21(m+1)+(k+1) &=-38-11w \ (m+1)(k+1) &=13+2w\end{matrix}\right.$$

stoic basinBOT
sturdy dirge
#

@north orbit .

unkempt hedge
#

@sturdy dirge uhmm, so there are infinite solutions?

sturdy dirge
#

Maybe, multiply the last equation by 21, you will be able to express m, k.

north orbit
#

@unkempt hedge oh I might have screwed something up because I know there is supposed to be a solution

#

@sturdy dirge what does that tell us?

#

Your equation that you wrote above

digital kettle
#

hey

#

how do i solve

#

=tex x^2 + xy + y^2 = x^2 y^2

stoic basinBOT
digital kettle
#

in the integers

#

?

#

the hint says use infinite descent

#

but i don't see how

#

<@&286206848099549185>

drifting trench
#

$$(x+y)^2=xy(xy+1)$$

stoic basinBOT
digital kettle
#

um

#

so?

drifting trench
#

Idk

#

I was thinking

#

Wait.

#

Or $$x^2+y^2 +xy(1-xy)$$

stoic basinBOT
drifting trench
#

=pup x^2 + xy + y^2 = x^2 y^2 where x and y are integers

stoic basinBOT
#

Wolfram|Alpha didn't send a result back.
Maybe your query was malformed?

drifting trench
#

=pup x^2 + xy + y^2 = (xy)^2 where x and y are integers

stoic basinBOT
#

Wolfram|Alpha didn't send a result back.
Maybe your query was malformed?

drifting trench
#

=wolf solutions of (x+y)^2=xy(xy+1) ; were x and y are integers

stoic basinBOT
drifting trench
#

Hmm, you could try to get the equation in either the form of x or y and solve it to get the results

#

That should work

digital kettle
#

how tho

drifting trench
#

$$\frac{1}{y^2}+ \frac{1}{xy}+ \frac{1}{x^2} =1$$

stoic basinBOT
drifting trench
#

Nop

#

Rip, idk

digital kettle
#

wait

#

this might even work

#

because i solved an equation of the form 1/a + 1/b + 1/c = 1

#

and since that has no solns (iirc)

#

this must not have any solution either

#

now the only thing left is to prove that 1/a + 1/b + 1/c = 1 has no solns

drifting trench
#

That's wrong as 1,-1 are solutions

#

Unless the constraints are same a single proof doesn't apply over everything

digital kettle
#

-_-

drifting trench
#

$$\frac{1}{y}+ \frac{1}{x}+ \frac{y}{x^2} =y$$

stoic basinBOT
drifting trench
#

$$\frac{1}{y}+ \frac{1}{x^2}(x+y) =y$$

stoic basinBOT
drifting trench
#

Hmmm

#

Neh

north orbit
#

@drifting trench I guess the problem with long division was that the leading coefficients of the polynomials were 4 and 3

#

But if you factor out the 3 from the bottom like quantic did, you can divide but I don’t know what to do from there because of the factored 3

sturdy dirge
#

@north orbit You can multiple the equation by 3 then study the fraction or gcd(10, 10 - d).

hollow basalt
#

@digital kettle

Let u=x+y, v=xy. The equation becomes u^2=v(v+1). (* )

The RHS is only a perfect square if v=0 or v=-1, as otherwise sqrt(v(v+1)) lies strictly between |v| and |v+1|.

If v=0, then u=0 from (* ). Thus x=y=0.

If v=-1, then u=0 from (*) and we have x=1/x. This gives the solution pairs (1,-1) and (-1,1).

So the solutions are (0,0), (-1,1), (1,-1).

ocean ravine
digital kettle
#

okay...

hollow basalt
#

you sound hesitant, do you not follow some part of this proof?

digital kettle
#

oh lol

#

no

#

i was shady about the 'RHS is a perfect square' part

#

before thinking about it

#

-_-

hollow basalt
#

cool 😃 yeah the GM of two consecutive positive integers has to be strictly between them.

digital kettle
#

but the hint mentioned infinite descent

hollow basalt
#

There are often multiple ways to do such problems. I can't imagine a solution exists much shorter than this one though.

digital kettle
#

true

#

but curious 😅

#

nice soln tho

hollow basalt
#

thanks, yeah it's not obvious to me what they had in mind.

#

Often with these kinds of quadratic equations, you can use sum/product of roots to jump from one solution to the next and this is how you manufacture your infinite descent. This equation doesn't appear to just be a routine application of that though.

drifting trench
#

Why did I not think of this GWqlabsGarThink

#

Maybe because I wasn't really paying attention, but eh

somber rampart
#

viEtA jUmPiNg

vast vessel
#

kek

ebon kettle
#

Can anyone recommend me a book to study number theory at olympiad level? I'm a beginner so please keep that in mind when recommending me a book. Thanks!

royal zodiac
#

Rosen Number Theory

ebon kettle
#

Thanks I'll have a look at it!

unkempt hedge
#

How do you prove that m(m-4)(m+1) cannot be congruent to 1 mod 9?

#

I tried to do it through induction, but I am not too familiar with the method

cinder hatch
#

I wouldn't do this by induction

#

just doesn't strike me as good for that

unkempt hedge
#

why, it looks to me like the perfect place to use induction

cinder hatch
#

I just don't see how the induction step would work here at all

#

my though would be to figure out the possibilities mod 3

#

then go from there somehow

#

that shouldn't be too bad to compute directly

unkempt hedge
#

I tried a few numbers, and didn't get it to be congruent to 1 mod 9, which is why I would like to prove it through induction

#

Yeah, I could try mod 3

somber rampart
#

You can just brute force it lol

cinder hatch
#

you can always do that lol

unkempt hedge
#

but then I am coming at it with the assumption that it is untrue. (It might not be)

somber rampart
#

Calculate m(m-4)(m+1) for m from 0 to 8

unkempt hedge
#

Oh, how do you know that it repeats after 8?

somber rampart
#

Multiplication preserves modulus

unkempt hedge
#

I know it loops, but how do you know that it is exactly 8

#

and not 6

cinder hatch
#

you know it will definitely loop at 9

somber rampart
#

It's mod 9

cinder hatch
#

because 0 = 9 mod 9

unkempt hedge
#

oh

somber rampart
#

So it will definitely loop from 0 to 8

unkempt hedge
#

nice

somber rampart
#

Technically it loops at 1

unkempt hedge
#

makes sense

somber rampart
#

Since it's all 1 lol

#

But you can only use what you know

unkempt hedge
#

That would mean I should only use induction when you have a large modulus

somber rampart
#

Depends on the case tbh

unkempt hedge
#

I guess

somber rampart
#

Sometimes you can make clever arguments

cinder hatch
#

you need some sort of symmetry for the induction step to work out, that's not usually the case in my experience

somber rampart
#

But induction would probably work fine for this too

cinder hatch
#

for a problem like this

somber rampart
#

Nah you could do it

#

Let me sketch an induction priof

unkempt hedge
#

I was doing this problem, and I just had the assumption that there would be no solution and had a number theory approch. But how would you solve it normally?

cinder hatch
#

oh you would only approach that with number theory lol

unkempt hedge
#

But what if it had solutions?

cinder hatch
#

at least if you want integer solutions

somber rampart
#

Diophantine meme nice

#

You want to factor and work based on that

unkempt hedge
#

but LHS does not have any real roots

somber rampart
#

Lol

unkempt hedge
#

not sure what you mean by factor tbh

somber rampart
#

Then yeah easy meme

#

I didn't check roots

#

You can factor it out

#

As an equation

#

Also why do you need roots?

#

It doesn't need real roots

unkempt hedge
#

I don't know anything about imaginary numbers beside i = sqrt(-1)

somber rampart
#

Lol

unkempt hedge
#

@somber rampart What do you mean by factoring it out as an equation?

somber rampart
#

You're overthinking it

#

Literally polynomial factoring

#

You should have learned it in algebra 1 or 2

unkempt hedge
#

I know what polynomial factoring is

#

but how should you use it thonker

somber rampart
#

So factor both sides GWchadThink

#

Then use divisibility memes

unkempt hedge
#

Sooo, you guess the roots?

#

These memes are to advanced for me to understand

somber rampart
#

Nah

#

Here's how you factor

#

Literally distributive

#

First add 3 to both sides

#

Sorry 2

#

Ultimately 1 + 2 = 3

#

27n^3 + 9n + 9n^2 + 3
3n(9n^2 + 3) +1(9n^2 + 3)

#

(3n+1)(9n^2 + 3)

#

3(3n+1)(3n^2 +1)

#

You know left hand side is divisible by 3

#

So m^3 + 5m + 2 is divisible by 3

#

And basically you keep making these kinds of arguments

#

Tired and on my phone so rip

unkempt hedge
#

yeah, this would be better. because you only need to check 3 cases

somber rampart
#

Uhhhhhhhh

#

Not really you still don't have quite that much info

unkempt hedge
#

because you have mod 3 instead of mod 9

somber rampart
#

Basically just you keep mining at the problem with these kinds of methods

#

Lolwot?

#

I'm so confused those are two separate problems

#

This is why I should not be awake at 3:00

unkempt hedge
#

It is like 10 in the morning here

#

LUL

somber rampart
#

Lol

#

Well anyway

#

These are two separate problems

#

Data mine the one with cubics by factoring on different offsets until something happens and using divisibility arguments and you'll be good

unborn horizon
#

hey guys

#

what does LCD(35,84)=7|14 mean

#

i know that the lcd of 35 and 84 is 7

hardy iron
#

never seen it like that lol

#

usually it's just 7

fathom sierra
#

well a|b means a divides b

#

still I don't understand its meaning here :/

unborn horizon
#

its used here, the problem is i do not know the english term for this

#

NZD -> LCD

hardy iron
#

what does it say under it?

unborn horizon
#

=> a solution exists

#

the first number(LCD) represents the number of solutions this equation has

hardy iron
#

hmm

#

from the 35x + 84y, i think it's saying that we can make it 7 (due to that formula i forgot the name of , basically gcd is the lowest possible sum)

#

and then multiply that by 2 to get a solution for x and y

#

(think it should be gcd actually)

#

lcd should be bigger than both numbers

fathom sierra
#

" the problem is i do not know the english term for this" : the whole equation is called a Diophantine equation

unborn horizon
#

after reading online a bit i found that the |14 is completely irrelevant

remote tendon
#

I assume it's just saying "the gcd is 7, which divides 14"

hardy iron
#

yeah that's what i thought too since you're looking to make sure you can find a sum multiple of 7

unborn horizon
#

It says that if the gdc divides c=> there are valid solutions

#

just found that rule

#

thanks a bunch guys

remote tendon
#

👍

worthy saffron
#

Is anyone interested in talking about the Collatz Conjecture?

sacred junco
#

I wrote a simple python script and gave it a number with 100,000 digits and it converged to 1 after 2402980 steps

hollow basalt
#

What about it?

sacred junco
#

For the collatz conjecture

worthy saffron
#

I looked into the problem for awhile, but there's stuff I don't think people usually talk about. One thing I found interesting is I found 3n+3 and 3n+7 inside of 3n+21

#

@sacred junco was that the largest total stopping time number you found? 2,402,980 steps is...huge...

sacred junco
#

My computer screen started to blink because it was running out of RAM doing calculations on 100,000 digits but I’m sure I can push it further

worthy saffron
#

I'm really curious what the trajectory looks like plotted in an excel chart...

sacred junco
#

I scrawled some notes...

worthy saffron
#

Did you find a number that takes exactly 1,000,000 steps to reach 1?

sacred junco
#

No, but I’m sure you can run a regression and see what is close

somber rampart
#

Collatz meme

#

You can't do a regression

fathom sierra
#

well 2^1000000 does griffon

somber rampart
#

Because it doesn't follow any pattern

sacred junco
#

That is true lol

somber rampart
#

So the regression will be wildly inaccurate

sacred junco
#

Just run a regression on the collection of regressions

somber rampart
worthy saffron
#

I would simply ask a python script to write down what number it used to get 1,000,000 steps in the first place... although I doubt my computer would handle that computation very well.

somber rampart
#

Lol

#

Why are we talking about collatz though

#

It's intractable

worthy saffron
#

I'm obsessed with it and I have the dream to prove it in my lifetime, 2 years down hopefully more to go!

somber rampart
#

Lol

celest plinth
#

yay obsession

somber rampart
#

So do you have any background in analytic number theory and such things?

#

Probably want to start with that GWchinaSakuraThinking

worthy saffron
#

No, that's either a plus or a con. I'm still taking calculus classes...

celest plinth
#

o that reminds me, I saw a cool question on advmath

somber rampart
#

Lol definitely a con to proving it in your lifetime

#

Self-study some number theory

#

Some => a lot

celest plinth
#

prove every positive rational can be expressed (p+1)/(q+1) for some primes p,q

worthy saffron
#

Maybe not. 80 years later, elite math nerds couldn't solve it.

celest plinth
#

I am quite bamboozled

somber rampart
#

Sure but you have to have some background to approach the problem front

sacred junco
#

Yeah my script is actually set up as a game for people who don’t know what the Collatz Conjecture is can try to find the “magic number” but it obviously proves difficult for them lol

celest plinth
#

we don't know enough about interactions between addition and multiplication

#

too spooky

worthy saffron
#

I doubt any of my work now has any value to it, but once I do learn the necessary math to work with it I may have some interesting ideas

remote tendon
#

@celest plinth so that comes down to showing that for any rational a/b there is an n such that an-1 and bn-1 are both prime

#

that seems v difficult

celest plinth
#

wait

somber rampart
#

Addition and multiplication are spooky

celest plinth
#

^ too spooky

worthy saffron
#

This sequence is Collatz-related but I have never seen it before in a paper: 1,1,2,1,1,2,1,1,3,1,1,2,1,1,2,1,1,3,1,1,2,1,1,2,1,1,4,1,1,.....

somber rampart
#

The natural numbers are spooky and unintuitive

#

Cmv

remote tendon
#

my favourite sequence:
1,1,2,1,1,2,2,2,3,1,1,2,1,1,2,2,2,3,2,1,1,2,1,1,2,2,2,3,1,1,2,1,1,2,2,2,3,2,2,2,3,2,...

celest plinth
#

nice

worthy saffron
#

I need a minute to plot that in excel, I'll be back...

remote tendon
#

my sequence is defined by looking at the sequence so far.
f.ex.
the first few terms are 1,1,2,1,1,2,2,2,3,1,1,...
this can be written as 1,1,2,1,1,2,2,2,3 + (1)^2
so the next number is 2

#

1,1,2,1,1,2,2,2,3,1,1,2,1,1,2,2,2,3,
is
(1,1,2,1,1,2,2,2,3)^2 so the next number is 2

#

1,1,2,1,1,2,2,2,3 is just 1,1,2,1,1,2,2,2 + (3)^1 so next number is 1

#

Puzzle: does the number 4 ever appear? 5?

west glade
#

I just saw that one today. was that on reddit?

remote tendon
#

oh, maybe!
i haven't seen it there - where did you?

west glade
#

not sure

#

something something large counterexamples?

remote tendon
#

i'll have a look 🙂

west glade
#

I could be remembering it wrong

worthy saffron
west glade
#

top comment, stackexchange link, scroll down a bit

remote tendon
#

thanks! :D
for the graph did you just copy oeis or did you program it?

worthy saffron
#

I copied it from OEIS

remote tendon
#

ok cool

worthy saffron
#

I don't want to rely on my processing speed to figure out how the pattern works before uploading the graph.

remote tendon
#

yeah i was thinking and couldn't think of a good way to program it

worthy saffron
#

Thanks to whoever decided on the OEIS it was a good idea to paste a "simple chart" that was all in one line...

#

I pasted the whole thing in word just to take out 1-99 and the blank spaces before dumping it into excel.

#

...wait this sequence is based on words?

#

OEIS: "Gijswijt's sequence: a(1) = 1; for n>1, a(n) = largest integer k such that the word a(1)a(2)...a(n-1) is of the form xy^k for words x and y (where y has positive length), i.e., the maximal number of repeating blocks at the end of the sequence so far."

remote tendon
#

"words" as in "sequences of symbols"

worthy saffron
#

I'm still having trouble wrapping my head around this... how do you calculate the first 3 terms?

west glade
#

1

#

11 because you can repeat the 1 one time

#

112 because you can repeat the 1 2 times

#

1121 because you can repeat the 2 one time

#

11211

#

112112

#

and then 112 112 2 because you have '112' two times

worthy saffron
#

so then 122 122 2 1, because it's that one time?

remote tendon
#

and then 112 11 22 2 as you have "2" twice

west glade
#

here with a little bit of colours

remote tendon
#

and then 112 11 222 3 as you have "2" three times

#

and then 112 112 223 1 as you have "3" once

#

basically you work out the highest possible number of repeats at the end of the string

worthy saffron
#

oh ok, that makes more sense, thank you

#

A051064 in the OEIS is based on dividing 3n exactly using the 3-adic metric... How does this sequence work?

remote tendon
#

ok
so the 3-adic valuation of a natural number n is just the number of threes in its factoriation

#

so f.ex the 3-adic valuation of 54 is 3 because

#

54 = 2*3*3*3

#

and that sequence is a(n) = 3-adic valuation of 3n

west glade
#

is there a bot which prints for you the start of the sequence? so that you don't have to look it up?

remote tendon
#

i don't know 🤷🏼

worthy saffron
#

I thought p-adic theory was way more complicated than that...

remote tendon
#

it does get harder and weirder

#

but the "p-adic valuation" number of p in the factorisation is the very first thing

worthy saffron
#

okay, got it. I think it's interesting I came across that same sequence but in a completely different way. I would start with any 5 (mod 6) number and after multiplying by 2 and applying (n-1)/3, checked to see if the resulting number was still a 5 (mod 6) number or not.

#

So 5 = 1, 11 = 1, 17 = 2, and so on

remote tendon
#

ooh interesting
are those definitely the same?

#

is that "number of iterations until it's no longer of the form 6n+5"?

worthy saffron
#

yeah

#

I like to think of it as the "backwards" version of 1,2,1,3,1,2,1,4,1,2,1,3,1,... in terms of the Collatz Conjecture anyway.

remote tendon
#

yeah :D

worthy saffron
#

I want to see if I can prove it...

remote tendon
#

yeah it's not immediately obvious that the two sequences are the same.
i'll have a go too :D

#

ok I have shown it 😀
let me know if you'd like me to share it
(there's a bit of complicated notation but I'd be happy to explain any of it)

worthy saffron
#

I'm stuck on [(12n+10)-1]/3 = cuberoot(3n/2)... If that's even right...

remote tendon
#

i should probably share mine

worthy saffron
#

yeah

remote tendon
#

ok:

#

basically, every time you do the reverse-Collatz, you reduce the number of threes in the factorisation of n by one

worthy saffron
#

Man you made that look easy... what the heck was I trying to do...

remote tendon
#

i've had a lot of recent practice with this area of maths haha

#

do you understand the argument?

worthy saffron
#

I think my understanding of calculus and function notation are failing me... For a minute there I thought you did a derivative...

remote tendon
#

I accidentally wrote f^(k) a couple time actually haha

#

and had to correct it to f^k

worthy saffron
#

Is this gone over in modern algebra...? Or am I better off finding a book somewhere and starting from there?

remote tendon
#

hm

glad nacelle
#

I think an algebra class probably won't go over it

#

Mine didn't at least

remote tendon
#

like most of the ideas above are basic number theory

#

the only weird thing is p-adic valuation

#

i didn't look at that at all until i didn't a course covering (among other things) metric spaces

glad nacelle
#

Did they introduce Q_p as the completion of Q with that metric?

worthy saffron
#

I'm starting to wonder if what work I did on the Collatz problem is either super obvious or is traces of higher level math in the disguise of made up notation and subtraction...

#

For example, I know that it is possible to figure out how to find numbers that start their trajectories through defining a specific behavior... For example, if I wanted to find numbers that after applying 3n+1 only divide by 2 once, there's a formula for that: 3+4n. I actually just finished writing a java program that allows for me to do this...

celest plinth
#

(Both)

worthy saffron
#

I'm sorry in advance for the made-up notation. "nß(x)" basically means how many times you can divide by n, x number of times. For example, 2ß(2) means that applying 3n+1 to n will result in an even number that divides by 2 twice. And then it will do the exact same thing a second time.

worthy saffron
#

I colored in parts of the graph to show how the formula applied to the trajectory of 3883.

wind spear
#

hi i'm new to the channel. Is anybody willing to point out what are the relations between the Collatz conjecture and prime numbers or maybe specific cases regarding uneven numbers, if there are any? Possibly link some articles? I'm not a mathematician nor a student! I'm asking on behalf of someone else.

real peak
#

Hi guys, I'm trying to find a space efficient way to get all primes below a certain number. I'm not allowed to use any additional arrays (other than the output array), so all Sieves are out.

#

can you see any way to optimize this? can I use multiples or sqrt somehow to iterate fewer times?

#
void genPrimes(int num) {
    primes3.push_back(2);
    primes3.push_back(3);

    for (int candidate = 5; candidate < num; candidate += 2) {
        bool bIsPrime = true;

        for (int prime : primes3) {
            iterationsCustom++;

            if (candidate % prime == 0) {
                bIsPrime = false;
                break;
            }
        }

        if (bIsPrime)
            primes3.push_back(candidate);
    }
}```
#

like in the outer loop, could I iterate up to the Sqrt(num) or somehting? (already tried taht, doesnt work) - but something similar?

#

i just cant see it! Please help!

worthy saffron
#

@wind spear From what I did in my own time, I have not found any connections between prime numbers and the Collatz Conjecture. However, several attempts have been made to connect the two. I can't say how successful those attempts were.

snow basin
#

I m looking for a proof of a result related to miller rabin's test. It states that if a numer n is composite then there are at least 3/4*(n-1) classes a in (Zn)* such that a ensures that n is composite.

#

(ie the necessary condition given by miller rabin tests for n to be prime fails)

#

fails when you test with a*

lyric adder
#

@real peak you can check all divisors up to the sqrt of your number

#

i think this is one of the most efficient prime checking methods

sturdy dirge
#

@real peak If the square root doesn't help you then you can't do better than that. (Sieves and sorting maybe)

sturdy dirge
#

@real peak Try this: ```haskell
#include <iostream>
#include <vector>

void genPrimes(int num, std::vector<int>& primes3) {
primes3.push_back(2);
primes3.push_back(3);

for (int candidate = 5; candidate < num; candidate += 2) {
    bool bIsPrime = true;

    for (int prime : primes3) {
        //iterationsCustom++;
        if (prime * prime > candidate)
            break;

        if (candidate % prime == 0) {
            bIsPrime = false;
            break;
        }
    }

    if (bIsPrime)
        primes3.push_back(candidate);
}

}

int main()
{
std::vector<int> prime;
int n = 1 << 20;
genPrimes(n, prime);
std::cout << prime[prime.size() - 1] << std::endl;
return 0;
}

real peak
#

@sturdy dirge omg that's magical!

#

how did you do that?

#

I dont understand why it works...

#

this is almost as fast as sieve of eratosthenes but with ZERO additional space!

#

I've never seen this implementation anywhere, why doesnt anybody know about this?!

fringe knot
#

@sturdy dirge you could probably make it a bit more efficient by only checking +- 1 mod 6

#

checks like 1/3 fewer numbers

sturdy dirge
#

I start to see the difference only for $$n > 2^{23}$$.

stoic basinBOT
wind spear
lyric adder
#

you really should only check for divisors up to the sqrt

#

@sturdy dirge

sturdy dirge
#

That's in the code.

ebon kettle
#

in page 67 of the pdf I just sent, one part says: The solution: strengthen the hypothesis from the start. Let us replace 3n with 3n + 1.

#

the middle part to be more specific.

#

Why do you replace 3n with 3n + 1? I don't understand how this is allowed or how this proves the original question (bottom of page 66 in the pdf)

hardy iron
#

what's the actual page number?

#

pg50?

#

didn't read the whole thing but...

#

=tex \frac{1}{\sqrt{3n+1}} \leq \frac{1}{\sqrt{3n}}

#

$$ \frac{1}{\sqrt{3n+1}} \leq \frac{1}{\sqrt{3n}} $$

#

bot's dead but u get the idea

#

(\leq means less than or equal to)

ebon kettle
#

sorry for the late response

#

the actual page number is 50 yes

#

I don't understand the notation that you used .-.

#

could you just tell me why the author uses 3n + 1 in words? @hardy iron

hardy iron
#

1/sqrt(3n+1) is less than or equal to 1/sqrt(3n)

#

related example:

#

show -3 < 0

#

well if i know -3 < -1 then i know that -3 < 0

#

since -3 < -1 < 0

ebon kettle
#

oh yeah

hardy iron
#

(that's the kind of logic they used)

ebon kettle
#

ohh but what exaclty was the -3, -1 and 0 in that case?

hardy iron
#

original is -3<0

#

the new thing they added in is the -1

ebon kettle
#

OHHH

#

Thanks so much XD

hardy iron
#

np

ebon kettle
#

I get it now 😄

ebon kettle
#

wait @hardy iron sorry for pinging you again but how do you solve 2.3.13? It reads: Prove that there is no smallest real number ( at the bottom of page 50 in the problems and exercises section)

hardy iron
#

i'm thinking by saying that there is a smallest real number and then find a contradiction

#

Let n be arbitrary.
Suppose n is the smallest real number.

#

[insert contradiction here]

#

Thus, n is not the smallest number.

#

Therefore, since n is arbitrary, there is no smallest real number.

ebon kettle
#

ohh

#

i'll try that, Thanks again!

hardy iron
#

yw

placid lintel
rocky spear
#

I have difficulty understanding complex number anyone explain

shrewd marsh
#

What exactly are you having trouble with?

stray gale
#

To understand an imaginary number it helps to physically look at a complex plane. The Real axis is just your good old number line from 1st grade

#

The Imaginary axis is just an extension

#

When you read numbers, 3 would mean to count three on your number line right? How about -3? Think of it as -1 times 3. Count 3, then flip 180° to the west axis about the origin. Seems like a silly way to get to the answer, right? Well, it can help you understand "I" a little better I think.

#

What would 3i be? It's 3 times i. Count to three, then rotate 90° to the north axis. This is what i does.

#

What about -3i? Well, count to 3 on the east axis as usual, then the negative tells you to flip 180°, and the i a further 90°, landing you on the southern axis.

#

You probably once learned this set of rules:
1 = 1
i = i
i² = -1
i³ = -i
i⁴ = 1

#

Think about the "rotations" I told you about, and it should make sense now

#

If you multiply 3 by i twice, or 3i², doesn't it make sense that it would be -3? You're turning 90° twice, which is just like saying a 180° turn, which is why it turns into a negative :)

#

Not sure if this helps your understanding or not, you're welcome to ask questions @rocky spear

#

As for operations, they can all be represented visually in the complex plane above. You can see how those numbers cannot be described in just one term, because they're not on an axis. They're self-explanatory. If it says 1+2i, just go over 1 on the + axis and up 2 on the i axis, like reading coordinate pairs. This is easier than thinking about it the rotation way, and you should do it like this in most cases. But it helps to understand the "rotations" when you're new because that explains what's really happening. Add i, you slide up the i axis. Multiply by i, turn 90° about the origin. Get it?

#

Best wishes!

rocky spear
#

@stray gale thank u ana so much it really helps

stray gale
#

@rocky spear let me know if you need help getting started but I hope that site opens enough doors for you to explore on your own :)

blissful venture
#

They are technically numbers

#

👀

flat rock
#

Isnt number theory about integers?

#

👀

shrewd marsh
vast vessel
#

\👀 wut about complex numbres with real part 1/2?

stray gale
#

Wait so if i is the square root of -1,

#

Wouldn't the fourth root of -1 be like,

#

sqrt(2)+sqrt(2)i?

serene ferry
#

‘The fourth square root’

fringe knot
#

yes @stray gale

#

although there are more solutions to x^4 = -1

#

so idk which one would count as the 4th root

ember cove
#

@stray gale the principal fourth root (the fourth root with smallest argument in [0,2pi)) of -1 is (1+i)/sqrt(2)

trim matrix
#

Hey guys does anyone have a good resource on the Second Principle of Finite Induction.

#

I'm still kind of confused as to how the First and Second differ in execution

#

maybe theres an example that shows the First and Second Principles being used to prove the same question kind of side by side

ember cove
#

basically you use the first principle when you only need to know about the immediately previous state in order to prove the proposition in the next state

#

but sometimes you need to know that the proposition holds in the last two states, or the last three, or even all of the previous states, to prove that the proposition is true in the next state

#

rough example: suppose you want to prove an exact formula for the Fibonacci number F(n).
You know that F(n) = F(n-1) + F(n-2), so to prove the formula for F(n) it's not enough just to assume that the formula is true for F(n-1), you also have to assume it's true for F(n-2).

trim matrix
#

ok so it kind of expands on the first principle

ember cove
#

So you can't use the first principle in that case. You need to use something stronger. The second principle, in which you would assume that the formula holds for all previous Fibonacci numbers, works though.

#

yeah

#

ultimately they imply the same thing, that the proposition is true for the whole sequence, but they get there in different ways

trim matrix
#

ok cool

unkempt hedge
#

If n is an integer, n/2 is a square number and n/3 is a cubic number. What is the lowest possible value for n?

blissful venture
#

2 * a * a = 3 * b * b * b

#

=> 2 divides b, and 3 divides a

#

=> 9 divides b, and 8 divides a

unkempt hedge
#

🤔

blissful venture
#

Aye, I'll go get a paper

#

=> 273 divides a 3think

#

I think I'm approaching this wrong

#

Ok, it might be simpler to do this,

#

write n = 2^x * 3^y

#

n/2 = 2^(x-1) * 3^y

#

x-1 is even, y is even

#

similarly

#

you get x is divisible by 3, and y-1 is divisible by 3

#

smallest numbers to fit this gives 2^3 * 3^4

drifting trench
#

n should be divisible by 6

blissful venture
#

I hope I didn't mess up somewhere

drifting trench
#

I don't think you did

blissful venture
#

Aye, seems to fit the answer

#

bonus to use CRT would be to add n/5 is a fifth root 👀

drifting trench
#

648....Hmm

#

It works, yeah

#

Hmmm

unkempt hedge
#

@blissful venture What do you mean by x-1 is even?

blissful venture
#

n = 2^x * 3^y

unkempt hedge
#

yes and then you say that x-1 is even because n/2 = 2^(x-1) * 3^y

blissful venture
#

yes

#

because n/2 is a perfect square

unkempt hedge
#

oh, it has to be even because it is a square

#

and then you say y-1 needs to be divisible 3 and x needs to be divisible by 3

#

Ok, thank you

blissful venture
#

🍻

ebon kettle
#

Hi I was just wondering what this is called in english? I learned it recently in a korean high school math book

#

P(n,k) and S(n,k)

#

its a partition (something in number theory and combinatorics apparently) but what is P(n,k) and S(n,k) called?

#

is P(n,k) something like partition of real numbers

#

and S(n,k) partition of a domain?

mossy folio
#

Look up the Korean wikipedia page and switch the language to English. Works every time.

ebon kettle
#

wait but do u know what im talking about?

#

like for example P(4,2) = 2 because
4 = 1+3
4 = 2+2

#

so n is the sum of all the digits

#

and k is the number of digits that you use to create that value

mossy folio
#

I have no idea.

graceful notch
#

yes partition

dense adder
#

Help

elder bobcat
#

no

#

jk

drifting mantle
#

I think you chased him away -_-

pearl storm
#

Hey

#

I have a question, and it just popped up in my mind when doing something online so I don't know how it will look like in hindsight

#

If I have 1 dollar, and you have 100, we can say that you have 100 times as many dollars as many

#

but what if I have no dollars ?

#

How many more do you have ?

#

Can we simply state this in a finite quantity ?

#

I have a feeling that the answer should be infinity

olive raptor
#

Just say, "Imbroke, and you're not"

#

I'm broke*

pearl storm
#

LOL

final field
#

@pearl storm thats similar to asking whats something divided by 0

#

it cant be infinity because infinity * 0 is still 0

pine geyser
#

NOOOMBA FEORY

pine geyser
#

if that's true

#

what happens if u multiply both sides by 0, does the equation still hold?

#

100=/=infinity*0

somber rampart
#

@sacred junco a/x as x goes to 0 is not infinity

#

It's +/- infinity

somber rampart
#

?

#

it's like undefined

#

the limit does not exist

#

the absolute value tends to infinity

#

it doesn't even tend to infinity though

#

you can say 1/0+ is infinity

#

and 1/0- is -infinity

#

and split 0 into {0+, 0-}

final field
#

assume 1/0 is infinity

#

1 = infinity * 0

#

anything times 0 is 0

#

1 = 0

#

infinity doesn't work

#

and plus-minus infinity doesn't help

#

do you see the problem when you try to trivialize division by zero?

somber rampart
#

infinity * 0 ≠ 0

#

"is infinity'" can mean a lot of things think_astolfo

final field
#

are we assume some magic infinity that can make nothing into something

somber rampart
#

that's how infinity can do things sometimes

final field
#

ok then

#

1/0 = k

#

k is our magic infinity

somber rampart
#

so k * 0 ≠ 0 think_astolfo

final field
#

2/0 = 2k

#

whats 0/0

somber rampart
#

undefined

#

1/0 is defined, 0/0 isn't ^^

#

look into wheels

final field
#

mhm

#

thats the problem

somber rampart
#

that's not too much of a problem

final field
#

division by 0 can never be entirely consistent

somber rampart
#

I mean you could make it complex infinity

#

it can be though

final field
#

do it

#

even if you pull out your fancy riemann spheres there will always be a flaw somewhere

#

even if its a small problem its still a problem, faye

somber rampart
#

take the {0} field

#

0/0 = 0

#

0 = 1

#

0 + 0 = 0

#

0 * 0 = 0

final field
#

what

#

0 = 1 what

somber rampart
#

this is not the real numbers it's the field of {0}

final field
#

ok heres the thing

#

if you bend the rules you can make anything happen

somber rampart
#

some axiom lists say a field cannot have 0 = 1 but tbh it's just because you have to leave it out of usual theorems about fields

#

Yeah that's the point

final field
#

lets have normal rules

somber rampart
#

@sacred junco was too broad thinking, you're too narrow thinking

#

but the bended rules are important because you get 0 maps

#

and 0 maps are useful in things like homology

sacred junco
#

define normal rules @final field

vast vessel
#

@final field said normal rules, as you've shown, prove that 1/0 cannot exist

final field
#

1/0 = n
1 = n * 0
1 = 0
false

#

and n * 0 will always be 0 because thats how real numbers work

sacred junco
#

who says 1/0 is a real number

#

i sin't a real number and we have no problem with that

somber rampart
#

^

#

sqrt(ab) = sqrt(a)sqrt(b) holds normally

#

but then we get
1 = sqrt(1) = sqrt((-1)(-1)) = sqrt(-1) sqrt(-1) = i * i = -1

#

oops

#

broke maffs

#

when you want to do things outside of the normal scope you have to broaden your definitions

#

sometimes it makes things trivial

#

like the {0} field

sacred junco
#

How many of u guys are preparing for the imo ??

torn moat
#

how to number theory

#

also is this hannnel dead

digital wigeon
#

can someone explain the number 5 to me.

#

im mostly good with the other numbers, but 5 always confuses me

sacred junco
#

understandable

#

I try to think of the numbers less than 5 as complex numbers so that I'm not so lost

#

since it's easier to do stuff like i * i=-1 instead of 2 * 2=4 or like i+(-i) = 0 instead of 2+3 = 0 mod 5

sacred junco
#

5 is hard

#

Not all of us are born with the ability to think of 5 as what it really is

#

But for us who can, we know that 5 is 5

torn moat
#

lol

sacred junco
#

fun problem to try to generalize this

lofty ridge
#

12345678910

#

e = mc cube

digital wigeon
#

🕓 🔺

flat rock
#

3^2+4^2=5^2

#

👀

digital wigeon
#

0^2 = 0

sacred junco
#

good start @flat rock

flat rock
#

No integer solution for 7 consecutive squares

#

The first 4 adding up to the last three

#

:/

misty pebble
#

21² + 22² + 23² + 24² = 25² + 26² + 27²

sacred junco
#

nice

#

I guess it's no fun for me, I already worked out the answer

flat rock
#

Alternating triangulars

#

The smallest terms are 3, 10, 21, 36...

#

I guess the next one will be 55

lofty ridge
#

answer is 1

sacred junco
#

there's an explicit formula for the smallest term, given the number of terms

flat rock
#

Yeah

sacred junco
#

so like let's call 3^2+4^2=5^2 the n=1 term and so on

#

what's your formula for the smallest number

flat rock
#

0 term is 0?

digital wigeon
#

0^2 = 0

flat rock
#

Ok

lofty ridge
#

wrong

#

1

flat rock
#

Gimme a sec

sacred junco
#

or rather, show your derivation

#

that's more interesting than trying to brute force curve fit or something lol

lofty ridge
#

use calculato

flat rock
#

2n^2+n

#

Easy as that

misty pebble
#

Muh hexagons

sacred junco
#

lol insightful answer matt

flat rock
#

I used a thing that i found a while ago in a book

#

I think it was gardner

digital wigeon
#

it is better to find the middle term for some hot steamy symmetry

sacred junco
#

^

#

that's how I solved it

flat rock
#

Its called finite difference method

#

Or something like that

#

It works to find the discrete function for a sequence of integers

sacred junco
#

so you'd need to have cases to use to find it then?

flat rock
#

Just a sequence of terms of a polynomial function

sacred junco
#

show your working

misty pebble
#

Eh, isn't that still just fitting a curve to it?

sacred junco
#

yeah^

flat rock
#

Where x=1, 2, 3...

#

Yes

#

It is

lofty ridge
#

45678910

sacred junco
#

so your solution just assumes that there's always a solution

lofty ridge
#

wrong

#

its answer

flat rock
#

It looked like triangular numbers

misty pebble
#

Dangerous route to go there :x

lofty ridge
#

numbers arnt triangles

flat rock
#

Because 3, 10, 21, 36...

#

So i just assumed it was like that

sacred junco
#

lol

#

=tex \sum_{k=1}^N (n-k)^2 + n^2 = \sum_{k=1}^N (n+k)^2

wild zinc
#

"looks like" :^)

stoic basinBOT
sacred junco
#

this is how I solved it

misty pebble
#

Place n points on the edge of a circle and join them, what's the maximal number of sections in the circle?

sacred junco
#

=tex n^2 = \sum_{k=1}^N 4 nk

stoic basinBOT
misty pebble
#

First few look like 1, 2, 4, 8, 16, ... :^)

sacred junco
#

hahaha good one

lofty ridge
#

17

#

18

#

19

#

20

sacred junco
#

what's the sequence?

#

1, 1, 2, ...?

lofty ridge
#

12345

flat rock
#

3

#

5

#

8

#

👀

sacred junco
#

lol

flat rock
#

Or anything else

wild zinc
#

6,24,120,720,5040,40320,362880,3628800

sacred junco
#

closer but

#

actually I was evaluating n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#

at n=0, 1, and 2

flat rock
#

👀

lofty ridge
sacred junco
#

kek

lofty ridge
#

solve this problem

misty pebble
#

Okay how about this one:

lofty ridge
#

123456789

#

whats next

misty pebble
#

Pi/2, Pi/2, Pi/2, Pi/2, Pi/2, Pi/2, Pi/2, ....?

sacred junco
#

lol

misty pebble
#

:^)

sacred junco
#

I know this integral

misty pebble
#

Aaaa, spoilers

flat rock
#

Not rational

#

👀

misty pebble
#

Eh

#

1/2 then

lofty ridge
#

123456789

#

123456789

#

123456789

#

123456789

#

😮

flat rock
#

Arcsin (1+0n)

lofty ridge
flat rock
#

👀

lofty ridge
#

guys lets play minecraft

misty pebble
#

Close, but the next one was actually 1/2 - 6879714958723010531/935615849440640907310521750000

sacred junco
#

oof

lofty ridge
misty pebble
#

Google "surprising sinc sums" or something :^)

flat rock
#

There are infinitely many functions that intersect a finite set of points

sacred junco
#

In mathematics, a Borwein integral is an integral involving products of sinc(ax), where the sinc function is given by sinc(x) = sin(x)/x for x not equal to 0, and sinc(0) = 1.These integrals are remarkable for exhibiting apparent patterns which, however, eventually break dow...

misty pebble
#

Ah that was the name, couldn't think of it

flat rock
#

I just took what seemed a nice solution

sacred junco
#

I think the problem you posted earlier with the circle was from polya

digital wigeon
#

number of different differentiable structures on R^n (starting at n = 1): 1, 1, 1, ∞, 1 ,1, 1, 1,...

sacred junco
#

if I were god that's what I'd do

flat rock
#

My formula worked for n=5

#

👀

sacred junco
#

nice just gotta check it empirically for all n>5 and you're done

flat rock
#

Sad

#

Well i guess ill prove it

#

=tex n^2 =4n~ \sum_{k=1}^N k

#

This is what you get when you simplify the thing

#

4n is a constant

#

So

stoic basinBOT
flat rock
#

Divide by n

#

=tex n = 4~\sum_{k=1}^N k

stoic basinBOT
flat rock
#

Then you expand the thing and should get it

#

But its the middle number this time

#

Now cubes ;)

#

3^3+4^3+5^3=6^3

#

Ew cubic equations

sacred junco
#

nice

#

yeah I was somewhere else I would like to look into the cubic stuff

#

I guess is this the natural way to go about it, instead of n+1 on the left and n on the right it's n+2 on the left and n on the right?

lofty ridge
#

no

#

n for noobs

flat rock
#

@sacred junco yes

sacred junco
#

hello

#

is it possible to solve this

#

=tex \sum _{n=0}^{\left\lfloor \frac{\log (x)}{\log (10)}\right\rfloor } 10^{-5 n} \left((x \bmod 10^{n+1})-(x \bmod 10^n)\right)^5 = x : { x \in Z }

stoic basinBOT
vast vessel
#

@sacred junco thonker didn't I already explain that one

sacred junco
#

yeah check the posting time tho @vast vessel

vast vessel
#

exactly

#

🔨

torn moat
#

can anyone teach me like basic euler toitent stuff like if i wanted to find the last 3 digits of 3^185 lets say how would i do that

#

i remember looking it up and figuring out but i completely forgot

wild zinc
#

3^185 mod 1000,phi (1000) =400 so I'm not sure euler's totient theorem is going to help you much here

torn moat
#

heh

wild zinc
#

you could try exponentiation by squaring but without a calculator it's still going to be a pain

mossy folio
#

Just type it into a Python interpreter or WolframAlpha:
18511095575145533338447403836109581505353226740782032803932380476024584374357028238763043

torn moat
#

kek

#

what if i did

#

2^29340923480238

#

do u have enough bits

#

to store that

#

xd

wild zinc
#

mod 1000? sure

mossy folio
#

Python has arbitrary precision integer handling.

wild zinc
#

2^238 mod 1000

torn moat
#

oof python

#

ik ik but what if i cant use python

#

:^)

mossy folio
#

You use C++.

torn moat
#

i mean like if its during a math competition lol

wild zinc
#

2^21 = 2097152, 128152104856, 124152128, 872152, 544

#

I think the last three digits are 544

#

nope wolfram says 944

torn moat
#

lol

wild zinc
#

close enough

#

in a competition you'd almost certainly get paper :^)

torn moat
#

lol

#

i need help on most of the questions tbh

#

i keep like

#

understanding

#

and then forgetting later

#

how to do them

sacred junco
#

In a long competition you could just try to find the period

#

I mean, whatever is necessary amirite

torn moat
#

i find the period ... i find it every month

mossy folio
#

well, this was unexpected

torn moat
#

:^)

fringe girder
#

Why is it that some numbers are hard to check primality for?

#

I was reading about the fibonacci primes and I took the largest one and added 1000 to it then tried checking whether that number was prime in mathematica. I left it running for an hour and it couldn't compute it

#

I tried all the odd numbers near it and they instantly gave results

vast vessel
#

wdym u took the largest and added 1000

wild zinc
#

some numbers have prime factors that are easy to find (small or p-1 or p+1 is very smooth)

#

Which makes it easier to say that they aren't prime

fringe girder
#

@vast vessel I took the largest know fibinacci prime (n = 3341167) then tried seeing iif that number + 1000 (n = 3342167)

sturdy dirge
#

For which $$n\in\mathbb{N}, m = 2n+1, \sum\limits_{k=0}^{m-1}\genfrac{(}{)}{}{}{k}{m}\binom{m}{k}=0$$ ?

stoic basinBOT
sacred junco
#

Like 3?

sturdy dirge
#

Is it the only ?

sacred junco
#

The only what?

sturdy dirge
#

Is that the only integer n that verifies the equation ?

sacred junco
#

m=2n+1, m in Z?

sturdy dirge
#

$$m\in\mathbb{N}$$.

stoic basinBOT
sacred junco
#

What's the E mean?

sturdy dirge
#

E or $$\in$$ (it means 'in') ?

stoic basinBOT
sacred junco
#

Shouldn't those be quotation marks, not apostrophes?

sturdy dirge
#

Maybe.

sacred junco
#

Are you sure?

sturdy dirge
#

The question is more interessing that my notation. Can you answer it ?

sacred junco
#

Answear?

torn moat
#

m-

sacred junco
#

this is a fun problem @sturdy dirge

#

I'm assuming this is a fraction not a legendre symbol?

#

=tex (1+x)^m = \sum_{k=0}^m x^k \binom{m}{k}

stoic basinBOT
sacred junco
#

I'd start here

#

then take the derivative wrt x

#

=tex m (1+x)^{m-1} = \sum_{k=0}^m k x^{k-1} \binom{m}{k}

stoic basinBOT
sacred junco
#

divide both sides by m and then plug in x=1

#

=tex 2^{m-1} = \sum_{k=0}^m \left( \frac{k}{m} \right) \binom{m}{k}

stoic basinBOT
sacred junco
#

then I'd subtract out the k=m term from both sides

#

=tex 2^{m-1} - 1 = \sum_{k=0}^{m-1} \left( \frac{k}{m} \right) \binom{m}{k}

stoic basinBOT
sacred junco
#

so now we want that to equal 0, so

#

=tex 2^{m-1} -1 = 0

stoic basinBOT
sacred junco
#

that means m=1

#

which, since m=2n+1 means that n=0

sturdy dirge
#

@sacred junco Sorry, but it is a Jacobi symbol .

sacred junco
#

haha rip

sturdy dirge
#

I partially solved, is there a solution for n even ?

torn moat
#

,

bronze breach
#

I managed to turn a piecewise function into a non-piecewise function :D

These two functions are equivalent at all natural numbers.

Can all piecewise functions be collapsed this way?

sacred junco
#

yes

#

if you have something that's true for particular congruences, it boils down to writing a fourier series essentially

#

I guess the 0^0 part is how you can get the stepwise aspect of n<=3 in there

#

=tex g_0(x) = \frac{1+(-1)^x}{2} \ g_1(x) = \frac{1-(-1)^x}{2}

stoic basinBOT
sacred junco
#

so in the even odd case it's pretty easy to decompose the 0 mod 2 and 1 mod 2 parts apart like this

#

it's probably better to write these as e^{i 2pi / 2} to see the generalization clearer

#

=tex h_0(x) = \frac{1 +e^{\frac{i 2\pi }{3}x} + e^{\frac{i 2\pi }{3}2x}}{3}

stoic basinBOT
sacred junco
#

0 mod 3 version

#

you can differentiate as a trick to generate the next two

#

etc etc

bronze breach
#

I've never seen that trick before, very interesting. I was taking advantage of how remainder of n/k can be rewritten as x - kfloor(x/k)

#

Do you know where I could find more information on using fourier series this way?

sacred junco
#

idk I came up with this myself

#

I'm sure I didn't invent it first though or anything

#

I can explain it better maybe type something up for you if you like

#

show some examples or something

#

I wouldn't mind figuring out how to do this a bit more generally with some inequalities and stuff too

bronze breach
#

Sure, that sounds interesting

sacred junco
#

I think you could even do this piecewise function as an infinite series if you try to fit it to a polynomial with a vandermonde matrix or something too

#

I dunno it's been a while since I last talked to you I forget what sorta stuff you know lol

#

actually what do you mean when you write this anyways

#

=tex 0^{0 \lfloor \frac{x}{3} \rfloor}

stoic basinBOT
sacred junco
#

I was kind of assuming it's like an indicator function

bronze breach
#

"Zero to the power of (zero to the power of the floor of x/3)"

sacred junco
#

oh the 0 is to the power as well

bronze breach
#

I needed something that was 0 at [0, 2] but 1 at (2, infinity)

#

That worked nicely

sacred junco
#

I see the way I've come to this same sort of thing is to put the fourier series in the exponent of 0 or something like this

#

I haven't through about this kinda thing in a while

bronze breach
#

Ah shoot I mistyped the piecewise function. It's supposed to be n <= 2, not 3

sacred junco
#

let me think here

#

=tex \left\lfloor \frac{1}{n} \right\rfloor

stoic basinBOT
sacred junco
#

this is 1 at n=1 and 0 for n>1

#

I don't know if this can be doctored up into something a bit nicer or if it's just about as ugly as 0^0^stuff

#

just a thought maybe

bronze breach
#

Hm

#

I wanted the function defined at 0

#

But actually that may have been a mistake haha

This is a solution to a sequence, and typically those start at 1, correct?

#

Oh boy. I might as well rewrite it so that f(1) represents the first term of the sequence instead of f(0). Not sure what I was thinking

sacred junco
#

really doesn't matter

#

if you want to shift it, that's not really anything to worry about redefine it as g(x) = f(x-1)

#

or vice versa

#

=tex \left\lfloor \frac{1}{1+n} \right\rfloor

stoic basinBOT
sacred junco
#

this is 1 at n=0 and 0 for n>0

#

I really only ever worry about whether the first term should have index 0 or 1 if I end up with some kind of n+1 or n-1 in my formula that I want to get rid of

#

I think generally a lot of number theory stuff just ends up starting at 0 because 0, 1, 2, 3, 4 is a nice way to think mod 5 instead of 1,2,3,4,5

bronze breach
#

=tex \left\lfloor \frac{3}{n+1} \right\rfloor

sacred junco
#

actually here's something quite ugly but workable

stoic basinBOT
bronze breach
#

That works for 1 and 2, just not 3

sacred junco
#

=tex J(n):= \left\lfloor \frac{1}{(1+n)^2} \right\rfloor

stoic basinBOT
sacred junco
#

oh ok yours might be fine then

#

this is more like just a single spot

#

J(0)=1 and J(n)=0 otherwise

#

hmm maybe not actually I am distracted but

#

I just imagined once you have one single point, you can add and subtract a function arbitrarily many times

bronze breach
#

=tex \left\lfloor \frac{5}{n+2} \right\rfloor

stoic basinBOT
sacred junco
#

pretend J(n) =1 at n=0 and J(n)=0 otherwise, then you can make A(n) =[J(n-1)+J(n-2)] and B(n) = 1-A(n) to make a stepwise

bronze breach
#

How could you translate that to "be 1 from [a, b] and 0 elsewhere?"

#

Also, I wonder if $$J(k) := \left\lfloor \frac{2k-1}{n+k-1} \right\rfloor$$ works for [0, k]

stoic basinBOT
bronze breach
#

I believe it does

#

Now I'm wondering what the compliment would be.

In the case of 0^0^floor(x/4), that's 0 from 1 to 3 but 1 elsewhere.

Meanwhile 0^floor(x/4) is inverted: it's 1 from 1 to 3 but 0 elsewhere

#

Oh I suppose just flip it: $$\left\lfloor \frac{n+k-1}{2k-1} \right\rfloor$$

stoic basinBOT
sacred junco
#

I guess this is over all doable and a fun exercise

#

I think it kind of obfuscates the writing of the function

#

even though piecewise does kinda suck in its own way

bronze breach
#

Oh it absolutely does obfusctate things. I was just curious if this was possible.

#

A generalized method of transforming a piecewise function would still be exciting to see haha.

Also, what would you recommend for making the piecewise function not suck?

sacred junco
#

oh nothing, it's just the least of two evils I think haha

#

I think it's not a bad idea to just use a step function though

#

maybe define like

#

=tex H(n) := \left{ \begin{matrix} 0 & n<0 \ 1 & n\ge 0 \end{matrix} \right.

stoic basinBOT
sacred junco
#

then by shifting and subtracting you can make anything

#

=tex f(n) = g(n) H(n-3) + h(n)(1-H(n-3))

stoic basinBOT
sacred junco
#

let me see did I do that right

#

it should be f(n)=g(n) when n<3 and f(n)=h(n) when n>=3

#

actually I did it backwards

#

oh well, that's probably the cleanest way if I had to do it

#

at the end of the day floor functions are just some other arbitrarily defined function

#

using them to make a step function is just hacky

bronze breach
sacred junco
#

hahaha I've done similar things in the past

#

like arccos(cos(x)) to make a triangle wave

bronze breach
#

Really? I'd love to see

I have a sort of kink for seeing ways of defining "arbitrarily defined functions" using less arbitrarily defined functions

#

My gateway drug was the realization that sqrt(x^2) was synonymous with abs(x), at least for real numbers

sacred junco
#

well I guess some of these are using different functions but arcsin(sin x) is in there, same thing basically as arccos(cos x) not much to that I think

#

but it can be fun to fool around with stuff

bronze breach
#

It really is

#

The sequence the function was a solution for went 1, 1, 1, 2, 2, 3, 2, 4, 3, 5...

Essentially, you have 3 counters A, B, and C. You increment A, then B, then C, then back to B, then A, then B, then C, etc. Each turn you keep track of what each counter is at.

sacred junco
#

oh I see you're zig zagging back and forth

#

or no I don't quite get it actually