Data update

This commit is contained in:
Ingy döt Net 2024-07-13 15:19:22 -07:00
parent 29a5eea0d4
commit 5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions

View file

@ -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[]

View 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

View file

@ -0,0 +1,3 @@
IsSmith ← =∩(/+≡⋕)⊃°⋕(/◇⊂°⋕°/×)
▽⊸≡IsSmith▽⊸≡(≠1⧻°/×)+1⇡10000
&p$"Number under 10000: _\nFirst ten: _\nLast ten: _"⊃(⧻|↙10|↙¯10)