type/squarefree - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Mathematics : Numbers : Type Checking : type/squarefree

type/squarefree

check for a square-free integer

type/cubefree

check for a cube-free integer

 Calling Sequence type( expr, squarefree ) type( expr, cubefree )

Parameters

 expr - any Maple expression

Description

 • The type( expr, squarefree ) command returns true if expr is a square-free integer, and false otherwise.  An integer is square-free if it is not divisible by the square of any prime number.
 • An integer is square-free if, and only if, it is equal to its radical.
 • The type( expr, cubefree ) command returns true if expr is a cube-free integer, and false otherwise.  An integer is cube-free if it is not divisible by the cube of any prime number.

Examples

 > $\mathrm{type}\left(6,'\mathrm{squarefree}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(12,'\mathrm{squarefree}'\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{type}\left(12,'\mathrm{cubefree}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(54,'\mathrm{cubefree}'\right)$
 ${\mathrm{false}}$ (4)

The asymptotic natural density of square-free integers is equal to $\frac{6}{{\mathrm{\pi }}^{2}}=\frac{1}{\mathrm{zeta}\left(2\right)}$.

 > $N≔100000:$$\frac{\mathrm{nops}\left(\mathrm{select}\left(\mathrm{type},\left[\mathrm{seq}\right]\left(1..N\right),'\mathrm{squarefree}'\right)\right)}{N}$
 $\frac{{30397}}{{50000}}$ (5)
 > $\mathrm{evalf}\left(%\right)$
 ${\mathrm{lastexception}}$ (6)
 > $\mathrm{evalf}\left(\frac{6}{{\mathrm{\pi }}^{2}}\right)$
 ${0.6079271016}$ (7)

Similarly, the asymptotic natural density of the cube-free integers is $\frac{1}{\mathrm{zeta}\left(3\right)}$.

 > $N≔10000:$$\frac{\mathrm{nops}\left(\mathrm{select}\left(\mathrm{type},\left[\mathrm{seq}\right]\left(1..N\right),'\mathrm{cubefree}'\right)\right)}{N}$
 $\frac{{8319}}{{10000}}$ (8)
 > $\mathrm{evalf}\left(%\right)$
 ${\mathrm{lastexception}}$ (9)
 > $\mathrm{evalf}\left(\frac{1}{\mathrm{\zeta }\left(3\right)}\right)$
 ${0.8319073727}$ (10)

 See Also
{"ft_lang_label":"__label__en","ft_lang_prob":0.54959065,"math_prob":0.99999034,"size":1220,"snap":"2021-04-2021-17","text_gpt3_token_len":378,"char_repetition_ratio":0.17269737,"word_repetition_ratio":0.12195122,"special_character_ratio":0.24590164,"punctuation_ratio":0.13692947,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9994399,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-12T18:54:33Z\",\"WARC-Record-ID\":\"<urn:uuid:48b5da8d-5866-4e3c-8be7-993df380c622>\",\"Content-Length\":\"189658\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4ac70e3b-e97f-4bc7-b87e-6eb70c1aa5d1>\",\"WARC-Concurrent-To\":\"<urn:uuid:e64d6309-2a60-4411-85ed-fc379d334325>\",\"WARC-IP-Address\":\"199.71.183.28\",\"WARC-Target-URI\":\"https://de.maplesoft.com/support/help/maplesim/view.aspx?path=type%2Fsquarefree\",\"WARC-Payload-Digest\":\"sha1:4QWNRFLRSKCENJJIK2O6HPQL2UFRLLUF\",\"WARC-Block-Digest\":\"sha1:ZP3PAJFCZVD7DTQ67A6SOFS4PA2SDBBF\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618038069133.25_warc_CC-MAIN-20210412175257-20210412205257-00549.warc.gz\"}"}