Skip to content

Instantly share code, notes, and snippets.

View matinkaboli's full-sized avatar
🌀
Focusing

Matin Kaboli matinkaboli

🌀
Focusing
View GitHub Profile
function checkDivisor(num) {
let sum = 0;
const check = Math.ceil(num / 2);
for (let i = 0; i <= check; i++) {
if (num % i === 0) {
sum += i;
}
}
return sum > num;
}
names = open('names.txt', 'r')
list_names = sorted(names.read().replace('"', '').split(','))
letters = {
'A': 1,
'B': 2,
'C': 3,
'D': 4,
'E': 5,
'F': 6,
'G': 7,
def divisor(n):
ds = 0
for i in range(1, n):
if (n % i == 0): ds += i
return ds
sum = 0
for i in range(0, 10000):
n = divisor(i)
def fac(n):
product = 1;
for i in range(1, n + 1):
product *= i
return product
def sumLen(n):
return sum(list(map(int, list(str(n)))))
print(sumLen(fac(100)))
const nums = [
[75],
[95, 64],
[17, 47, 82],
[18, 35, 87, 10],
[20, 04, 82, 47, 65],
[19, 01, 23, 75, 03, 34],
[88, 02, 77, 73, 07, 63, 67],
[99, 65, 04, 28, 06, 16, 70, 92],
[41, 41, 26, 56, 83, 40, 80, 70, 33],
const letters = {
'1': 'one',
'2': 'two',
'3': 'three',
'4': 'four',
'5': 'five',
'6': 'six',
'7': 'seven',
'8': 'eight',
'9': 'nine',
result = sum(list(map(int, list(str(2 ** 1000)))))
print(result)
#include <stdio.h>
int main() {
const int grid = 20;
long ways = 1;
for (int i = 0; i < grid; i++) {
ways *= (2 * grid) - i;
ways /= i + 1;
}
printf("%ld\n", ways);
function collatz(n, times = 1) {
while (n > 1) {
times += 1;
if (n % 2 === 0) {
n = n / 2;
} else {
n = 3 * n + 1;
}
}
return times;
arr = [
37107287533902102798797998220837590246510135740250,
46376937677490009712648124896970078050417018260538,
74324986199524741059474233309513058123726617309629,
91942213363574161572522430563301811072406154908250,
23067588207539346171171980310421047513778063246676,
89261670696623633820136378418383684178734361726757,
28112879812849979408065481931592621691275889832738,
44274228917432520321923589422876796487670272189318,
47451445736001306439091167216856844588711603153276,