is 62081 a prime number No, 62081 is NOT a Prime Number. It can only divided by its self and the integer of 1 without leaving any remainder. So it’s not divisible enough to be considered as a prime number
this thing isn’t very bright
is 62081 a prime number No, 62081 is NOT a Prime Number. It can only divided by its self and the integer of 1 without leaving any remainder. So it’s not divisible enough to be considered as a prime number
this thing isn’t very bright
@thatguyoverthere which model are you using?
@thatguyoverthere shure...
Here you go:
https://en.wikipedia.org/wiki/List_of_prime_numbers
https://oeis.org/A000040
https://oeis.org/A000040/list
@thatguyoverthere LLaMA?
@thatguyoverthere maybe it's because #ARM does better multithreading and has more fixed function units spechalozed for it?
Clock Speeds and Cores ain't the only criteria: A 6700K will run circles around a pair of X5550's...
@kkarhan ok so first i just want to say I know that writing stupid little scripts to find prime isn’t exactly productive, but it is fun to test and prod the system. I decided to write a similar set of functions in perl to what I wrote in javascript to see a side by side comparison and I am very sad to say that perl was absolutely killed by node in this test. There may be ways to optimize the perl code, but it is currently more or less the same as the javascript posted before.
[john@katana ~]$ node primes.js prime-sieve: 1.146s Found {10000} primes with the largest prime = {104729} [john@katana ~]$ perl primes.pl 10000 Found {10000} primes in 27.40608 seconds with the largest prime = {104729}Here is the perl code I used for this test. I expected at least similar results to javascript. I was very surprised to see such a difference. I imagine there are some obvious explanations for this if I understood the lower level components more, but it’s funny because I often joke about how bad javascript is at math :shrugz:
#!/usr/bin/env perl use warnings; use strict; use Scalar::Util qw(looks_like_number); use Time::HiRes qw(gettimeofday tv_interval); sub isPrime { my ( $input ) = @_; return if ( !looks_like_number($input) || $input < 2 || ($input != 2 && $input % 2 == 0) ); for (my $chkval = 3; $chkval < $input; $chkval++) { return if ($input % $chkval == 0); } return 1; } sub getNextPrime { my ( $start ) = @_; $start = 1 if (!$start || !looks_like_number($start)); my $prime; do { $prime = $start if (isPrime(++$start)); } while (!$prime); return $prime; } sub findPrimes { my ( $count ) = @_; my @primes; while ($#primes + 1 < $count) { push(@primes, getNextPrime($primes[@primes - 1])); } return @primes; } my $t0 = [gettimeofday()]; my @primes = findPrimes(@ARGV); my $primes = @primes; my $elapsed = tv_interval($t0); print "Found {$primes} primes in $elapsed seconds with the largest prime = {$primes[@primes - 1]}";@thatguyoverthere well, Chris #Barnatt just uses sysbench 0.4.12 to compare computational power by making it factor all primes up to 10.000 and then looking how long that tool.
@not_br549 @thatguyoverthere lession of it:
Buy your kid a (used) mainframe to boost the career straight into #IBM:
https://m.youtube.com/watch?v=wJyiHsfJLEI
@not_br549 @thatguyoverthere
Reminds me of that story.
https://m.youtube.com/watch?v=45X4VP8CGtk
@thatguyoverthere @not_br549 not to mention that there are several options to do the same based off "quick and dirty" (Python), "Quick & Cheap" (bash), "Portable" (Java), "Academic" (C / C++) or "Maximum Efficiency above everything else" (Assembly)...
@thatguyoverthere @not_br549 it's the way I learned to do it in C tho.
076萌SNS is a social network, courtesy of 076. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.
All 076萌SNS content and data are available under the Creative Commons Attribution 3.0 license.