test whether a string is primitive - Maple Help

Online Help

All Products    Maple    MapleSim


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

StringTools[IsPrimitive] - test whether a string is primitive

Calling Sequence

IsPrimitive( s )

Parameters

s

-

string

Description

• 

The IsPrimitive(s) command returns the value true if s is primitive, and the value false otherwise. A string is primitive if it cannot be written as a proper power of another string. In other words, s is primitive if Repeatt,n=s implies that either s= or s=t and n=1.

Examples

withStringTools:

IsPrimitive

false

(1)

IsPrimitivea

true

(2)

IsPrimitiveaaa

false

(3)

IsPrimitiveabc

true

(4)

IsPrimitiveabcabc

false

(5)

seqIsPrimitiveThueMorsen,n=1..30

true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true

(6)

andmapIsPrimitive,LyndonFactorsRandom1000,'lower'

true

(7)

See Also

string, StringTools, StringTools[LyndonFactors], StringTools[Random], StringTools[ThueMorse]


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