A074133 Average of the n-th group, if positive integers are rearranged in groups of k=1,2,3,... numbers whose sum is a multiple of k.
1, 3, 5, 9, 13, 18, 25, 33, 41, 51, 61, 72, 85, 99, 113, 128, 145, 163, 181, 200, 221, 243, 265, 288, 313, 339, 365, 393, 421, 450, 481, 513, 545, 578, 613, 649, 685, 722, 761, 801, 841, 882, 925, 969, 1013, 1058, 1105, 1153, 1201, 1250, 1301, 1353, 1405
Offset: 1
Keywords
Examples
From _M. F. Hasler_, May 07 2010: (Start) Below the groups are given inside /*...*/, followed by the average a(n): /*[1]*/ 1, /*[2, 4]*/ 3, /*[3, 5, 7]*/ 5, /*[6, 8, 9, 13]*/ 9, /*[10, 11, 12, 14, 18]*/ 13, /*[15, 16, 17, 19, 20, 21]*/ 18, /*[22,23, 24, 25, 26, 27, 28]*/ 25, /*[29, 30, 31, 32, 33, 34, 35, 40]*/ 33, /*[36, 37, 38, 39, 41, 42, 43, 44, 49]*/ 41, /*[45, 46, 47, 48, 50, 51, 52, 53, 54, 64]*/ 51, /*[55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 75]*/ 61, /*[66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 77, 81]*/ 72, ... (End)
Programs
-
PARI
{v=vector(10000); print1(v[1]=1); for(n=2,80, s=0;i=1; for(k=1,n-1, while(v[i],i++); s+=i; v[i]=1); i=ceil(s/n)*n-s; while(! i||v[i], i+=n); s+=i; v[i]=1; print1(","s/n))}
-
PARI
/* Removing the code involving "show" considerably speeds up the computation */ A074133(n,show=0 /* 1:print terms 1..n, 2:print all groups */)={ my(t, u=0, lu=1 /* least unused */); for(k=1, n, my(v=[]); s=sum( i=1,k-1, t=lu; while(bittest(u,t), t++); show>1 & v=concat(v,t); u+=1<
1 & print1("/*"concat(v,n-s)"*/ "); t=n/k; show & print1(t,", "); break));t} \\ M. F. Hasler, May 07 2010
Formula
a(n) = A074132(n) / n. - Sean A. Irvine, Jan 12 2025
Extensions
Corrected and extended by Ralf Stephan, Mar 26 2003
Edited by M. F. Hasler, May 09 2010
Comments