Totient function and its identity
Maxima 5.22.1 http://maxima.sourceforge.net      
using Lisp CMU Common Lisp Snapshot 2010-05 (20A Unicode)       
Distributed under the GNU Public License. See the file COPYING.       
Dedicated to the memory of William Schelter.       
The function bug_report() provides bug reporting information.       
(%i1) block(load(("/Users/yasube/Programming/imaxima-imath/imaxima.lisp")), linenum:0)$       
      
(%i1) n=dsum(totient(d),d,n);       
      ![1[10] 1[10]](http://lh3.ggpht.com/_kMkN9tZCTEY/TQS7qAj6YEI/AAAAAAAAGXo/o4PuzPBbPvU/1%5B10%5D_thumb.png?imgmax=800) 
      
(%i2) listify(divisors(24));       
      ![2[11] 2[11]](http://lh6.ggpht.com/_kMkN9tZCTEY/TQS7rJHtOBI/AAAAAAAAGXw/nqReA1E_7ig/2%5B11%5D_thumb.png?imgmax=800) 
      
(%i3) map(totient, %);       
      ![3[10] 3[10]](http://lh6.ggpht.com/_kMkN9tZCTEY/TQS7sKk5idI/AAAAAAAAGX4/ypXMijrdOMM/3%5B10%5D_thumb.png?imgmax=800) 
      
(%i4) apply("+", %);       
      ![4[10] 4[10]](http://lh4.ggpht.com/_kMkN9tZCTEY/TQS7tGbrD1I/AAAAAAAAGYA/6BAEIkkgWuQ/4%5B10%5D_thumb.png?imgmax=800) 
      
(%i5) pair2frac(x):=first(x)/second(x);       
      ![5[10] 5[10]](http://lh6.ggpht.com/_kMkN9tZCTEY/TQS7uQG4atI/AAAAAAAAGYI/NSNBDxlKUu4/5%5B10%5D_thumb.png?imgmax=800) 
      
(%i6) orderbydenom(x,y):=orderlessp(denom(x),denom(y));       
      ![6[10] 6[10]](http://lh6.ggpht.com/_kMkN9tZCTEY/TQS7vWGoCKI/AAAAAAAAGYQ/EnqWwfEexqA/6%5B10%5D_thumb.png?imgmax=800) 
      
(%i7) create_list([k,n],k,1,n),n=10;       
      ![7[10] 7[10]](http://lh3.ggpht.com/_kMkN9tZCTEY/TQS7wde5iGI/AAAAAAAAGYY/N5DFxd5_nXE/7%5B10%5D_thumb%5B1%5D.png?imgmax=800) 
      
(%i8) map(pair2frac,%);       
      ![8[10] 8[10]](http://lh5.ggpht.com/_kMkN9tZCTEY/TQS7xZWPnOI/AAAAAAAAGYg/ck_jpzbHh5g/8%5B10%5D_thumb.png?imgmax=800) 
      
(%i9) sort(%,orderbydenom);       
      ![9[10] 9[10]](http://lh4.ggpht.com/_kMkN9tZCTEY/TQS7yiSdl6I/AAAAAAAAGYo/6NDMg4_zCiI/9%5B10%5D_thumb.png?imgmax=800) 
      
(%i10) create_list([k,n],k,1,n),n=24;       
      ![10[10] 10[10]](http://lh3.ggpht.com/_kMkN9tZCTEY/TQS7zwDzdII/AAAAAAAAGYw/EINf8UGfKHQ/10%5B10%5D_thumb.png?imgmax=800) 
      
(%i11) map(pair2frac,%);       
      ![11[10] 11[10]](http://lh6.ggpht.com/_kMkN9tZCTEY/TQS71Gj1nxI/AAAAAAAAGY4/35HfwBqLwos/11%5B10%5D_thumb%5B1%5D.png?imgmax=800) 
      
(%i12) sort(%,orderbydenom);       
      ![12[10] 12[10]](http://lh3.ggpht.com/_kMkN9tZCTEY/TQS724XzjFI/AAAAAAAAGZA/lB2GkOgBa6s/12%5B10%5D_thumb%5B1%5D.png?imgmax=800) 
      
(%i13)   
  
  
 
