Tcl Source Code

Artifact [e750f5d38f]
Login

Artifact e750f5d38fa257f9157484090127f9ffd826e776:

Attachment "prime.tcl" to ticket [1513763fff] added by nobody 2006-06-28 12:20:42.
#gets stdin max
set max 100
for {set i 2} {$i<=$max} {incr i} {
	set str [string repeat "o" $i]
	if {[regexp {^(oo+?)(\1)*$} $str j k l]} {
		if {[string length $l] == 0} {
			puts -nonewline [format "%d\t" $i]
		}
	}
}