Using Recursion to find Primes

Please design 3 to start a program to find primes in ascending order, find 100 primes, and output numbers from large to small in comma-separated order.

however, the program must meet the following conditions.
do not use circular syntax such as For,While. (use recursive processing instead)
speed up. (for example, multithreading)-sharp-sharp-sharp topic description

Jul.14,2022

<?php
function digui($a,$b)
{

    if($a%$b == 0) {
        return $a;
    }else {
        if($b == 2) {
            return false;
        }
        return digui($a,$b-1);
    }
}

function test($num,$arr=[])
{
    $res = digui($num,$num-1);

    if(!$res) {
        array_push($arr,$num);
    }

    if (count($arr) == 100)
    {
        //xu
        rsort($arr);
        //implode = , 
        echo implode(',',$arr);
        exit();
    }
    $numPP; 
    test($num,$arr);
}
test(3,[]);



res = [3]


def isprime(n, i):
    if i == len(res):
        return True
    elif n % res[i] == 0:
        return False
    else:
        return isprime(n, i + 1)


def find(cur):
    if len(res) < 100:
        if isprime(cur, 0):
            res.append(cur)
        cur += 2
        find(cur)


find(5)
print(res)

time complexity O (nk), where kink 100th n is the k th prime of P (k) / 2, and concurrency

is not supported.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bc5cc1-38b55.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bc5cc1-38b55.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?