|
|
A077688
|
|
a(n) = sum of all cyclic permuted concatenations of the next n numbers.
|
|
1
|
|
|
1, 55, 1665, 269884, 6565656565, 1121212121211, 176767676767675, 26262626262626260, 3727272727272727269, 510101010101010101005, 67777777777777777777771, 8787878787878787878787870, 1116161616161616161616161605
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
For n not in A068092 (implying that all n numbers in the concatenation have the same length L), a(n) = ((n^2+1)*n)/2 * (10^(L*n)-1)/(10^L-1), where L = ceiling(log(n^2/2)/log(10)). - Max Alekseyev, Feb 11 2005
|
|
EXAMPLE
|
a(2) = 23 + 32, a(4) = 78910 + 89107 + 91078 + 10789 = 269884 = sum of concatenation of numbers in each group: (7,8,9,10), (8,9,10,7), (9,10,7,8), (10,7,8,9).
|
|
PROG
|
(PARI) { len10(n) = ceil(log(n+1)/log(10)) } { A077688(n) = local(m, w, s); m=0; for(k=1+(n*(n-1))/2, (n*(n+1))/2, m=m*10^len10(k)+k ); w=10^len10(m); s=0; for(k=1+(n*(n-1))/2, (n*(n+1))/2, m=(m*10^len10(k)+k)%w; s+=m ); return(s); } \ for n not in A068092 { a(n) = local(l); l=len10(n^2/2); return((n^2+1)*n*(10^(l*n)-1)/(10^l-1)/2) } \\ Max Alekseyev, Feb 11 2005
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|