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.

A032925 Numbers whose set of base-4 digits is a subset of {1,2}.

Original entry on oeis.org

1, 2, 5, 6, 9, 10, 21, 22, 25, 26, 37, 38, 41, 42, 85, 86, 89, 90, 101, 102, 105, 106, 149, 150, 153, 154, 165, 166, 169, 170, 341, 342, 345, 346, 357, 358, 361, 362, 405, 406, 409, 410, 421, 422, 425, 426, 597, 598, 601, 602, 613, 614, 617, 618, 661, 662, 665
Offset: 1

Views

Author

Keywords

Comments

Intersection of A023705 and A023717; A179888 is the intersection of this sequence and A053754. - Reinhard Zumkeller, Jul 31 2010

Crossrefs

Programs

  • C
    #include 
    uint32_t a_next(uint32_t a_n) {
        uint32_t t = (a_n + 0x55555556) ^ 0x55555555;
        return (a_n - t) & t;
    } /* Falk Hüffner, Jan 22 2022 */
  • Haskell
    import Data.List (transpose)
    a032925 n = a032925_list !! (n-1)
    a032925_list = 1 : 2 : (concat $ transpose [map (+ 1) fs, map (+ 2) fs])
                   where fs = map (* 4) a032925_list
    -- Reinhard Zumkeller, Apr 18 2015
    
  • Magma
    [n: n in [1..1000] | Set(IntegerToSequence(n, 4)) subset {1, 2}]; // Vincenzo Librandi, Jun 05 2012
    
  • Maple
    A032925 := proc(n)
        option remember;
        if n <= 2 then
            n;
        else
            if type(n,'even') then
                2+4*procname(n/2-1) ;
            else
                1+4*procname(floor(n/2)) ;
            end if;
        end if;
    end proc:
    seq(A032925(n),n=1..100) ;  # R. J. Mathar, Sep 07 2016
  • Mathematica
    Flatten[Table[FromDigits[#,4]&/@Tuples[{1,2},n],{n,5}]] (* Vincenzo Librandi, Jun 05 2012 *)

Formula

a(2n) = 4a(n-1) + 2, a(2n+1) = 4a(n) + 1. - Ralf Stephan, Oct 07 2003, corrected by R. J. Mathar, Sep 07 2016