Alexander Bass

Math Notes Spring 25

Fibonacci Moduli

For the Fibonacci sequence, defined by F1=1,F2=1,Fn=Fn1+Fn2F_{1} = 1,\> F_{2} = 1,\quad F_{n} = F_{n-1} + F_{n-2}

I believe the following is true (Haven’t found any counterexamples)

(Fnmodn)0when(nmod6){2,3,4} (F_{n} \operatorname{mod} n) \ne 0\quad \text{when}\quad (n \operatorname{mod} 6) \in \{2,3,4\}

Calculus of inverses

Let f(x),g(x)f(x), g(x) be functions that are defined and differentiable over some interval. Further, let

f(g(x))=xg(f(x))=x \begin{aligned} f(g(x)) &= x\\ g(f(x)) &= x\\ \end{aligned}

Such that g,fg,f are inverses.

Differentiate by chain rule.

f(g(x))g(x)=1 f'(g(x))g'(x) = 1 g(x)=1f(g(x)) g'(x) = \frac{1}{f'(g(x))}

This already has some neat results

f(x)=sin(x)g(x)=sin1(x)ddxsin1(x)=1cos(sin1(x)) \begin{aligned} f(x) &= \sin(x)\\ g(x) &= \sin^{-1}(x)\\ \frac{d}{dx} \sin^{-1}(x) &= \frac{1}{\cos(\sin^{-1}(x))} \end{aligned} f(x)=cos(x)g(x)=cos1(x)ddxcos1(x)=1sin(cos1(x)) \begin{aligned} f(x) &= \cos(x)\\ g(x) &= \cos^{-1}(x)\\ \frac{d}{dx} \cos^{-1}(x) &= -\frac{1}{\sin(\cos^{-1}(x))} \end{aligned} f(x)=tan(x)g(x)=tan1(x)ddxtan1(x)=1sec2(tan1(x)) \begin{aligned} f(x) &= \tan(x)\\ g(x) &= \tan^{-1}(x)\\ \frac{d}{dx} \tan^{-1}(x) &= \frac{1}{\sec^2(\tan^{-1}(x))} \end{aligned}

These aren’t the standard forms you’re familiar with, but they are equivalent.

By this we can create a very annoying looking integral (for fun of course).

1sec2(tan1(x))tan1(x)2dx \int \frac{1}{\sec^2(\tan^{-1}(x))\tan^{-1}(x)^2} \,dx

Textbook derivatives

I know, it’s in the textbook, but I never really learned the derivative of f(x)=logn(x)f(x) = \log_n(x)

It’s not too complicated though using the logarithm change-of-base identity.

ddxlogn(x)=ddxln(x)ln(n)=1xln(n) \frac{d}{dx} \log_n(x) = \frac{d}{dx} \frac{\ln(x)}{\ln(n)} = \frac{1}{x\ln(n)}

The exponential form isn’t that bad either.

g(x)=nxln(g(x))=xln(n)ddxln(g(x))=ddxxln(n)1g(x)g(x)=ln(n)ddxnx=ln(n)nx \begin{aligned} g(x) &= n^x\\ \ln(g(x)) &= x\ln(n)\\ \frac{d}{dx} \ln(g(x)) &= \frac{d}{dx} x\ln(n)\\ \frac{1}{g(x)}g'(x) &= \ln(n)\\ \frac{d}{dx}n^x &= \ln(n)n^x \end{aligned}

Of course, given that nxn^x and logn(x)\log_n(x) are inverses, we can also find the exponential through the identity found in the previous section.

f(x)=logn(x)g(x)=nxddxnx=11ln(n)nx=ln(n)nx \begin{aligned} f(x) &= \log_n(x)\\ g(x) &= n^x\\ \frac{d}{dx} n^x &= \frac{1}{\frac{1}{ \ln(n)n^x}} = \ln(n)n^x \end{aligned}

Inverse Inverse Trigonometry

In the section on derivatives of inverses, these came up

cos(arcsin(x))sin(arccos(x))sec2(arctan(x)) \begin{aligned} \cos(\arcsin(x))\\ \sin(\arccos(x))\\ \sec^2(\arctan(x))\\ \end{aligned}

These forms can be simplified to remove any notion of trigonometry.

Draw a right triangle with angle θ\theta, adjacent side length 1x2\sqrt{1-x^2}, opposite side length xx, and hypotenuse side length 11.

Of course, sin(θ)=x\sin(\theta) = x, so arcsin(x)=θ\arcsin(x) = \theta within bounds of course.

