StringTools - Maple Help

Online Help

All Products    Maple    MapleSim


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

StringTools

  

PrimitiveRoot

  

compute the primitive root of a word

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

PrimitiveRoot( w )

Parameters

w

-

Maple string

Description

• 

The PrimitiveRoot(w) command computes the primitive root of the word (string) w. The primitive root of w is the string r of minimal length for which there is a positive integer e such that w = Repeat( r, e ). That is, r is the smallest root of which w is a power.

Examples

withStringTools:

PrimitiveRoot

(1)

PrimitiveRootabc

abc

(2)

PrimitiveRootabcabc

abc

(3)

PrimitiveRootabcabcab

abcabcab

(4)

PrimitiveRootababab

ab

(5)

PrimitiveRootabababa

abababa

(6)

LremoveIsPrimitive,Generate4,abc

L:=aaaa,abab,acac,baba,bbbb,bcbc,caca,cbcb,cccc

(7)

L2mapPrimitiveRoot,L

L2:=a,ab,ac,ba,b,bc,ca,cb,c

(8)

andmapIsPrimitive,L2

true

(9)

See Also

string

StringTools

StringTools[IsPeriod]

StringTools[IsPrimitive]

StringTools[Period]

StringTools[Repeat]

 


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