login
A380759
Number of coincident digits occurring in expression of integers in both base 2 and base 10.
0
1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3
OFFSET
1,10
COMMENTS
Multiple occurrences (e.g., two ones) count as two occurrences.
The first term having n occurrences is a(10^(n-1)).
EXAMPLE
a(10) = 2, because 10 in base 10 is 1010 in base 2 (coincident digits 1 and 0).
For n=1002, the following a(1002) = 3 digits coincide,
n = decimal 1002
n = binary 1111101010
^^^ same digits
MATHEMATICA
a[n_] := Total[Min /@ Transpose[(DigitCount[n, #, {0, 1}] & /@ {2, 10})]]; Array[a, 100] (* Amiram Eldar, Feb 04 2025 *)
PROG
(PARI) a(n) = my(b=binary(n), d=digits(n)); min(#select(x->(x==1), b), #select(x->(x==1), d)) + min(#select(x->(x==0), b), #select(x->(x==0), d)); \\ Michel Marcus, Feb 04 2025
CROSSREFS
Sequence in context: A332029 A211312 A085978 * A141044 A064284 A371807
KEYWORD
nonn,easy,base
AUTHOR
Paul Duckett, Feb 01 2025
EXTENSIONS
More terms from Michel Marcus, Feb 28 2025
STATUS
approved