And by definition cos(θ)=1x2\cos(\theta) = \sqrt{1-x^2}, so

cos(arcsin(x))=1x2,where1x1 \cos(\arcsin(x)) = \sqrt{1-x^2},\quad\text{where}\quad -1\leq x\leq 1

Some more identities found by similar method

cos(arcsin(x))=1x2,where1x1sin(arccos(x))=1x2,where1x1tan(arcsin(x))=x1x2,where1x1tan(arccos(x))=1x2x,where1x1 \begin{aligned} \cos(\arcsin(x)) &= \sqrt{1-x^2},\quad&\text{where}\quad &-1\leq x\leq 1\\ \sin(\arccos(x)) &= \sqrt{1-x^2},\quad&\text{where}\quad &-1\leq x\leq 1\\ \tan(\arcsin(x)) &= \frac{x}{\sqrt{1-x^2}},\quad&\text{where}\quad &-1\leq x\leq 1\\ \tan(\arccos(x)) &= \frac{\sqrt{1-x^2}}{x},\quad&\text{where}\quad &-1\leq x\leq 1\\ \end{aligned}

Arctangent is a bit more complex to deal with. Let’s do sec2(arctan(x))\sec^2(\arctan(x))

Draw a right triangle with angle θ\theta, adjacent side length AA, opposite side length of OO, and hypotenuse side length 11.

We know that tan(θ)=OA\tan(\theta) = \frac{O}{A} so set x=OAx =\frac{O}{A}. Also known is O2+A2=1O^2+A^2 = 1

So

A2+x2A2=1A2(1+x2)=1A2=11+x2A=11+x2Ax=OO=x1+x2 \begin{aligned} A^2+x^2A^2&=1\\ A^2(1+x^2)&=1\\ A^2 &= \frac{1}{1+x^2}\\ A &= \frac{1}{\sqrt{1+x^2}}\\ Ax &= O\\ O &= \frac{x}{\sqrt{1+x^2}} \end{aligned}

And so, the triangle has been completed.

Finally, csc2(θ)=1A2\csc^2(\theta) = \frac{1}{A^2}

This leads to another set of identities

sec2(arctan(x))=1+x2cos(arctan(x))=11+x2sin(arctan(x))=x1+x2 \begin{aligned} \sec^2(\arctan(x)) &= 1+x^2\\ \cos(\arctan(x)) &= \frac{1}{\sqrt{1+x^2}}\\ \sin(\arctan(x)) &= \frac{x}{\sqrt{1+x^2}} \end{aligned}

As a sidenote, it seems weird to me that

f(x)=sin(arctan(x))f1(x)=tan(arcsin(x)) \begin{aligned} f(x)&= \sin(\arctan(x))\\ f^{-1}(x)&= \tan(\arcsin(x)) \end{aligned}

Complete Factorization

Quick! what are all the factors of 720720?

Instead of giving you an answer, here’s an algorithm to find it.

First, by repeated division, find the prime factors.

720/2=360360/2=180180/2=9090/2=4545/3=1515/3=55/5=1 \begin{align} 720 / 2 &= 360 \\ 360 / 2 &= 180 \\ 180 / 2 &= 90 \\ 90 / 2 &= 45 \\ 45 / 3 &= 15 \\ 15 / 3 &= 5 \\ 5 / 5 &= 1 \\ \end{align} F0=[2,2,2,2,3,3,5] F_{0} = [2,\,2,\,2,\,2,\,3,\,3,\,5]

Find the all unique factors and their cartesian products in F0F_{0} to create P0P_{0}.

P0={2,3,5,6,10,15,30} P_{0} = \{2,\,3,\,5,\,6,\,10,\,15,\,30\} S0=P0 S_{0} = P_{0}

Remove one of each unique factor from F0F_{0} to make F1F_{1}.

F1=[2,2,2,2,3,3,5] F_{1} = [\,\cancel{2},\,2,\,2,\,2,\,\cancel{3},\,3,\,\cancel{5}]

Find the all unique factors and their cartesian products in F1F_{1} to create P1P_{1}.

P1={2,3,6} P_{1} = \{\, 2,\,3,\,6 \,\}

Multiply each number in P1P_{1} by each number in S0S_{0} to find S1S_{1} Remove any duplicate values and remove any values which had been found in previous SnS_{n}.

