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.

A284971 Numbers with digits 4 and 7 only.

Original entry on oeis.org

4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 774, 777, 4444, 4447, 4474, 4477, 4744, 4747, 4774, 4777, 7444, 7447, 7474, 7477, 7744, 7747, 7774, 7777, 44444, 44447, 44474, 44477, 44744, 44747, 44774, 44777, 47444, 47447, 47474, 47477, 47744, 47747
Offset: 1

Views

Author

Jaroslav Krizek, Apr 07 2017

Keywords

Crossrefs

Prime terms are in A020465.
Numbers with digits 4 and k only for k = 0 - 3 and 5 - 9: A169967 (k = 0), A032822 (k = 1), A284920 (k = 2), A032834 (k = 3), A256290 (k = 5), A284634 (k = 6), this sequence (k = 7), A284972 (k = 8), A284973 (k = 9).

Programs

  • Magma
    [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {4, 7}]
    
  • Mathematica
    Flatten@ Table[FromDigits /@ Tuples[{4, 7}, n], {n, 5}] (* Giovanni Resta, Apr 08 2017 *)
  • PARI
    is(n) = my(x=Set([4, 7]), y=Set([0, 1, 2, 3, 5, 6, 8, 9])); if(#setintersect(Set(digits(n)), x) > 0 && #setintersect(Set(digits(n)), y)==0, return(1)); 0 \\ Felix Fröhlich, Apr 08 2017
    
  • Python
    def a(n):
      b = bin(n+1)[3:]
      return int("".join(b.replace("0", "4").replace("1", "7")))
    print([a(n) for n in range(1, 45)]) # Michael S. Branicky, Apr 07 2021