I am working on this question: You are given a number N. You can perform the following operations on N any number of times: -If N is even, divide N by 2. -If N is odd, replace N with 3N+1. Your task …

I am working on this question: You are given a number N. You can perform the following operations on N any number of times: -If N is even, divide N by 2. -If N is odd, replace N with 3N+1. Your task …

Basically, I have three snakemake rules (other than rule all) and cannot figure this problem out, despite the checkpoint resources. Rule one has my first and only file that I start with. It will have …

I’m trying to agglomerate adjacent cells (and their neighbours) that have the same type (integer from 1 to 10) into new clusters by assigning them to a cluster id. As visualised here for some of the …

The formula for series equivalence of resistors: series equivalence = sum(resistors) For parallel it is 1/(sum(1/resistors[i])) I wrote code to return a list of resistors that is closest to a …

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return the number of distinct solutions to the n-queens …

8=2^3, 81=3^4. How can I discover or find out which/what number can stand as a numerator and as a power for a certain number for example: 8 is the initial/certain number, but was split to 2 raised to …

I have a matrix as follows (Python) : matrix = “”” …o..o.o …oo…. …o….o ..o.ooo.. o…o…. .oo…… ..o….o. .oo…… ……… “””…

I have been working on a Coursera assignment, it required my run time to be less than 5.00 . The code is below, but my question is basically about the first and last line, where I was testing the …

Given a 2D Array (Python List), I need to find a new 1D such that it contains elements unique in each column. For example: [1, 1, -1, 1, 0] [1, -1, -1, 3, 4] [0, 0, 0, -2, -4] should give me for …

I am implementing an extended Eucilid algorithm with matrix mod N. This is my code implementation: def eea(a, b): if not isinstance(a, int) or not isinstance(b, int) or not a or not b: …