S1={4,6,10,12,20,30,606,9,15,18,30,45,9012,18,30,36,60,90,180}S1={4,10,12,20,60,9,18,45,90,36,180} \begin{align} S_{1} = \{\,& 4,\,\cancel{6},\,10,\,12,\,20,\,\cancel{30},\,60\\ & \cancel{6},\,9,\,\cancel{15},\,18,\,\cancel{30},\,45,\,90\\ & \cancel{12},\,\cancel{18},\,\cancel{30},\,36,\,\cancel{60},\,\cancel{90},\,180 \}\\ S_{1} = \{\,& 4,\,10,\,12,\,20,\,60,\,9,\,18,\,45,\,90,\,36,\,180\} \end{align}

Remove one of each unique factor from F1F_{1} to make F2F_{2}.

F2=[2,2,2,2,3,3,5] F_{2} = [\,\cancel{2},\,\cancel{2},\,2,\,2,\,\cancel{3},\,\cancel{3},\,\cancel{5}]

Find the all unique factors and their cartesian products in F2F_{2} to create P2P_{2}.

P2={2} P_{2} = \{\, 2\, \}

Multiply each number in P2P_{2} by each number in S1S_{1} to find S2S_{2} Remove any duplicate values and remove any values which had been found in previous SnS_{n}.

S2={8,20,24,40,120,18,36,90,180,72,360}S2={8,24,40,120,72,360} \begin{align} S_{2} &=\{\,8,\, \cancel{20},\, 24,\,40,\, 120,\, \cancel{18},\, \cancel{36},\, \cancel{90},\, \cancel{180},\, 72,\, 360\,\}\\ S_{2} &=\{\,8,\, 24,\,40,\, 120,\, 72,\, 360\,\}\\ \end{align}

Remove one of each unique factor from F2F_{2} to make F3F_{3}.

F3=[2,2,2,2,3,3,5] F_{3} = [\,\cancel{2},\,\cancel{2},\,\cancel{2},\,2,\,\cancel{3},\,\cancel{3},\,\cancel{5}]

Find the all unique factors and their cartesian products in F3F_{3} to create P3P_{3}.

P3={2} P_{3} = \{\, 2\, \}

Multiply each number in P3P_{3} by each number in S2S_{2} to find S3S_{3} Remove any duplicate values and remove any values which had been found in previous SnS_{n}.

S3={16,48,80,240,144,720} S_{3} = \{\,16,\,48,\,80,\,240,\,144,\,720 \,\}

Remove one of each unique factor from F3F_{3} to make F4F_{4}.

F4=[2,2,2,2,3,3,5] F_{4} = [\,\cancel{2},\,\cancel{2},\,\cancel{2},\,\cancel{2},\,\cancel{3},\,\cancel{3},\,\cancel{5}]

Seeing as there are no more prime factors left in FF, Halt. The factors of 720720 are found in the union S0,S1,S2,S3S_0,\,S_1,\,S_2,\, S_3 and of course 11.

