Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Pernicious-numbers/Tcl/pernicious-numbers.tcl
Normal file
14
Task/Pernicious-numbers/Tcl/pernicious-numbers.tcl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package require math::numtheory
|
||||
|
||||
proc pernicious {n} {
|
||||
::math::numtheory::isprime [tcl::mathop::+ {*}[split [format %b $n] ""]]
|
||||
}
|
||||
|
||||
for {set n 0;set p {}} {[llength $p] < 25} {incr n} {
|
||||
if {[pernicious $n]} {lappend p $n}
|
||||
}
|
||||
puts [join $p ","]
|
||||
for {set n 888888877; set p {}} {$n <= 888888888} {incr n} {
|
||||
if {[pernicious $n]} {lappend p $n}
|
||||
}
|
||||
puts [join $p ","]
|
||||
Loading…
Add table
Add a link
Reference in a new issue