Categories

## OneDrive Screw Up (How to Repair)

Long, weird, story. We ordered a laptop. It has a short: shocks us, completely crashes, and reboots. We’re sending it back. We ordered an AIO as a replacement. Works fine. Wife had stuff on the laptop. She hand moved most of it to the AIO. OneDrive synced everything it had from the problem laptop to […]

Categories

## About the sum $S(p_n)=\sum_{1\le k\lt n}\,p_n\mod\;p_k$

For $\,p_n\gt2\,$ let’s define the sum $\,S(p_n)=\sum_{1\le k\lt n}\,p_n\;mod\;p_k$, where $\,p_k\,$ represents the $\,k$-th prime. The first terms of the sequence $\,S(p_n)\,$ (OEIS A033955 – sum of the remainders when the $\,n$-th prime is divided by primes up to the $\,(n-1)$-th prime) are: $S(3)=1\;\;\;(p_2=3)$ $S(5)=3\;\;\;(p_3=5)$ $S(7)=4\;\;\;(p_4=7)$ $S(11)=8\;\;\;(p_5=11)$ $S(13)=13\;\;\;(p_6=13)$ $S(17)=18\;\;\;(p_7=17)$ $S(19)=27\;\;\;(p_8=19)$ $S(23)=29\;\;\;(p_9=23)$ $S(29)=46\;\;\;(p_{10}=29)$ The graphical representation […]

Categories

## About the sum $S(p_n)=\sum_{1\le k\lt n}\,p_n\;mod\;p_k$

For $\,p_n\gt2\,$ let’s define the sum $\,S(p_n)=\sum_{1\le k\lt n}\,p_n\;mod\;p_k$, where $\,p_k\,$ represents the $\,k$-th prime. The first terms of the sequence $\,S(p_n)\,$ (OEIS A033955 – sum of the remainders when the $\,n$-th prime is divided by primes up to the $\,(n-1)$-th prime) are: $S(3)=1\;\;\;(p_2=3)$ $S(5)=3\;\;\;(p_3=5)$ $S(7)=4\;\;\;(p_4=7)$ $S(11)=8\;\;\;(p_5=11)$ $S(13)=13\;\;\;(p_6=13)$ $S(17)=18\;\;\;(p_7=17)$ $S(19)=27\;\;\;(p_8=19)$ $S(23)=29\;\;\;(p_9=23)$ $S(29)=46\;\;\;(p_{10}=29)$ The graphical representation […]

Categories

## About the sum $S(p_n)=\sum_{1\le k\lt n}\,p_n\;mod\;p_k$

For $\,p_n\gt2\,$ let’s define the sum $\,S(p_n)=\sum_{1\le k\lt n}\,p_n\;mod\;p_k$, where $\,p_k\,$ represents the $\,k$-th prime. The first terms of the sequence $\,S(p_n)\,$ (OEIS A033955 – sum of the remainders when the $\,n$-th prime is divided by primes up to the $\,(n-1)$-th prime) are: $S(3)=1\;\;\;(p_2=3)$ $S(5)=3\;\;\;(p_3=5)$ $S(7)=4\;\;\;(p_4=7)$ $S(11)=8\;\;\;(p_5=11)$ $S(13)=13\;\;\;(p_6=13)$ $S(17)=18\;\;\;(p_7=17)$ $S(19)=27\;\;\;(p_8=19)$ $S(23)=29\;\;\;(p_9=23)$ $S(29)=46\;\;\;(p_{10}=29)$ The graphical representation […]

Categories

## About the sum $S(p_n)=\sum_{1\le k\lt n}\,p_n\;mod\;p_k$

For $\,p_n\gt2\,$ let’s define the sum $\,S(p_n)=\sum_{1\le k\lt n}\,p_n\;mod\;p_k$, where $\,p_k\,$ represents the $\,k$-th prime. The first terms of the sequence $\,S(p_n)\,$ (OEIS A033955 – sum of the remainders when the $\,n$-th prime is divided by primes up to the $\,(n-1)$-th prime) are: $S(3)=1\;\;\;(p_2=3)$ $S(5)=3\;\;\;(p_3=5)$ $S(7)=4\;\;\;(p_4=7)$ $S(11)=8\;\;\;(p_5=11)$ $S(13)=13\;\;\;(p_6=13)$ $S(17)=18\;\;\;(p_7=17)$ $S(19)=27\;\;\;(p_8=19)$ $S(23)=29\;\;\;(p_9=23)$ $S(29)=46\;\;\;(p_{10}=29)$ The graphical representation […]

Categories

## What does codes mean in pandas.series MultiIndex?

Let’s create a series with below code: import numpy as np import pandas as pd import xarray as xr np.random.seed(123) size = 4 temperature = 15 + 10 * np.random.randn(size) lat = np.random.uniform(low=-90, high=90, size=size) lon = np.random.uniform(low=-180, high=180, size=size) idx = pd.MultiIndex.from_arrays(arrays=[lat,lon], names=[“lat”,”lon”]) s = pd.Series(data=temperature, index=idx) s s is a series which contain […]

Categories

## Q-learning problem wrong policy

I am coding out a simple 4×4 grid game whereby the agent starts at a particular state and his aim is to reach the terminal state. The agent is supposed to avoid traps along the way and reach the end goal with high reward. The below picture illustrates the environment. The code that I am […]

Categories

## Plotting the steps of all the prices of a binomial tree

I’d like to plot the following function for all steps of M, where steps of M are all the steps in the binomial tree. I tried al sorts of for loops but I couldn’t seem to find the right answer. It keeps returning the [0, 0], so the option value at t=0, but I need […]

Categories

## SQL For every two items A and B, at what frequency is B bought after A

I have a table that lists items that were in each transaction and the sequence in which they were purchased. sequence ID = 1 means it’s the first item, sequence ID = 2 means it’s the second item. transaction_id item.id sequence_id transection_time ——————————————————— 1 1 1 12:00:00.000 1 1 2 12:00:00.000 1 2 3 12:00:00.000 […]