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.

This page as a plain text file.
%I A284971 #15 Sep 08 2022 08:46:19
%S A284971 4,7,44,47,74,77,444,447,474,477,744,747,774,777,4444,4447,4474,4477,
%T A284971 4744,4747,4774,4777,7444,7447,7474,7477,7744,7747,7774,7777,44444,
%U A284971 44447,44474,44477,44744,44747,44774,44777,47444,47447,47474,47477,47744,47747
%N A284971 Numbers with digits 4 and 7 only.
%t A284971 Flatten@ Table[FromDigits /@ Tuples[{4, 7}, n], {n, 5}] (* _Giovanni Resta_, Apr 08 2017 *)
%o A284971 (Magma) [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {4, 7}]
%o A284971 (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
%o A284971 (Python)
%o A284971 def a(n):
%o A284971   b = bin(n+1)[3:]
%o A284971   return int("".join(b.replace("0", "4").replace("1", "7")))
%o A284971 print([a(n) for n in range(1, 45)]) # _Michael S. Branicky_, Apr 07 2021
%Y A284971 Prime terms are in A020465.
%Y A284971 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).
%K A284971 nonn,base
%O A284971 1,1
%A A284971 _Jaroslav Krizek_, Apr 07 2017