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!)
A180017 Difference of sums of digits of n in ternary and in binary. 4

%I #17 Feb 17 2024 08:11:10

%S 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 -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 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 Difference of sums of digits of n in ternary and in binary.

%C 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 Reinhard Zumkeller, <a href="/A180017/b180017.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A053735(n) - A000120(n);

%F a(A037301(n)) = 0;

%F a(A000244(n)) = 1 - A000120(A000244(n));

%F a(A000079(n)) = A053735(A000079(n)) - 1;

%F a(A024023(n)) = 2*n - A000120(A024023(n)); a(A000225(n)) = A053735(A000225(n)) - n.

%F a(n) = A011371(n) - 2*A054861(n). - _Henry Bottomley_, Feb 16 2024

%e For n = 7 = 21_3 = 111_2, a(n) = (2+1) - (1+1+1) = 0.

%e For n = 8 = 22_3 = 1000_2, a(n) = (2+2) - (1+0+0+0) = 3.

%e For n = 9 = 100_3 = 1001_2, a(n) = (1+0+0) - (1+0+0+1) = -1.

%t Table[Total[IntegerDigits[n,3]]-Total[IntegerDigits[n,2]],{n,0,100}] (* _Harvey P. Dale_, Dec 08 2015 *)

%o (PARI) a(n) = sumdigits(n,3) - sumdigits(n,2); \\ _Michel Marcus_, Nov 12 2023

%Y Cf. A180018, A180019, A007088, A007089.

%K base,sign

%O 0,9

%A _Reinhard Zumkeller_, Aug 06 2010

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 May 9 19:33 EDT 2024. Contains 372354 sequences. (Running on oeis4.)