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
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Table of n, a(n) for n=0..147.

FORMULA

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

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

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

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

EXAMPLE

a(123) = 6, because M =

  [1 2 3]

  [2 3 1]

  [3 1 2]

and trace(M) = 6.

PROG

(Sage)

def A177895(n):

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

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

....return M.trace() # D. S. McNeil, Dec 16 2010

(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

CROSSREFS

Sequence in context: A083960 A138795 A297233 * A238986 A227876 A276716

Adjacent sequences:  A177892 A177893 A177894 * A177896 A177897 A177898

KEYWORD

nonn,base

AUTHOR

Michel Lagneau, Dec 15 2010

STATUS

approved

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 September 17 22:53 EDT 2019. Contains 327147 sequences. (Running on oeis4.)