S={1}S0S1S2S3S={={1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,30,36,={40,45,48,60,72,80,90,120,144,180,240,360,720={} \begin{align} S &= \{1\}\cup S_0 \cup S_1 \cup S_2 \cup S_3 \\ S &=\{\\ &\phantom{=\{}1,\,2,\,3,\,4,\,5,\,6,\,8,\,9,\,10,\,12,\,15,\,16,\,18,\,20,\,24,\,30,\,36,\\ &\phantom{=\{}40,\,45,\, 48,\,60,\,72,\,80,\,90,\,120,\,144,\,180,\,240,\,360,\,720 \\ &\phantom{=\{}\} \end{align}

I don’t know the name of this algorithm. I figured it out myself, but the simplicity of the algorithm leads me to believe it has been known for quite some time. There are likely more efficient algorithms, but compared to the naive algorithm of dividing by all numbers less than, it is appreciably efficient. An advantage of this algorithm is that it can be done on pen-and-paper and also can be done using a computer.

Example Python Program

Squares mod 100

Two neat little identities for squares mod 100.

n2(n+50)2mod100 n^2\equiv (n+50)^2 \mod 100

And

n2(50n)2mod100 n^2\equiv (50-n)^2 \mod 100

These can be algebraically shown to be true

n2(n2+2500+100n)mod100 n^2 \equiv (n^2 + 2500 + 100n) \mod 100

What about the generic case of a modulus kk? What is the specific mm to be added to nn to make the squares congruent?

n2(n+m)2modk n^2 \equiv (n+m)^2 \mod k

Expand

n2(n2+m2+2mn)modk n^2 \equiv (n^2 + m^2 + 2mn) \mod k

The trivial case is for m20modkm^2 \equiv 0 \mod k and 2mn0modk2mn \equiv 0 \mod k. Let’s just ignore the possibility that both of those aren’t true and yet still (m2+2mn)0modk(m^2 + 2mn) \equiv 0 \mod k

The smallest natural number mm such that 2mn0modk2mn \equiv 0 \mod k for any integer nn is clearly k/2k/2 if kk is even, and kk if kk is odd.

The smallest natural number mm such that m20modk m^2\equiv 0 \mod k is a bit trickier.

m2=k2m^2 = k^2 Obviously works, but the case of m2=(k/2)2m^2 = (k/2)^2 only works if kk is divisible by 44

m=k2 m = \frac{k}{2} m2=k222 m^2 = \frac{k^2}{2^2} m2k=k4 \frac{m^2}{k} = \frac{k}{4}

So for

n2(n+m)2modk n^2 \equiv (n+m)^2 \mod k

If kk is divisible by 44

m=k/2 m = k/2

Otherwise:

m=k m = k

Partial Geometric sums

So, the geometric series: if you’ve taken some Calculus, you know of it.

r=1+x+x2+x3+ r = 1 + x + x^2+x^3+ \dots

Solve for rr

r=1+rx r = 1 + rx rrx=1 r-rx = 1 r(1x)=1 r(1-x) = 1 r=11x r = \frac{1}{1-x}

And there’s the formula the textbook gave ya'

j=0xj=11x \sum_{j=0}^{\infty} x^j = \frac{1}{1-x}

But what about the partial sums?

j=0nxj=? \sum_{j=0}^{n} x^j = ?

Decompose into difference of sums

j=0nxj=j=0xjj=n+1xj \sum_{j=0}^{n} x^j = \sum_{j=0}^{\infty} x^j - \sum_{j=n+1}^{\infty} x^j

We know the value of the left sum, and the right sum can be found similarly.

h=xn+1+xn+2+xn+3+ h = x^{n+1} + x^{n+2} + x^{n+3}+ \dots h=xn+1+x(xn+1+xn+2+) h = x^{n+1} + x(x^{n+1} + x^{n+2} + \dots) h=xn+1+x(h) h = x^{n+1} + x(h) h=xn+11x h = \frac{x^{n+1}}{1-x}

So the partial sum can be found

j=0nxj=11xxn+11x=1xn+11x \sum_{j=0}^{n} x^j = \frac{1}{1-x} - \frac{x^{n+1}}{1-x} = \frac{1-x^{n+1}}{1-x}

Some alternate forms are common

j=0n1xj=1xn1x=xn1x1 \sum_{j=0}^{n-1} x^j = \frac{1-x^{n}}{1-x} = \frac{x^n-1}{x-1}

Also note that, now that the upper bound of the sum is not infinity, the sum is defined for values x1 \lvert x \rvert \ge 1

Partial Extended-Geometric Sums

This also applies to series like

x1+x4+x7+x10+ x^1 + x^4 + x^7 + x^{10} + \dots

or in general terms where a>b0a > b \ge 0

r=xa+b+x2a+b+x3a+b+ r = x^{a+b} + x^{2a+b} + x^{3a+b} + \dots

Finding a closed form for this is not too much more difficult. First find the closed for to the simpler

h=xa+x2a+x3a+ h = x^{a} + x^{2a} + x^{3a} +\dots h=xa(1+xa+x2a+) h = x^{a}(1 + x^{a} + x^{2a} +\dots) h=xa+xah h = x^{a} + x^a h h=xa1xa h =\frac{ x^{a}}{1-x^a}

Now the more complex form can be found

r=xa+b+x2a+b+x3a+b+ r = x^{a+b} + x^{2a+b} + x^{3a+b} + \dots r=xa+b+x2a+b+x3a+b+ r = x^{a+b} + x^{2a+b} + x^{3a+b} + \dots r=xb(xa+x2a+x3a+) r = x^b (x^{a} + x^{2a} + x^{3a} + \dots) r=xbh=xa+b1xa r= x^bh = \frac{x^{a+b}}{1-x^a} j=1xaj+b=xa+b1xa \sum_{j=1}^{\infty} x^{aj+b} = \frac{x^{a+b}}{1-x^a}

Following similar reasoning as the regular geometric series, the partial form is found.

m=xan+b+xa(n+1)+b+xa(n+2)+b+ m = x^{an+b} + x^{a(n+1)+b} + x^{a(n+2)+b} + \dots m=xb(xan+xa(n+1)+xa(n+2)+) m = x^b( x^{an} + x^{a(n+1)} + x^{a(n+2)} + \dots) m=xb(xan+xa(n+1)+xa(n+2)+) m = x^b ( x^{an} + x^{a(n+1)} + x^{a(n+2)} + \dots)

Pause solving mm, introduce new equation, tt

t=xan+xa(n+1)+xa(n+2)+ t = x^{an} + x^{a(n+1)} + x^{a(n+2)} + \dots t=xan+xan+1a+xan+2a+ t = x^{an} + x^{an+1a} + x^{an+2a} + \dots t=xan(1+x1a+x2a+) t = x^{an}(1 + x^{1a} + x^{2a} + \dots)

Pause solving tt, introduce new equation oo

o=xa+x2a+x3a+ o = x^{a} + x^{2a} + x^{3a} + \dots o=xa(1+o) o = x^{a}(1 + o) o=xa1xa o = \frac{x^a}{1-x^a}

Resume solving tt

t=xan(1+x1a+x2a+) t = x^{an}(1 + x^{1a} + x^{2a} + \dots) t=xan(1+xa1xa) t = x^{an}\left(1 + \frac{x^a}{1-x^a}\right) t=xan11xa t = x^{an}\frac{1}{1-x^a}

Resume solving mm

m=xb(xan+xa(n+1)+xa(n+2)+) m = x^b ( x^{an} + x^{a(n+1)} + x^{a(n+2)} + \dots) m=xan+b1xa m = \frac{x^{an+b}}{1-x^a}

Thus

j=nxaj+b=xan+b1xa \sum_{j=n}^{\infty} x^{aj+b} = \frac{x^{an+b}}{1-x^a}

So

j=1n1xaj+b=j=1xaj+bj=nxaj+b \sum_{j=1}^{n-1} x^{aj+b} = \sum_{j=1}^{\infty} x^{aj+b} - \sum_{j=n}^{\infty} x^{aj+b} j=1n1xaj+b=xa+b1xaxan+b1xa=xa+bxan+b1xa=xa+b(1xa(n1))1xa \sum_{j=1}^{n-1} x^{aj+b} = \frac{x^{a+b}}{1-x^a} - \frac{x^{an+b}}{1-x^a} = \frac{x^{a+b} - x^{an+b}}{1-x^a} = \frac{x^{a+b}\left(1-x^{a(n-1)} \right)}{1-x^a}

For convenience, increment the value of nn by one.

j=1nxaj+b=xa+b(1xan)1xa \sum_{j=1}^{n} x^{aj+b} = \frac{x^{a+b}\left(1-x^{an} \right)}{1-x^a}

When 0b<a0 \le b < a

I’m not sure if any of that made any sense, but from my bit of verification, I believe it’s true.

As far as verification goes, it wouldn’t hurt to do so through Induction.

First the base case of n=1n=1

j=11xaj+b=xa+b \sum_{j=1}^{1} x^{aj+b} = x^{a+b} xa+b(1xa)1xa \frac{x^{a+b}\cancel{\left(1 - x^{a}\right)}}{\cancel{1-x^a}}

The base case is satisfied

The equation is valid if the following holds

xa+b(1xan)1xa+xa(n+1)+b=xa+b(1xa(n+1))1xa \frac{x^{a+b}\left(1-x^{an} \right)}{1-x^a} + x^{a(n+1)+b} = \frac{x^{a+b}\left(1-x^{a(n+1)} \right)}{1-x^a} xa+b(1xan)+xa(n+1)+b(1xa)=xa+b(1xa(n+1)) x^{a+b}\left(1-x^{an} \right) + x^{a(n+1)+b}({1-x^a}) = x^{a+b}\left(1-x^{a(n+1)} \right) xa+bxa(n+1)+b+xa(n+1)+b(1xa)=xa+bxa(n+2)+b x^{a+b} -x^{a(n+1)+b} + x^{a(n+1)+b}({1-x^a}) = x^{a+b}-x^{a(n+2) + b} xa+bxa(n+1)+b+xa(n+1)+bxa(n+2)+b=xa+bxa(n+2)+b x^{a+b} -x^{a(n+1)+b} + x^{a(n+1)+b} - x^{a(n+2)+b} = x^{a+b}-x^{a(n+2) + b} xa+bxa(n+1)+b+xa(n+1)+bxa(n+2)+b=xa+bxa(n+2)+b x^{a+b} \cancel{-x^{a(n+1)+b} + x^{a(n+1)+b}} - x^{a(n+2)+b} = x^{a+b}-x^{a(n+2) + b}

And so it has been proven.