scratch

Difference between version 11 and 12 - Previous - Next
[gold] Replay old scratch page on TCL Wiki. checking end of line issues here. 

 

Not a Replacement for TCL Core
This page on developing pseudocode examples and one line procedures is not a replacement for the current Tcl core and Tcllib, which is much improved since Tcl version 4, and other <faster> language constructs. math ops, Tcllib routines, and other compiled routines can reduce the cost of big-data tasks by about 1/3. The time savings of the core are not always obvious on small quantities of data, like 4 or 5 numbers. Performance of one-line programs may suffer degradation due to lengthy recursion calls, and may be limited by constraints on recursion. Dependence on math operator notation, helper procedures, math check examples, degradation due to lengthy recursion calls, and special library functions should be noted in the comment lines.
======
# list from copy of [Tcllib] deck on jdoodle.
puts " list of twin primes = [ listPrimePairs 3 100 2 ] "
list of twin primes = {3 5} {5 7} {11 13} {17 19} {29 31} {41 43} {59 61} {71 73}
======
----
----
*** Testing Mill's Constant for Primes***
----
======
# Power formula produces a prime number from Mill's Constant
global theta
set theta 1.3063778838630806904686144926
proc mills_constant_tester {limit} { global theta;
expr {  int( [ expr {($theta**(3**$limit))} ] )}}
puts " mills_constant [ mills_constant_tester 1 ]      "
puts " mills_constant [ mills_constant_tester 2 ]     "
puts " mills_constant [ mills_constant_tester 3 ]   "
puts " mills_constant [ mills_constant_tester 4 ]   "
# mills_constant 2      
# mills_constant 11     
# mills_constant 1361   
# mills_constant 2521008886
# big numbers evaled and large significant figures in constant, results limited quickly in most setups. 
====== 
----
Note. Power formula produces a prime number from Mill's Constant. Big numbers are evaled here and large significant figures in constant. Results are limited quickly in most setups. 
----
Note. Condition that N>10, primes end in either 1,3,5,7 for base 10? In base 10, prime numbers end in either 1, 3, 7, or 9. The last digit of a prime number cannot be 0, 2, 4, 6, or 8 because those numbers are all divisible by 2. The last digit cannot be 5 because that would make the number divisible by 5. This leaves us with the last digits 1, 3, 7, and 9.
--------#
<<categories>> Numerical Analysis | Toys | Calculator | Mathematics| Example| Toys and Games | Games | Application | GUI
----
<<categories>> Development | Concept| Algorithm  | Biology