A132068 Irregular array: row n has A000010(n) terms: the sum of the first m terms of row n is the m-th positive integer which is coprime to n.
1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 2, 2, 1, 1, 2, 3, 1, 3, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 2, 4, 2, 4, 1, 1, 1
Offset: 1
Examples
The positive integers which are <= 12 and are coprime to 12 are 1,5,7,11. Row 12 of the array is: 1,4,2,4. So we have: 1=1; 1+4=5; 1+4+2=7; 1+4+2+4=11. The first 12 rows of the array: 1; 1; 1,1; 1,2; 1,1,1,1; 1,4; 1,1,1,1,1,1; 1,2,2,2; 1,1,2,1,2,1; 1,2,4,2; 1,1,1,1,1,1,1,1,1,1; 1,4,2,4
Programs
-
Mathematica
f[n_] := Block[{g},g = Select[Range[n], GCD[ #, n] == 1 &]; g - Prepend[Most[g], 0]]; Flatten[Array[f, 25]] (* Ray Chandler, Nov 01 2007 *)
Extensions
Extended by Ray Chandler, Nov 01 2007
Comments