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!)
A284972 Numbers with digits 4 and 8 only. 2

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

%S 4,8,44,48,84,88,444,448,484,488,844,848,884,888,4444,4448,4484,4488,

%T 4844,4848,4884,4888,8444,8448,8484,8488,8844,8848,8884,8888,44444,

%U 44448,44484,44488,44844,44848,44884,44888,48444,48448,48484,48488,48844,48848

%N Numbers with digits 4 and 8 only.

%C All terms are even.

%F a(n) = 2 * A284920(n) = 4 * A032822(n).

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

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

%o (PARI) a(n) = my (b = binary(1+n)); b[1] = 0; return (4*(10^(#b-1)-1)/(10-1) + (8-4)*fromdigits(b)) \\ _Rémy Sigrist_, Apr 08 2017

%o (PARI) a(n)={my(v=binary(n+1));v[1]=0;v+=vector(#v,i,i>1);4*fromdigits(v)} \\ _R. J. Cano_, Apr 08 2017

%o (PARI) a(n,{p=[4,8]})={my(v=binary(n+1));fromdigits(vector(#v-1,i,p[2]*v[i+1]+p[1]*!v[i+1]))} \\ _R. J. Cano_, Apr 09 2017

%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), A284971 (k = 7), this sequence (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 September 9 20:10 EDT 2024. Contains 375765 sequences. (Running on oeis4.)