Package sage :: Package combinat :: Module sloane_functions :: Class A000010
[hide private]
[frames] | no frames]

Class A000010

source code

                      object --+        
                               |        
structure.sage_object.SageObject --+    
                                   |    
                      SloaneSequence --+
                                       |
                                      A000010

Instance Methods [hide private]
 
__init__(self)
The integer sequence A000010 is Euler's totient function.
source code
 
_repr_(self)
EXAMPLES:...
source code
 
_eval(self, n)
EXAMPLES:...
source code

Inherited from SloaneSequence: __call__, __cmp__, __getitem__, __iter__, list

Inherited from structure.sage_object.SageObject: __hash__, __new__, __repr__, _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, category, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

The integer sequence A000010 is Euler's totient function.

Number of positive integers $i < n$ that are relative prime to $n$.
Number of totatives of $n$.

Euler totient function $\phi(n)$: count numbers < $n$ and prime to $n$.
euler_phi is a standard SAGE function implemented in PARI


INPUT:
    n -- positive integer

OUTPUT:
    integer -- function value

EXAMPLES:
    sage: a = sloane.A000010; a
    Euler's totient function
    sage: a(1)
    1
    sage: a(0)
    Traceback (most recent call last):
    ...
    ValueError: input n (=0) must be a positive integer
    sage: a(11)
    10
    sage: a.list(12)
    [1, 1, 2, 2, 4, 2, 6, 4, 6, 4, 10, 4]
    sage: a(1/3)
    Traceback (most recent call last):
    ...
    TypeError: input must be an int, long, or Integer

   
AUTHOR:
    -- Jaap Spies (2007-01-12)

Overrides: SloaneSequence.__init__

_repr_(self)

source code 

EXAMPLES:
    sage: sloane.A000010._repr_()
    "Euler's totient function"

Overrides: SloaneSequence._repr_

_eval(self, n)

source code 

EXAMPLES:
    sage: [sloane.A000010._eval(n) for n in range(1,11)]
    [1, 1, 2, 2, 4, 2, 6, 4, 6, 4]

Overrides: SloaneSequence._eval