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.

A380759 Number of coincident digits occurring in expression of integers in both base 2 and base 10.

Original entry on oeis.org

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

Views

Author

Paul Duckett, Feb 01 2025

Keywords

Comments

Multiple occurrences (e.g., two ones) count as two occurrences.
The first term having n occurrences is a(10^(n-1)).

Examples

			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
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Total[Min /@ Transpose[(DigitCount[n, #, {0, 1}] & /@ {2, 10})]]; Array[a, 100] (* Amiram Eldar, Feb 04 2025 *)
  • 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

Extensions

More terms from Michel Marcus, Feb 28 2025