cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A180017 Difference of sums of digits of n in ternary and in binary.

This page as a plain text file.
%I A180017 #17 Feb 17 2024 08:11:10
%S A180017 0,0,1,-1,1,1,0,0,3,-1,0,0,0,0,1,-1,3,3,0,0,2,0,1,1,2,2,3,-3,-1,-1,-2,
%T A180017 -2,3,1,2,2,0,0,1,-1,2,2,1,1,3,-1,0,0,2,2,3,1,3,3,-2,-2,1,-1,0,0,0,0,
%U A180017 1,-3,3,3,2,2,4,2,3,3,2,2,3,1,3,3,2,2,6,-2,-1,-1,-1,-1,0,-2,1,1,-2,-2,0
%N A180017 Difference of sums of digits of n in ternary and in binary.
%C A180017 This sequence is positive on average, since 1/log(3) > 1/log(4). Do all integers appear infinitely often? - _Charles R Greathouse IV_, Feb 07 2013
%H A180017 Reinhard Zumkeller, <a href="/A180017/b180017.txt">Table of n, a(n) for n = 0..10000</a>
%F A180017 a(n) = A053735(n) - A000120(n);
%F A180017 a(A037301(n)) = 0;
%F A180017 a(A000244(n)) = 1 - A000120(A000244(n));
%F A180017 a(A000079(n)) = A053735(A000079(n)) - 1;
%F A180017 a(A024023(n)) = 2*n - A000120(A024023(n)); a(A000225(n)) = A053735(A000225(n)) - n.
%F A180017 a(n) = A011371(n) - 2*A054861(n). - _Henry Bottomley_, Feb 16 2024
%e A180017 For n = 7 = 21_3 = 111_2, a(n) = (2+1) - (1+1+1) = 0.
%e A180017 For n = 8 = 22_3 = 1000_2, a(n) = (2+2) - (1+0+0+0) = 3.
%e A180017 For n = 9 = 100_3 = 1001_2, a(n) = (1+0+0) - (1+0+0+1) = -1.
%t A180017 Table[Total[IntegerDigits[n,3]]-Total[IntegerDigits[n,2]],{n,0,100}] (* _Harvey P. Dale_, Dec 08 2015 *)
%o A180017 (PARI) a(n) = sumdigits(n,3) - sumdigits(n,2); \\ _Michel Marcus_, Nov 12 2023
%Y A180017 Cf. A180018, A180019, A007088, A007089.
%K A180017 base,sign
%O A180017 0,9
%A A180017 _Reinhard Zumkeller_, Aug 06 2010