login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A284971 Numbers with digits 4 and 7 only. 5

%I #15 Sep 08 2022 08:46:19

%S 4,7,44,47,74,77,444,447,474,477,744,747,774,777,4444,4447,4474,4477,

%T 4744,4747,4774,4777,7444,7447,7474,7477,7744,7747,7774,7777,44444,

%U 44447,44474,44477,44744,44747,44774,44777,47444,47447,47474,47477,47744,47747

%N Numbers with digits 4 and 7 only.

%t Flatten@ Table[FromDigits /@ Tuples[{4, 7}, n], {n, 5}] (* _Giovanni Resta_, Apr 08 2017 *)

%o (Magma) [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {4, 7}]

%o (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 (Python)

%o def a(n):

%o b = bin(n+1)[3:]

%o return int("".join(b.replace("0", "4").replace("1", "7")))

%o print([a(n) for n in range(1, 45)]) # _Michael S. Branicky_, Apr 07 2021

%Y Prime terms are in A020465.

%Y 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 nonn,base

%O 1,1

%A _Jaroslav Krizek_, Apr 07 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 21:22 EDT 2024. Contains 371767 sequences. (Running on oeis4.)