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

Online Help

All Products    Maple    MapleSim


StringTools

  

IsPrimitive

  

test whether a string is primitive

 

Calling Sequence

Parameters

Description

Examples

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.

• 

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:

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]