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.

Showing 1-2 of 2 results.

A344636 Numbers k such that half the numbers from 0 to k inclusive contain the digit "1".

Original entry on oeis.org

1, 17, 23, 161, 269, 271, 1457, 3397, 3419, 3421, 13121, 44685, 118097, 674909, 674933, 1062881
Offset: 1

Views

Author

Glen Gilchrist, May 25 2021

Keywords

Comments

Andrew Hilton (see Ref) refers to these as "half-one" numbers.

Examples

			1 is a term since among the numbers 0,1 exactly half contain a digit "1".
17 is a term since among the numbers 0,1,2,...,17 exactly half contain a digit "1".
		

References

  • Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.

Crossrefs

Programs

  • Mathematica
    Select[2Range@2000,Length@Select[Range[0,#-1],MemberQ[IntegerDigits@#,1]&]==#/2&]-1 (* Giorgos Kalogeropoulos, Jul 28 2021 *)

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

Original entry on oeis.org

1, 1, 2915, 39365, 472391, 590489, 6377291, 7440173, 8503055, 9565937
Offset: 0

Views

Author

Glen Gilchrist, May 20 2021

Keywords

Comments

"Half-numbers" are those for which half of the numbers including and preceding it contain a specific digit.
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.

Examples

			a(0)=1 since among the numbers 0,1 exactly half contain a digit "0" and 1 is the smallest number where this occurs.
a(1)=1 since among the numbers 0,1 exactly half contain a digit "1" and 1 is the smallest number where this occurs.
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.
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.
		

References

  • Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.

Crossrefs

Cf. A016189, A344634 (half-zero sequence), A344636 (half-one sequence).

Programs

  • 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
  • Python
    for z in range (0, 10):
        z_s = str(z)
        counts=0
        for x in range (0,1000000000):
            x_s = str(x)
            if z_s in x_s:
                counts += 1
            if counts / (x+1) == 0.5:
                print(x)
                break
    

Formula

a(n) == 1457 (mod 1458) for n >= 2. - Hugo Pfoertner, May 25 2021
Showing 1-2 of 2 results.