Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -15,7 +15,7 @@ scope # find unprimeable numbers - numbers which can't be made into a prime by c
|
|||
od;
|
||||
|
||||
# returns true if n is unprimeable, false otherwise
|
||||
local procedure isUnprimeable( n :: number ) :: boolean
|
||||
local proc isUnprimeable( n :: number ) :: boolean
|
||||
local result := false;
|
||||
if n < 100 then return false
|
||||
elif prime[ n ] then return false
|
||||
|
|
@ -63,7 +63,7 @@ scope # find unprimeable numbers - numbers which can't be made into a prime by c
|
|||
end
|
||||
|
||||
# returns a string representation of n with commas, n must be an integer
|
||||
local procedure commatise( n :: number ) :: string
|
||||
local proc commatise( n :: number ) :: string
|
||||
local constant nStr := tostring( abs n );
|
||||
local constant signStr := if n < 0 then "-" else "" fi;
|
||||
local constant cStr := strings.reverse( strings.gsub( strings.reverse( nStr ), "%d%d%d", "%1," ) );
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ unprimeable?: function [n][
|
|||
if prime? n -> return false
|
||||
nd: to :string n
|
||||
loop.with:'i nd 'prevDigit [
|
||||
loop `0`..`9` 'newDigit [
|
||||
loop '0'..'9' 'newDigit [
|
||||
if newDigit <> prevDigit [
|
||||
nd\[i]: newDigit
|
||||
if prime? to :integer nd -> return false
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
-- 3 Aug 2025
|
||||
include Settings
|
||||
-- 24 Aug 2025
|
||||
include Setting
|
||||
|
||||
say 'UNPRIMEABLE NUMBERS'
|
||||
say version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue