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.

A030386 Triangle T(n,k): write n in base 4, reverse order of digits.

Original entry on oeis.org

0, 1, 2, 3, 0, 1, 1, 1, 2, 1, 3, 1, 0, 2, 1, 2, 2, 2, 3, 2, 0, 3, 1, 3, 2, 3, 3, 3, 0, 0, 1, 1, 0, 1, 2, 0, 1, 3, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 0, 2, 1, 1, 2, 1, 2, 2, 1, 3, 2, 1, 0, 3, 1, 1, 3, 1, 2, 3, 1, 3, 3, 1, 0, 0, 2, 1, 0, 2, 2, 0, 2, 3, 0, 2, 0, 1, 2
Offset: 0

Views

Author

Keywords

Examples

			Triangle begins:
0
1
2
3
0, 1
1, 1
2, 1
3, 1
0, 2
1, 2
2, 2
3, 2
0, 3
1, 3
2, 3
3, 3
0, 0, 1
1, 0, 1 ... - _Philippe Deléham_, Oct 20 2011
		

Crossrefs

Cf. A030308, A030341, A031235, A030567, A031007, A031045, A031087, A031298 for the base-2 to base-10 analogs.
Cf. A007090.

Programs

  • Haskell
    a030386 n k = a030386_tabf !! n !! k
    a030386_row n = a030386_tabf !! n
    a030386_tabf = iterate succ [0] where
       succ []     = [1]
       succ (3:ts) = 0 : succ ts
       succ (t:ts) = (t + 1) : ts
    -- Reinhard Zumkeller, Sep 18 2015
  • Maple
    A030386_row := n -> op(convert(n, base, 4)):
    seq(A030386_row(n), n=0..36); # Peter Luschny, Nov 28 2017
  • Mathematica
    Flatten[Table[Reverse[IntegerDigits[n,4]],{n,0,50}]] (* Harvey P. Dale, Oct 13 2012 *)
  • PARI
    A030386(n, k=-1)=/*k<0&&error("Flattened sequence not yet implemented.")*/n\4^k%4 \\ Assuming that columns are numbered starting with k=0 as in A030308, A030341, ... \\ M. F. Hasler, Jul 21 2013
    

Extensions

Initial 0 and better name by Philippe Deléham, Oct 20 2011