StringTools
IsPeriod
test whether a number is a period of a word
Calling Sequence
Parameters
Description
Examples
IsPeriod( w, p )
w
-
Maple string
p
positive integer; candidate period of w
The IsPeriod(w,p) command tests whether the positive integer p is a period of the string w. A positive integer p is said to be a period of a string s if, for all integers i with 1<=i<=lengths−p, one has si=si+p. If p is a period of w, then the value true is returned; otherwise, false is returned.
All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters. Thus, there is no support for multibyte character encodings, such as unicode encodings.
withStringTools:
IsPeriodabc,1
false
IsPeriodabc,2
IsPeriodabc,3
true
IsPeriodabababa,1
IsPeriodabababa,2
IsPeriodabababa,3
IsPeriodabababa,4
IsPeriodabababa,5
IsPeriodabababa,6
IsPeriodabababa,7
selectcurryIsPeriod,babbababbabbababbabbabab,`$`1..24
8,16,21,23,24
See Also
curry
select
string
StringTools[Period]
Download Help Document