login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A177895 Trace of the square matrix whose rows are the cyclic permutations of the digits of n. 1

%I

%S 0,1,2,3,4,5,6,7,8,9,2,2,2,2,2,2,2,2,2,2,4,4,4,4,4,4,4,4,4,4,6,6,6,6,

%T 6,6,6,6,6,6,8,8,8,8,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,12,12,

%U 12,12,12,12,12,12,12,12,14,14,14,14,14,14,14,14,14,14,16,16,16,16,16,16,16,16,16,16,18,18,18,18,18,18,18,18,18,18,1,2,3,4,5,6,7,8,9,10,2,3,4,5,6,7,8,9,10,11,3,4,5,6,7,8,9,10,11,12,4,5,6,7,8,9,10,11,12,13,5,6,7,8,9,10,11,12

%N Trace of the square matrix whose rows are the cyclic permutations of the digits of n.

%F For n=a, trace(M) = a;

%F for n=ab, trace(M) = 2a;

%F for n=abc, trace(M) = a + b + c;

%F for n=abcd, trace(M) = 2a + 2c.

%e a(123) = 6, because M =

%e [1 2 3]

%e [2 3 1]

%e [3 1 2]

%e and trace(M) = 6.

%o (Sage)

%o def A177895(n):

%o ....d = n.digits()[::-1] if n > 0 else [0]

%o ....M = Matrix(lambda i,j: d[(i+j) % len(d)], nrows=len(d))

%o ....return M.trace() # _D. S. McNeil_, Dec 16 2010

%o (PARI) a(n) = {if(n<10, return(n)); my(d = digits(n), m, s); d = concat(d, d); s = #d/2; m = matrix(s, s, i, j, d[i+j-1]); trace(m)} \\ _David A. Corneth_, Jun 13 2017

%K nonn,base

%O 0,3

%A _Michel Lagneau_, Dec 15 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 15 23:54 EDT 2019. Contains 328038 sequences. (Running on oeis4.)