Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -1,15 +1,15 @@
|
|||
proc prim_fact x . pf[] .
|
||||
pf[] = [ ]
|
||||
func[] primfact x .
|
||||
p = 2
|
||||
repeat
|
||||
if x mod p = 0
|
||||
pf[] &= p
|
||||
r[] &= p
|
||||
x = x div p
|
||||
else
|
||||
p += 1
|
||||
.
|
||||
until x = 1
|
||||
.
|
||||
return r[]
|
||||
.
|
||||
func digsum x .
|
||||
while x > 0
|
||||
|
|
@ -19,7 +19,7 @@ func digsum x .
|
|||
return sum
|
||||
.
|
||||
for i = 2 to 9999
|
||||
prim_fact i pf[]
|
||||
pf[] = primfact i
|
||||
if len pf[] >= 2
|
||||
sum = 0
|
||||
for e in pf[]
|
||||
|
|
|
|||
7
Task/Smith-numbers/Uiua/smith-numbers-1.uiua
Normal file
7
Task/Smith-numbers/Uiua/smith-numbers-1.uiua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
N ← 10000
|
||||
Primes ← ⇌◌⍢(⊃(▽≠0◿⊢..|⊂⊢)|>0⧻)⊙[]↘2⇡N
|
||||
Candidates ← ▽¬∊:Primes.↘2⇡ # Exclude primes
|
||||
SumD ← /+≡⋕°⋕
|
||||
PrimeDivisors ← ◌◌⍢(⟜(÷/×)⟜(⊙⊂:)▽:⟜(=0◿)⊙.|⋅(>1))Primes ⊙[]
|
||||
Smith ← ▽⊸≡(=⊃(SumD|/+≡SumD PrimeDivisors))
|
||||
⟜⧻ Smith Candidates N
|
||||
3
Task/Smith-numbers/Uiua/smith-numbers-2.uiua
Normal file
3
Task/Smith-numbers/Uiua/smith-numbers-2.uiua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
IsSmith ← =∩(/+≡⋕)⊃°⋕(/◇⊂°⋕°/×)
|
||||
▽⊸≡IsSmith▽⊸≡(≠1⧻°/×)+1⇡10000
|
||||
&p$"Number under 10000: _\nFirst ten: _\nLast ten: _"⊃(⧻|↙10|↙¯10)
|
||||
Loading…
Add table
Add a link
Reference in a new issue