StringTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Combinatorics on Words : StringTools/IsPeriod

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&equals;si&plus;p. If p is a period of w, then the value true is returned; otherwise, false is returned.

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]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam