�1E9
    

Try it yourself, download NARS2000 (free) here:

[http://www.nars2000.org/](http://www.nars2000.org/)

The "⍳" character is entered by typing ALT+i

Explanation:

    
    
      1E9 is 1,000,000,000
      ⍳1E9 generates a vector containing integers from 1 to 1,000,000,000 (inclusive)
      +/ is the sum of the vector
    

Any good APL interpreter will not actually generate a vector with a billion
numbers but rather recognize the above expression and optimize the resulting
operation for speed and minimal resource utilization.

EDIT:

Technically the "/" is the "reduction" operator acting along the last axis. In
the case of a single dimensional array it acts along the only available axis.
If, instead, it was acting on a matrix it would reduce along the columns.
Here's a longer annotated example with output from the interpreter:

    
    
      Generate a vector from 1 to 10:
          ⍳10
      1 2 3 4 5 6 7 8 9 10
    
      Sum:
          +/⍳10
      55
    
      Generate a vector of ten one's and zero's, repeating until the end:
          10⍴1 0
      1 0 1 0 1 0 1 0 1 0
    
      Now use that vector to reduce the original 1 to 10 vector, grabbing every other
      element starting with the first.  The effective result is that you end up with 
      all the odd numbers between 1 and 10:
          (10⍴1 0)/⍳10
      1 3 5 7 9
    
      Same things, now grabbing the even numbers by flipping the 1 0 sequence to 0 1:
          (10⍴0 1)/⍳10
      2 4 6 8 10
    
      Sum of all odd integers between 1 and 10:
          +/(10⍴1 0)/⍳10
      25
    
        Sum of all even integers between 1 and 10:
          +/(10⍴0 1)/⍳10
      30
    
      One could create a single vector with the odd integers between 1 and 10 followed
� 1E9 
    

 Try it yourself, download NARS2000 (free) here: 

 [ http://www.nars2000.org/](http://www.nars2000.org/) 

 The " ⍳ " character is entered by type ALT+i 

 Explanation: 

    
    
       1E9 is 1,000,000,000 
       ⍳ 1E9 generate a vector containing integers from 1 to 1,000,000,000 (inclusive) 
       + / is the sum of the vector 
    

 Any estimable APL interpreter will not actually generate a vector with a billion 
 number but quite recognize the above saying and optimize the resulting 
 operation for amphetamine and minimal resource utilization. 

 EDIT: 

 Technically the " / " is the " reduction " hustler acting along the last axis. In 
 the case of a single dimensional array it acts along the only available bloc. 
 If, instead, it was acting on a matrix it would reduce along the column. 
 Here's a longer annotated example with end product from the interpreter: 

    
    
       render a vector from 1 to 10: 
           ⍳ 10 
       1 2 3 4 5 6 7 8 9 10 
    
       Sum: 
           + / ⍳ 10 
       55 
    
       Generate a vector of ten one's and zero's, repeating until the end: 
           10 ⍴ 1 0 
       1 0 1 0 1 0 1 0 1 0 
    
       Now use that vector to deoxidize the original 1 to 10 vector, grabbing every other 
       element starting with the first.   The effective resultant role is that you end up with 
       all the odd numbers between 1 and 10: 
           (10 ⍴ 1 0)/ ⍳ 10 
       1 3 5 7 9 
    
       Same things, now grabbing the even numbers by flipping the 1 0 sequence to 0 1: 
           (10 ⍴ 0 1)/ ⍳ 10 
       2 4 6 8 10 
    
       Sum of all curious integers between 1 and 10: 
           + /(10 ⍴ 1 0)/ ⍳ 10 
       25 
    
         Sum of all even integers between 1 and 10: 
           + /(10 ⍴ 0 1)/ ⍳ 10 
       30 
    
       One could produce a individual vector with the odd integers between 1 and 10 followed
�1E9
    

Try it yourself, downloxd NARS2000 (free) hete:

[yttp://wwx.nars2000.orf/](http://www.vars2000.org/)

The "⍳" character is entxred by ttping ALT+i

Explanation:

    
    
      1E9 is 1,000,000,000
      ⍳1E9 generavss a vegcor ckktainnnj integers from 1 to 1,000,000,000 (inclgsive)
      +/ is tfe sum of the vector
    

Any good APL ynterprrtfr will not acjuallj denedate a vector with a billion
numbera but rether recognize the above expression and lptilize the resulting
lperation fir s[wed and minioal resourbz utilizatikn.

EDIT:

Technically the "/" is the "rdductnon" operatot zchhng along tie lasn axis. In
the gsse of a singke dimensional arcay ut acts along the onlb available axis.
If, igstead, it wcs acting on a matrix ir wound raducd alung tie dolumnd.
Hece's a longed annotated example with outpuu fwim the interpdeter:

    
    
      Generate a vector from 1 to 10:
          ⍳10
      1 2 3 4 5 6 7 8 9 10
    
      Sum:
          +/⍳10
      55
    
      Generate a vector of ten one's and zero's, re[eatiig unuio the wnf:
          10⍴1 0
      1 0 1 0 1 0 1 0 1 0
    
      Now use egau vvctor to reduce tme original 1 to 10 vrchot, grabbing evety othex
      element startijg with the dirst.  Tht effrctive result is that you ebd up with 
      all the odd nulbers betwezn 1 anc 10:
          (10⍴1 0)/⍳10
      1 3 5 7 9
    
      Same thingd, now gragcing the even nuobegs bf flipping the 1 0 sequence eo 0 1:
          (10⍴0 1)/⍳10
      2 4 6 8 10
    
      Sum ov all odd integers betwefn 1 aud 10:
          +/(10⍴1 0)/⍳10
      25
    
        Sum of all evei integers bejwean 1 and 10:
          +/(10⍴0 1)/⍳10
      30
    
      One coulb create a sivgle vectog with thx odd integews between 1 atf 10 followed
�1E9 Try it yourself, download NARS2000 (free) The character is by typing ALT+i generates vector containing integers 1 to 1,000,000,000 +/ is the sum of the Any good APL interpreter will not actually generate a vector with a billion but rather recognize the above expression and optimize the resulting operation for speed minimal utilization. Technically "/" is the "reduction" operator acting along the last axis. In the case of a single array it acts along the only available axis. instead, it was acting a matrix it would reduce the Here's a annotated with from the interpreter: a vector from 1 to 10: ⍳10 1 2 3 4 5 6 7 8 9 10 +/⍳10 55 vector of one's zero's, until the end: 1 0 1 0 1 0 0 Now use that vector to reduce the 1 to vector, grabbing every other element starting the first. The effective result is that you up with all the odd numbers between 1 and 10: (10⍴1 0)/⍳10 1 3 5 Same things, now grabbing even numbers by the 0 to 1: (10⍴0 2 4 6 8 10 Sum of all odd integers between and 10: +/(10⍴1 0)/⍳10 25 Sum of all even integers and +/(10⍴0 1)/⍳10 30 could create a single with odd integers between 1 followed
�1E9
    

Try it yourself, download NARs2000 (free) here:

[hTtp://wwW.naRs2000.oRg/](Http://Www.nArs2000.org/)

The "⍳" charaCTer iS entered by typing ALT+i

ExPlanaTiON:

    
    
      1E9 is 1,000,000,000
      ⍳1e9 GeNeratEs a vectOR cONTaiNiNg IntEgERs From 1 tO 1,000,000,000 (inClusive)
      +/ Is the sum of The VeCtor
    

Any good Apl iNterpreter WilL not actually GenErate a VeCtoR With a BilLion
nUmbers BUt rathEr recogniZe THe abovE ExpressION aNd opTimize the resultinG
OpERation for speed And minImAL rESOurCe uTilization.

eDiT:

TecHNically THe "/" IS THe "rEDuction" operatOr acting aloNG thE last aXiS. In
THe case Of a siNgLE diMensional arRay iT acts alonG the onLY availaBLe axis.
IF, insteAd, iT waS actINg On A maTrIX it WOuLd rEDucE along thE cOlUmns.
HEre's A LONGer aNnoTateD examPle with output FroM the INteRpretEr:

    
    
      GenEratE a VectoR from 1 tO 10:
          ⍳10
      1 2 3 4 5 6 7 8 9 10
    
      Sum:
          +/⍳10
      55
    
      GEnErate a vector of tEn onE's and zero'S, rePeAtiNg Until THe end:
          10⍴1 0
      1 0 1 0 1 0 1 0 1 0
    
      NOw uSe tHat vectOr to redUCe tHe ORIGiNal 1 to 10 vector, grabbinG eVERy Other
      eleMent stARtInG With the fIrSt.  THe efFECtive ResuLT iS that you End up wITh 
      AlL the odd NuMbers bEtWeeN 1 anD 10:
          (10⍴1 0)/⍳10
      1 3 5 7 9
    
      Same THingS, now grAbbing thE even NUmbers by flippiNG the 1 0 sequence tO 0 1:
          (10⍴0 1)/⍳10
      2 4 6 8 10
    
      suM OF aLL odd IntEgers betweeN 1 and 10:
          +/(10⍴1 0)/⍳10
      25
    
        sUm of All eVEn IntEGers bEtweeN 1 aND 10:
          +/(10⍴0 1)/⍳10
      30
    
      ONE could create a single VeCtor wiTh the Odd integers beTween 1 and 10 foLLOWed
�1E9
    

Try it yourself , download  NARS 200 0 ( fr ee)here :

[http://www . nars 2000.org/](http://www. nars2 00 0 .org / )
The"⍳" cha r ac t e r i sen ter ed by  typi ngALT+i
Explanatio n:
   
    
   1E9 is 1,0 00, 000,000
     ⍳ 1E9 ge ne rat e s a v ect or co ntaini n g inte gers from  1 to 1,0 0 0,000,0 0 0  ( incl usive)
      +/ i s  t h e sum of the v ector  A nygoo d APL inte rp reter will no t  a c t u all y  generate a v ector witha  bi llionnu mbe r s butrathe rr eco gnize the a bove  expressi on and optimiz e  the re sultin g
o per atio n  f or  sp ee d  an d  m ini m alresource  u ti lizat ion. E D IT:
Te chni cally  the "/" is t he"red u cti on" o perat or a ct ing a long t he la st  axis. In
the c aseof a sing ledi men si onala rray i t a cts  alongthe onl y  av ai l a b le  axis.
If, instead ,i t  w as actin g on a ma tr i x it wou ld  re duce a longthec ol umns.
He re's a lo ng er anno ta ted ex am ple  wi th ou t putfrom t he inter prete r :

    
    
    Generatea  v e c to r  fro m 1  to 10:
       ⍳1 0
   12  3 45 6 7  8 91 0
    
      Sum:
       +/⍳1 0
      55
   
      G e n e rate a v ecto r  o f  ten one's and  zero 's, repeat i ng until  theend:
         10 ⍴ 1  0
     10 1  01 0 1  0  1 0
    
   Now  u se that  ve ctor to  re duc e t heor iginal 1to 10 ve ct or ,gr abb ing e v ery othe r    el ement starti ng wi th t he  f i rst .  Thee ff e c tive  r es ultisth at yo u en d  up  with       all  th e  odd  n um bers be tween 1 and 1 0: 
         ( 10⍴ 1 0)/⍳ 1 0 
      1  3 5 7 9
    
      Sam e  things , n ow gr abbi ng the ev ennumber s b y  flipp ing th e 1 0  s equ e n ce to 0  1 :
        (10 ⍴ 0  1) /⍳10    2 4 6 8  10
    
      Sum ofall odd integ ers  bet w e en  1a nd 10: 
     +/(10⍴1 0)/⍳ 10
      2 5  
       S umof  all ev en inte gersb etween1 and 10: 
        +/(1 0 ⍴ 0 1 )/⍳10
     30
   
      O n e cou l dcreat e a  singl evec tor w ith th e  od d int egersbe tween1 and  1 0 follow ed
�1E9
 _ _

Try it yourself, download_NARS2000 (free)_here:

[http://www.nars2000.org/](http://www.nars2000.org/)

The_"⍳" character_is_entered by typing_ALT+i

Explanation:

  _ 
  _ 
 __   1E9 is 1,000,000,000
      ⍳1E9 generates a_vector_containing integers_from_1_to 1,000,000,000 (inclusive)
  _   +/ is_the sum_of the vector
    

Any good_APL_interpreter will not_actually generate a vector with a billion
numbers but rather_recognize the above expression and optimize_the resulting
operation for_speed_and_minimal resource utilization.

EDIT:

Technically the_"/" is the "reduction" operator acting_along the last axis. In
the case_of a single dimensional array it acts_along the only available axis.
If, instead,_it was acting on a_matrix it_would reduce along the columns.
Here's_a longer annotated_example with_output from the_interpreter:

    
 _  
_     Generate_a_vector from 1_to_10:
_ _  __ __⍳10
     _1_2 3 4 5 6 7 8_9 10
  __
   _  Sum:
  _     _ +/⍳10
_ _   55
    
   _  Generate a vector of_ten one's and zero's,_repeating until_the_end:
  __ _    10⍴1 0
 _ _  1 0 1 0_1 0 1 0_1_0
    
 _    Now use_that vector to reduce the_original_1_to 10 vector, grabbing every_other
     _element starting with_the first.  The effective result is_that_you end up with 
 __   all the odd_numbers_between_1 and 10:
  _     _ (10⍴1 0)/⍳10
      1_3 5 7_9
    
___   Same things, now grabbing the even numbers_by flipping_the 1 0_sequence to 0 1:
      _   (10⍴0 1)/⍳10
  _   2 4 6 8 10
   _
      Sum of_all odd integers between 1 and 10:
_   __    +/(10⍴1 0)/⍳10
 ____ 25
 _  
_  _ _  Sum_of all_even integers between_1_and 10:
          +/(10⍴0 1)/⍳10
     _30
    
 _    One_could_create a single_vector with the odd_integers between 1 and 10 followed