A096288 Sum of digits of n in bases 2 and 3.
0, 2, 3, 3, 3, 5, 4, 6, 5, 3, 4, 6, 4, 6, 7, 7, 5, 7, 4, 6, 6, 6, 7, 9, 6, 8, 9, 5, 5, 7, 6, 8, 5, 5, 6, 8, 4, 6, 7, 7, 6, 8, 7, 9, 9, 7, 8, 10, 6, 8, 9, 9, 9, 11, 6, 8, 7, 7, 8, 10, 8, 10, 11, 9, 5, 7, 6, 8, 8, 8, 9, 11, 6, 8, 9, 9, 9, 11, 10, 12, 10, 4, 5, 7, 5, 7, 8, 8, 7, 9, 6, 8, 8, 8, 9, 11, 6, 8, 9, 7
Offset: 0
Examples
n=11: 11=1*2^3+1*2^1+1*2^0, 1+1+1=3, 11=1*3^2+2*3^0, 1+2=3, so a(11)=3+3=6.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 0..10000
- Jean-Marc Deshouillers, Laurent Habsieger, Shanta Laishram, and Bernard Landreau, Sums of the digits in bases 2 and 3, in: C. Elsholtz and P. Grabner (eds.), Number Theory - Diophantine Problems, Uniform Distribution and Applications: Festschrift in Honour of Robert F. Tichy's 60th Birthday, Springer, Cham, 2017, pp. 211-217; arXiv preprint, arXiv:1611.08180 [math.NT], 2016.
- H. G. Senge and E. G. Straus, PV-numbers and sets of multiplicity, Period Math Hung 3 (1973), 93-100.
- Cameron Stewart, On the representation of an integer in two different bases, Journal für die reine und angewandte Mathematik, 319 (1980), 63-72.
Programs
-
Maple
f := proc(n) local t1,t2,i; t1:=convert(n,base,2); t2:=convert(n,base,3); add(t1[i],i=1..nops(t1))+ add(t2[i],i=1..nops(t2)); end; # N. J. A. Sloane, Dec 05 2019
-
Mathematica
a[n_] := Total @ IntegerDigits[n, 2] + Total @ IntegerDigits[n, 3]; a /@ Range[0, 100] (* Jean-François Alcover, Aug 21 2020 *) Table[Total[Flatten[IntegerDigits[n,{2,3}]]],{n,0,100}] (* Harvey P. Dale, Jan 29 2021 *)
-
PARI
a(n) = sumdigits(n, 2) + sumdigits(n, 3); \\ Michel Marcus, Aug 21 2020
-
Python
sumdigits = lambda n, b: n % b + sumdigits(n // b, b) if n else 0 a = lambda n: sumdigits(n, 2) + sumdigits(n, 3) # David Radcliffe, Jan 16 2024
Formula
a(n) > (log log n) / (log log log n + C) - 1 for n > 25, where C is effectively computable (Stewart 1980). - David Radcliffe, Jan 16 2024
Extensions
Edited by N. J. A. Sloane, Dec 05 2019
Comments