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.

A284972 Numbers with digits 4 and 8 only.

Original entry on oeis.org

4, 8, 44, 48, 84, 88, 444, 448, 484, 488, 844, 848, 884, 888, 4444, 4448, 4484, 4488, 4844, 4848, 4884, 4888, 8444, 8448, 8484, 8488, 8844, 8848, 8884, 8888, 44444, 44448, 44484, 44488, 44844, 44848, 44884, 44888, 48444, 48448, 48484, 48488, 48844, 48848
Offset: 1

Views

Author

Jaroslav Krizek, Apr 07 2017

Keywords

Comments

All terms are even.

Crossrefs

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).

Programs

  • Magma
    [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {4, 8}]
    
  • Mathematica
    Flatten@ Table[FromDigits /@ Tuples[{4, 8}, n], {n, 5}] (* Giovanni Resta, Apr 07 2017 *)
  • 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
    
  • 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
    
  • 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

Formula

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