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.

A344474 Least number k such that half of the numbers from 0 to k inclusive contain the digit n.

This page as a plain text file.
%I A344474 #44 Mar 02 2025 22:35:05
%S A344474 1,1,2915,39365,472391,590489,6377291,7440173,8503055,9565937
%N A344474 Least number k such that half of the numbers from 0 to k inclusive contain the digit n.
%C A344474 "Half-numbers" are those for which half of the numbers including and preceding it contain a specific digit.
%C A344474 For each digit there are a finite number of nonnegative integers k such that exactly half of the numbers from 0 to k contain the digit. This sequence gives the first of these.
%D A344474 Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.
%F A344474 a(n) == 1457 (mod 1458) for n >= 2. - _Hugo Pfoertner_, May 25 2021
%e A344474 a(0)=1 since among the numbers 0,1 exactly half contain a digit "0" and 1 is the smallest number where this occurs.
%e A344474 a(1)=1 since among the numbers 0,1 exactly half contain a digit "1" and 1 is the smallest number where this occurs.
%e A344474 a(2)=2915 since among the numbers 0,1,2,...,2915 exactly half contain a digit "2" and 2915 is the smallest number where this occurs.
%e A344474 a(3)=39365 since among the numbers 0,1,2,...,39365 exactly half contain a digit "3" and 39365 is the smallest number where this occurs.
%o A344474 (Python)
%o A344474 for z in range (0, 10):
%o A344474     z_s = str(z)
%o A344474     counts=0
%o A344474     for x in range (0,1000000000):
%o A344474         x_s = str(x)
%o A344474         if z_s in x_s:
%o A344474             counts += 1
%o A344474         if counts / (x+1) == 0.5:
%o A344474             print(x)
%o A344474             break
%o A344474 (PARI) a(n)={if(n>=1&&n<10, my(k=0); while(n*(2*9^k-10^k)>10^k, k++); 2*9^k*n - 1, n==0)} \\ _Andrew Howroyd_, May 25 2021
%Y A344474 Cf. A016189, A344634 (half-zero sequence), A344636 (half-one sequence).
%K A344474 nonn,base,fini,full,easy
%O A344474 0,3
%A A344474 _Glen Gilchrist_, May 20 2021