Integer Sequence Combinations

The nature of the code given in the following examples is explained in the index document.

Integer sequences which are calculated directly from their indexes can have another calculation applied to them.  The calculations given below explore such combinations.

Base Functions

Functions to be used as a basis for the secondary functions defined below are given with explanation and examples in the index file, so their definitions are simply listed in the following.

Sums of Prime Factors

     spf =: +/@q:             NB. sum of prime factors
    snpf =: +/@~.@q:          NB. sum of nub of prime factors
    sopf =: +/@(1&,)@q:       NB. sum of one and prime factors
   sonpf =: +/@(1&,)@~.@q:    NB. sum of one and nub of prime factors
    pnpf =: */@~.@q:          NB. product of nub of prime factors

Geometric Integers

   sq =: *:           NB. squares
   tr =: -:@* >:      NB. n(n+1)/2
   ts =: -:@* 3&+     NB. n(n+3)/2
   tt =: <:@-:@* 3&+  NB. n(n+3)/2 - 1
   pt =: -:@* <:@*&3  NB. n(3n-1)/2

Geometric Sums of Prime Factors

   sq spf 1+i.20         NB. square spf
0 4 9 16 25 25 49 36 36 49 121 49 169 81 64 64 289 64 361 81

This was not in the Encyclopedia, and has been accepted as A074373.  It is A0014142

   tr spf 1+i.20         NB. triangular spf
0 3 6 10 15 15 28 21 21 28 66 28 91 45 36 36 153 36 190 45

This was not in the Encyclopedia, and has been accepted as A074374

   ts spf 1+i.20         NB. triangular spf
0 5 9 14 20 20 35 27 27 35 77 35 104 54 44 44 170 44 209 54

This was not in the Encyclopedia, and has been accepted as A074375

   pt spf 1+i.20         NB. pentagonal spf
0 5 12 22 35 35 70 51 51 70 176 70 247 117 92 92 425 92 532 117

This is now A074376