login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A206567 S(m,n) = (number of nonzero terms common to the base 3 expansions of m and n), a symmetric matrix read by antidiagonals. 1

%I #31 Mar 20 2018 01:44:23

%S 1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,1,1,1,0,1,0,1,2,1,0,1,0,0,0,1,1,0,

%T 0,0,0,1,0,0,2,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,

%U 0,0,1,1,1,1,0,0,1,0,1,0,0,1,0,1,2,1,0,1,0,0,1,0,0,1,0,0,0,1,1

%N S(m,n) = (number of nonzero terms common to the base 3 expansions of m and n), a symmetric matrix read by antidiagonals.

%C Every nonnegative integer occurs infinitely many times in the matrix.

%H Robert Israel, <a href="/A206567/b206567.txt">Table of n, a(n) for n = 1..10011</a> (antidiagonals 1 to 141, flattened)

%F Diagonal entries S(n,n) = A160384(n) since all nonzero digits match. - _Robert Israel_, Mar 18 2018

%e Northwest corner:

%e 1 0 0 1 0 0 1 0 0 1 0 0 1

%e 0 1 0 0 1 0 0 1 0 0 1 0 0

%e 0 0 1 1 1 0 0 0 0 0 0 1 1

%e 1 0 1 2 1 0 1 0 0 1 0 1 2

%e 0 1 1 1 2 0 0 1 0 0 1 1 1

%e 0 0 0 0 0 1 1 1 0 0 0 0 0

%e 1 0 0 1 0 1 2 1 0 1 0 0 1

%e 0 1 0 0 1 1 1 2 0 0 1 0 0

%e 0 0 0 0 0 0 0 0 1 1 1 1 1

%e 1 0 0 1 0 0 1 0 1 2 1 1 2

%e 0 1 0 0 1 0 0 1 1 1 2 1 1

%e 0 0 1 1 1 0 0 0 1 1 1 2 2

%e 1 0 1 2 1 0 1 0 1 2 1 2 3

%e 4 = 3 + 1 and 13 = 3^2 + 3 + 1, so S(13,4)=2.

%p S:= proc(m,n) local M,N;

%p M:= convert(m,base,3);

%p N:= convert(n,base,3);

%p convert(zip((s,t) -> `if`(s=t and s <> 0, 1, 0),M,N),`+`);

%p end proc:

%p seq(seq(S(k,n-k+1),k=1..n),n=1..30); # _Robert Israel_, Mar 19 2018

%t d[n_] := IntegerDigits[n, 3];

%t t[n_] := Reverse[Array[d, 100][[n]]]

%t s[n_, k_] := Position[t[n], k]

%t t[m_, n_] := Sum[Length[Intersection[s[m, k], s[n, k]]], {k, 1, 2}]

%t TableForm[Table[t[m, n], {m, 1, 24},

%t {n, 1, 24}]] (* A206567 as a matrix *)

%t Flatten[Table[t[i, n + 1 - i], {n, 1, 24},

%t {i, 1, n}]] (* A206567 as a sequence *)

%o (PARI) d(n) = Vecrev(digits(n, 3));

%o T(n, k) = {my(dn = d(n), dk = d(k), nb = min(#dn, #dk)); sum(i=1, nb, dn[i] && (dn[i] == dk[i]));} \\ _Michel Marcus_, Mar 19 2018

%Y Cf. A160384, A206479 (similar in base 2).

%K nonn,tabl,base

%O 1,25

%A _Clark Kimberling_, Feb 09 2012

%E Edited by _Robert Israel_, Mar 19 2018

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)