IsPeriod - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


StringTools

  

IsPeriod

  

test whether a number is a period of a word

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

IsPeriod( w, p )

Parameters

w

-

Maple string

p

-

positive integer; candidate period of w

Description

• 

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<=lengthsp, 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.

Examples

withStringTools&colon;

IsPeriodabc&comma;1

false

(1)

IsPeriodabc&comma;2

false

(2)

IsPeriodabc&comma;3

true

(3)

IsPeriodabababa&comma;1

false

(4)

IsPeriodabababa&comma;2

true

(5)

IsPeriodabababa&comma;3

false

(6)

IsPeriodabababa&comma;4

true

(7)

IsPeriodabababa&comma;5

false

(8)

IsPeriodabababa&comma;6

true

(9)

IsPeriodabababa&comma;7

true

(10)

selectcurryIsPeriod&comma;babbababbabbababbabbabab&comma;`$`1..24

8&comma;16&comma;21&comma;23&comma;24

(11)

See Also

curry

select

string

StringTools

StringTools[Period]