1
0

migration

This commit is contained in:
2025-04-29 22:08:00 +03:00
commit ad28507008
232 changed files with 12299 additions and 0 deletions

View File

@ -0,0 +1,22 @@
#!/bin/bash
ROOT='src/main/java'
JAVA_FILE="ua/nure/jfn/task1/Part1.java"
CLASS_FILE="ua/nure/jfn/task1/Part1.class"
CLASS="ua.nure.jfn.task1.Part1"
if [ ! -r "$ROOT/$JAVA_FILE" ]; then
echo "File '$ROOT/$JAVA_FILE' is not found or it is not readable." 1>&2
exit 1
fi
javac "$ROOT/$JAVA_FILE"
if [ ! -r "$ROOT/$CLASS_FILE" ]; then
echo "Can't find '$ROOT/$CLASS_FILE' after compilation." 1>&2
exit 2
fi
java -cp "$ROOT" "$CLASS"

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ua.nure.jfn</groupId>
<artifactId>task1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
<junit5.version>5.12.0</junit5.version>
<surefire.version>3.5.2</surefire.version>
<spoon.version>11.2.0</spoon.version>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-core</artifactId>
<version>${spoon.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.17</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>task1</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -0,0 +1,26 @@
package ua.nure.jfn.task1;
public class Demo {
private static void printSep(int k) {
System.out.printf("%nPart%d =================%n", k);
}
public static void main(String[] args) {
printSep(1);
Part1.main(new String[] { "A1", "B11 22 C", "D" }); // 34 7
printSep(2);
Part2.main(new String[] { "12", "18", "24" }); // 6 72
printSep(3);
Part3.main(new String[] { "5" }); // 3 5 7 11 13
printSep(4);
Part4.main(new String[] { "360" }); // 360 = 2^3 x 3^2 x 5^1
printSep(5);
Part5.main(new String[] { "1", "5", "3", "0", "5", "2", "1" }); // 5 3 0 5 2 1
}
}

View File

@ -0,0 +1,33 @@
package ua.nure.jfn.task1;
public class Part1 {
public static void main(String[] args) {
int numbersSum = 0;
int digitsSum = 0;
for (String arg : args) {
int digitPlace = 0;
char[] chArray = arg.toCharArray();
for (int i = chArray.length - 1; i >= 0; i--) {
char ch = chArray[i];
if (ch >= '0' && ch <= '9') {
digitsSum += ch - '0';
numbersSum += (ch - '0') * pow(10, digitPlace++);
} else {
digitPlace = 0;
}
}
}
System.out.printf("%d %d\n", numbersSum, digitsSum);
}
static int pow(int num, int power) {
int result = 1;
for (int i = 0; i < power; i++) {
result *= num;
}
return result;
}
}

View File

@ -0,0 +1,56 @@
package ua.nure.jfn.task1;
public class Part2 {
static void main(String[] args) {
int num = parseInt(args[0]);
int overallGcd = num;
int overallLcm = num;
for (int i = 1; i < args.length; i++) {
num = parseInt(args[i]);
overallGcd = gcd(overallGcd, num);
overallLcm = lcm(overallLcm, num);
}
System.out.printf("%d %d", overallGcd, overallLcm);
}
static int pow(int num, int power) {
int result = 1;
for (int i = 0; i < power; i++) {
result *= num;
}
return result;
}
static int parseInt(String str) {
int number = 0;
int digitPlace = 0;
char[] chArray = str.toCharArray();
for (int i = chArray.length - 1; i >= 0; i--) {
char ch = chArray[i];
if (ch >= '0' && ch <= '9') {
number += (ch - '0') * pow(10, digitPlace++);
} else {
digitPlace = 0;
}
}
return number;
}
static int gcd(int a, int b) {
for (int min = a < b ? a : b; min > 1; min--)
if (a % min == 0 && b % min == 0)
return min;
return 1;
}
static int lcm(int a, int b) {
return (a * b) / gcd(a, b);
}
}

View File

@ -0,0 +1,33 @@
package ua.nure.jfn.task1;
public class Part3 {
public static void main(String[] args) {
for (int n : getPrimeNumbers(Part2.parseInt(args[0])))
System.out.printf("%d ", n);
}
public static int[] getPrimeNumbers(int n) {
if (n == 0) return new int[0];
int[] primes = new int[n];
primes[0] = 2;
for (int i = 3, c = 1; c < n; i += 2)
if (isPrime(i))
primes[c++] = i;
return primes;
}
public static boolean isPrime(int n) {
if (n <= 1)
return false;
for (int i = 2; i * i <= n; i++) // same as i < sqrt(n)
if (n % i == 0)
return false;
return true;
}
}

View File

@ -0,0 +1,26 @@
package ua.nure.jfn.task1;
public class Part4 {
public static void main(String[] args) {
int num = Part2.parseInt(args[0]);
System.out.printf("%d = ", num);
int counter;
for (int prime = 2; num != 1; prime = nextPrime(prime)) {
for (counter = 0; num % prime == 0; counter++)
num /= prime;
if (counter != 0)
System.out.printf("%d^%d%s", prime, counter, num != 1 ? " x " : "");
}
}
public static int nextPrime(int x) {
for (x += 1; !Part3.isPrime(x); x += 1)
;
return x;
}
}

View File

@ -0,0 +1,49 @@
package ua.nure.jfn.task1;
public class Part5 {
public static void main(String[] args) {
int[] test = { 1, 2, 3, 2, 1, 1, 4, 3, 2, 2, 1 };
for (int item : sequence(test)) {
System.out.printf("%d ", item);
}
System.out.println();
}
public static int[] sequence(int[] ar) {
if (ar == null)
return null;
int n = ar.length;
int[] seq = new int[n];
int count = 0;
boolean inSeq = false;
for (int i = 1; i < n; i++) {
int a = ar[i - 1];
int b = ar[i];
if (a > b) {
seq[count++] = a;
inSeq = true;
} else if (inSeq) {
seq[count++] = a;
inSeq = false;
}
if (i == n - 1 && inSeq)
seq[count++] = b;
}
if (count <= 1)
return new int[0];
int[] result = new int[count];
for (int i = 0; i < count; i++)
result[i] = seq[i];
return result;
}
}

View File

@ -0,0 +1,16 @@
package ua.nure.jfn.task1;
import org.junit.jupiter.api.Assertions;
/**
* @author Dmytro Kolesnykov
*/
class Base {
{
if (ComplianceTest.MAKE_ALL_TESTS_FAILED) {
Assertions.fail("Compliance tests have not been passed", ComplianceTest.CAUSE);
}
}
}

View File

@ -0,0 +1,123 @@
package ua.nure.jfn.task1;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import spoon.Launcher;
import spoon.SpoonAPI;
import spoon.reflect.declaration.CtType;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.visitor.filter.TypeFilter;
/**
* @author Dmytro Kolesnykov
*/
@Disabled("This test is used as a trigger to fail all the other tests")
class ComplianceTest {
// Assign the following option to false to skip the compliance test
// note, during testing at the stand this option will be turned on!!!
//private static final boolean TURN_TEST_COMPLIANCE_ON = false;
private static final boolean TURN_TEST_COMPLIANCE_ON = true;
public static final boolean MAKE_ALL_TESTS_FAILED;
public static final Throwable CAUSE;
private static final Object EOL = System.lineSeparator();
static {
L: {
try {
if (TURN_TEST_COMPLIANCE_ON) {
initSpoon();
startCompianceTests();
}
} catch (ReflectiveOperationException ex) {
MAKE_ALL_TESTS_FAILED = true;
CAUSE = ex.getCause();
break L;
}
MAKE_ALL_TESTS_FAILED = false;
CAUSE = null;
}
}
private static SpoonAPI spoon;
private static void initSpoon() {
spoon = new Launcher();
spoon.addInputResource("src/main/java/");
spoon.buildModel();
}
private static void startCompianceTests() throws ReflectiveOperationException {
ComplianceTest cTest = new ComplianceTest();
for (Method m : ComplianceTest.class.getDeclaredMethods()) {
if (Modifier.isPrivate(m.getModifiers())) {
continue;
}
Test[] ar = m.getAnnotationsByType(Test.class);
if (ar.length > 0 && m.getAnnotationsByType(Test.class)[0] != null) {
m.invoke(cTest);
}
}
}
///////////////////////////////////////////////////
@Test
void appShouldNotUseForbiddenAPI() throws IOException, URISyntaxException {
URL url = getClass().getResource("forbidden-api-regex.txt");
String regex = Files.readString(Path.of(url.toURI()));
Pattern forbiddenAPIRegex = Pattern.compile(regex.toString());
StringBuilder errorMessage = new StringBuilder();
for (CtType<?> ctType : spoon.getModel().getAllTypes()) {
List<String> forbiddenAPI = ctType.getElements(new TypeFilter<>(CtTypeReference.class))
.stream()
.distinct()
.filter(r -> forbiddenAPIRegex.matcher(r.toString()).matches())
.map(CtTypeReference::getQualifiedName)
.toList();
if (!forbiddenAPI.isEmpty()) {
errorMessage.append(EOL)
.append(ctType.getQualifiedName()).append(": ")
.append(forbiddenAPI);
}
}
if (!errorMessage.isEmpty()) {
fail(() -> "Using of this API is forbidden: " + errorMessage);
}
}
@Test
void shouldBeAppropriateNumberOfPackagesAndClasses() throws IOException, URISyntaxException {
URL url = getClass().getResource("list-of-types.txt");
String expected = Files.readString(Path.of(url.toURI())).trim();
// '\n' character is used for clarity in error message
String actual = spoon.getModel().getAllPackages().stream()
.filter(p -> p.getTypes().size() != 0)
.map(p -> p.getTypes().stream()
.map(CtType::getQualifiedName)
.sorted()
.collect(Collectors.joining("\n")))
.collect(Collectors.joining("\n"));
assertEquals('\n' + expected, '\n' + actual);
}
}

View File

@ -0,0 +1,39 @@
package ua.nure.jfn.task1;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
/**
* @author Dmytro Kolesnykov
*/
class Part1Test extends Base {
private static final PrintStream STD_OUT = System.out;
private static final String[] EMPTY = {};
@ParameterizedTest
@CsvFileSource(delimiter = ';', resources = "part1.csv")
void test(String input, String expected) {
String[] args = input == null ? EMPTY : input.split("\\s+");
if (expected == null) {
expected = "";
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
try {
System.setOut(ps);
Part1.main(args);
} finally {
System.setOut(STD_OUT);
}
assertEquals(expected, baos.toString().trim());
ps.close();
}
}

View File

@ -0,0 +1,42 @@
package ua.nure.jfn.task1;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
/**
* @author Dmytro Kolesnykov
*/
class Part2Test extends Base {
private static final PrintStream STD_OUT = System.out;
private static final String[] EMPTY = {};
@ParameterizedTest
@CsvFileSource(delimiter = ';', resources = "part2.csv")
void test(String input, String expected) {
String[] args;
expected = expected == null ? "" : expected.replaceAll("_", " ");
args = input == null ? EMPTY : input.split("\\s+");
for (int j = 0; j < args.length; ++j) {
args[j] = args[j].replace("_", " ");
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
try {
System.setOut(ps);
Part2.main(args);
} finally {
System.setOut(STD_OUT);
}
String actual = baos.toString();
assertEquals(expected, actual);
ps.close();
}
}

View File

@ -0,0 +1,36 @@
package ua.nure.jfn.task1;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
/**
* @author Dmytro Kolesnykov
*/
class Part3Test extends Base {
private static final PrintStream STD_OUT = System.out;
@ParameterizedTest
@CsvFileSource(delimiter = ';', resources = "part3.csv")
void test(String input, String expected) {
if (expected == null) {
expected = "";
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
try {
System.setOut(ps);
Part3.main(new String[] { input });
} finally {
System.setOut(STD_OUT);
}
assertEquals(expected, baos.toString().trim());
ps.close();
}
}

View File

@ -0,0 +1,33 @@
package ua.nure.jfn.task1;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
/**
* @author Dmytro Kolesnykov
*/
class Part4Test extends Base {
private static final PrintStream STD_OUT = System.out;
@ParameterizedTest
@CsvFileSource(delimiter = ';', resources = "part4.csv")
void test(String input, String expected) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
try {
System.setOut(ps);
Part4.main(new String[] { input });
} finally {
System.setOut(STD_OUT);
}
assertEquals(expected, baos.toString().trim());
ps.close();
}
}

View File

@ -0,0 +1,43 @@
package ua.nure.jfn.task1;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Arrays;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
/**
* @author Dmytro Kolesnykov
*/
class Part5Test extends Base {
@ParameterizedTest
@CsvFileSource(delimiter = ';', resources = "part5.csv")
void test(String input, String expected) {
if (expected != null) {
if ("_".equals(expected)) {
expected = "";
} else {
expected = expected.replaceAll("\\s+", " ");
}
}
int[] ar = null;
if (input != null) {
ar = Arrays.stream(input.split("\\s+")).mapToInt(Integer::parseInt).toArray();
}
int[] result = Part5.sequence(ar);
String actual;
if (result == null) {
actual = null;
} else {
actual = IntStream.of(result)
.mapToObj(String::valueOf)
.collect(Collectors.joining(" "));
}
assertEquals(expected, actual);
}
}

View File

@ -0,0 +1,6 @@
(?x)
^
(java\.(util|math)\.\S+)
|
(java\.lang\.(Byte|Short|Integer|Long|Character|Float|Double))
$

View File

@ -0,0 +1,6 @@
ua.nure.jfn.task1.Demo
ua.nure.jfn.task1.Part1
ua.nure.jfn.task1.Part2
ua.nure.jfn.task1.Part3
ua.nure.jfn.task1.Part4
ua.nure.jfn.task1.Part5

View File

@ -0,0 +1,35 @@
P4 R8 40 1 ; 53 17
x6vp 45 3 ; 54 18
5 wQ8M 9 16 ; 38 29
77ksvZg ; 77 14
z5189185 ; 5189185 37
10X H21b ; 31 4
9w6q4U4 P0b ; 23 23
43 cy01 ; 44 8
Z Q8 C d 5r7n53 ; 73 28
428 C1D ; 429 15
N 6k81 97 A 204 ; 388 37
98aPwh m 3146S13k ; 3257 35
3 Ngf ; 3 3
W2 9U9pPy ; 20 20
761 5u ; 766 19
2b Z ; 2 2
4r1662 bEfN5Z9BV93 ; 1773 45
56 q 48 ; 104 23
ph 5 ; 5 5
5p 53A81t r ; 139 22
5eg E ; 5 5
054t716 ; 770 23
23yh 0X83 6RT3 x0YV ; 115 25
2R0 7m1 17Kz5 qX7 ; 39 30
M6 YA6 7 0419f2 ; 440 35
xU68M D rq 81 0 42 ; 191 29
zSZR2r6M ; 8 8
4M2 epBT3 A6 2832 ; 2847 30
z38G0 H 565a ; 603 27
s 1V 4S 6M z8 ; 19 19
7AG 70 3 ; 80 17
0 u34 1rcvN 1 2 ; 38 11
5 rC86E2H753m4 ; 850 40
56 825R ; 881 26
FzV 1 2 H ; 3 3
1 P4 R8 40 1 53 17
2 x6vp 45 3 54 18
3 5 wQ8M 9 16 38 29
4 77ksvZg 77 14
5 z5189185 5189185 37
6 10X H21b 31 4
7 9w6q4U4 P0b 23 23
8 43 cy01 44 8
9 Z Q8 C d 5r7n53 73 28
10 428 C1D 429 15
11 N 6k81 97 A 204 388 37
12 98aPwh m 3146S13k 3257 35
13 3 Ngf 3 3
14 W2 9U9pPy 20 20
15 761 5u 766 19
16 2b Z 2 2
17 4r1662 bEfN5Z9BV93 1773 45
18 56 q 48 104 23
19 ph 5 5 5
20 5p 53A81t r 139 22
21 5eg E 5 5
22 054t716 770 23
23 23yh 0X83 6RT3 x0YV 115 25
24 2R0 7m1 17Kz5 qX7 39 30
25 M6 YA6 7 0419f2 440 35
26 xU68M D rq 81 0 42 191 29
27 zSZR2r6M 8 8
28 4M2 epBT3 A6 2832 2847 30
29 z38G0 H 565a 603 27
30 s 1V 4S 6M z8 19 19
31 7AG 70 3 80 17
32 0 u34 1rcvN 1 2 38 11
33 5 rC86E2H753m4 850 40
34 56 825R 881 26
35 FzV 1 2 H 3 3

View File

@ -0,0 +1,35 @@
18 9 ; 9 18
1 1 14 ; 1 14
12 6 ; 6 12
12 20 ; 4 60
10 16 ; 2 80
1 1 25 5 ; 1 25
12 24 ; 12 24
14 ; 14 14
11 ; 11 11
21 28 ; 7 84
21 14 ; 7 42
24 16 ; 8 48
12 30 6 ; 6 60
10 15 ; 5 30
27 9 ; 9 27
16 ; 16 16
16 8 ; 8 16
12 ; 12 12
16 24 ; 8 48
12 8 4 ; 4 24
12 16 ; 4 48
10 30 5 25 ; 5 150
14 21 ; 7 42
13 26 ; 13 26
12 3 15 6 ; 3 60
9 18 ; 9 18
1 1 11 ; 1 11
10 5 15 ; 5 30
10 16 4 6 ; 2 240
10 20 5 ; 5 20
8 16 8 ; 8 16
20 10 ; 10 20
13 ; 13 13
8 ; 8 8
18 9 27 ; 9 54
1 18 9 9 18
2 1 1 14 1 14
3 12 6 6 12
4 12 20 4 60
5 10 16 2 80
6 1 1 25 5 1 25
7 12 24 12 24
8 14 14 14
9 11 11 11
10 21 28 7 84
11 21 14 7 42
12 24 16 8 48
13 12 30 6 6 60
14 10 15 5 30
15 27 9 9 27
16 16 16 16
17 16 8 8 16
18 12 12 12
19 16 24 8 48
20 12 8 4 4 24
21 12 16 4 48
22 10 30 5 25 5 150
23 14 21 7 42
24 13 26 13 26
25 12 3 15 6 3 60
26 9 18 9 18
27 1 1 11 1 11
28 10 5 15 5 30
29 10 16 4 6 2 240
30 10 20 5 5 20
31 8 16 8 8 16
32 20 10 10 20
33 13 13 13
34 8 8 8
35 18 9 27 9 54

View File

@ -0,0 +1,20 @@
8 ; 2 3 5 7 11 13 17 19
17 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59
33 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137
16 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53
2 ; 2 3
24 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89
26 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101
7 ; 2 3 5 7 11 13 17
22 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79
15 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47
14 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43
28 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107
13 ; 2 3 5 7 11 13 17 19 23 29 31 37 41
10 ; 2 3 5 7 11 13 17 19 23 29
19 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67
38 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163
30 ; 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113
6 ; 2 3 5 7 11 13
12 ; 2 3 5 7 11 13 17 19 23 29 31 37
1 ; 2
1 8 2 3 5 7 11 13 17 19
2 17 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59
3 33 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137
4 16 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53
5 2 2 3
6 24 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89
7 26 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101
8 7 2 3 5 7 11 13 17
9 22 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79
10 15 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47
11 14 2 3 5 7 11 13 17 19 23 29 31 37 41 43
12 28 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107
13 13 2 3 5 7 11 13 17 19 23 29 31 37 41
14 10 2 3 5 7 11 13 17 19 23 29
15 19 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67
16 38 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163
17 30 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113
18 6 2 3 5 7 11 13
19 12 2 3 5 7 11 13 17 19 23 29 31 37
20 1 2

View File

@ -0,0 +1,28 @@
111 ; 111 = 3^1 x 37^1
313 ; 313 = 313^1
658 ; 658 = 2^1 x 7^1 x 47^1
5 ; 5 = 5^1
943 ; 943 = 23^1 x 41^1
550 ; 550 = 2^1 x 5^2 x 11^1
596 ; 596 = 2^2 x 149^1
439 ; 439 = 439^1
523 ; 523 = 523^1
93 ; 93 = 3^1 x 31^1
550 ; 550 = 2^1 x 5^2 x 11^1
596 ; 596 = 2^2 x 149^1
363 ; 363 = 3^1 x 11^2
852 ; 852 = 2^2 x 3^1 x 71^1
996 ; 996 = 2^2 x 3^1 x 83^1
708 ; 708 = 2^2 x 3^1 x 59^1
369 ; 369 = 3^2 x 41^1
747 ; 747 = 3^2 x 83^1
735 ; 735 = 3^1 x 5^1 x 7^2
360 ; 360 = 2^3 x 3^2 x 5^1
783 ; 783 = 3^3 x 29^1
648 ; 648 = 2^3 x 3^4
360 ; 360 = 2^3 x 3^2 x 5^1
594 ; 594 = 2^1 x 3^3 x 11^1
500 ; 500 = 2^2 x 5^3
540 ; 540 = 2^2 x 3^3 x 5^1
904 ; 904 = 2^3 x 113^1
936 ; 936 = 2^3 x 3^2 x 13^1
1 111 111 = 3^1 x 37^1
2 313 313 = 313^1
3 658 658 = 2^1 x 7^1 x 47^1
4 5 5 = 5^1
5 943 943 = 23^1 x 41^1
6 550 550 = 2^1 x 5^2 x 11^1
7 596 596 = 2^2 x 149^1
8 439 439 = 439^1
9 523 523 = 523^1
10 93 93 = 3^1 x 31^1
11 550 550 = 2^1 x 5^2 x 11^1
12 596 596 = 2^2 x 149^1
13 363 363 = 3^1 x 11^2
14 852 852 = 2^2 x 3^1 x 71^1
15 996 996 = 2^2 x 3^1 x 83^1
16 708 708 = 2^2 x 3^1 x 59^1
17 369 369 = 3^2 x 41^1
18 747 747 = 3^2 x 83^1
19 735 735 = 3^1 x 5^1 x 7^2
20 360 360 = 2^3 x 3^2 x 5^1
21 783 783 = 3^3 x 29^1
22 648 648 = 2^3 x 3^4
23 360 360 = 2^3 x 3^2 x 5^1
24 594 594 = 2^1 x 3^3 x 11^1
25 500 500 = 2^2 x 5^3
26 540 540 = 2^2 x 3^3 x 5^1
27 904 904 = 2^3 x 113^1
28 936 936 = 2^3 x 3^2 x 13^1

View File

@ -0,0 +1,24 @@
1 2 3 2 1 1 4 ; 3 2 1
;
1 2 3 2 1 1 4 3 2 2 1 ; 3 2 1 4 3 2 2 1
1 2 3 4 5 ; _
1 2 3 4 5 4 ; 5 4
1 2 1 4 1 4 1 ; 2 1 4 1 4 1
5 2 1 4 1 4 5 ; 5 2 1 4 1
3 2 1 3 2 1 3 2 1 ; 3 2 1 3 2 1 3 2 1
1 2 6 2 6 4 7 8 7 8 8 1 6 8 5 8 5 2 ; 6 2 6 4 8 7 8 1 8 5 8 5 2
6 4 5 8 2 4 8 2 2 5 ; 6 4 8 2 8 2
1 1 1 7 4 7 8 7 3 7 7 4 5 8 8 3 ; 7 4 8 7 3 7 4 8 3
4 1 6 2 8 6 2 5 ; 4 1 6 2 8 6 2
5 1 6 5 4 5 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