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.

A024638 n written in fractional base 6/5.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 50, 51, 52, 53, 54, 55, 540, 541, 542, 543, 544, 545, 5430, 5431, 5432, 5433, 5434, 5435, 54320, 54321, 54322, 54323, 54324, 54325, 543210, 543211, 543212, 543213, 543214, 543215, 5432100, 5432101, 5432102, 5432103, 5432104, 5432105, 5432150
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) `if`(n<1, 0, irem(n, 6, 'q')+a(5*q)*10) end:
    seq(a(n), n=0..45);  # Alois P. Heinz, Aug 19 2019
  • Mathematica
    a[n_]:= If[n==0, 0, 10*a[5*Floor[n/6]] + Mod[n, 6]]; Table[a[n], {n, 0, 50}] (* G. C. Greubel, Aug 19 2019 *)
  • PARI
    a(n) = {if(n<1, 0, a(n\6 * 5) * 10 + n%6)}; \\ Andrew Howroyd, Aug 19 2019
  • Sage
    def basepqExpansion(p, q, n):
        L, i = [n], 1
        while L[i-1] >= p:
            x = L[i-1]
            L[i-1] = x.mod(p)
            L.append(q*floor(x/p))
            i += 1
        L.reverse()
        return Integer(''.join(map(str, L)))
    [basepqExpansion(6,5,i) for i in [0..50]] # Tom Edgar, Hailey R. Olafson, and James Van Alstine, Jul 18 2014; modified and corrected by Peter Luschny, Aug 19 2019
    

Formula

To represent a number in base b, if a digit exceeds b, subtract b and carry 1. In fractional base a/b, subtract a and carry b.

Extensions

Terms a(42) and beyond from Andrew Howroyd, Aug 19 2019