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

This page as a plain text file.
%I A032925 #40 Jul 28 2025 20:52:38
%S A032925 1,2,5,6,9,10,21,22,25,26,37,38,41,42,85,86,89,90,101,102,105,106,149,
%T A032925 150,153,154,165,166,169,170,341,342,345,346,357,358,361,362,405,406,
%U A032925 409,410,421,422,425,426,597,598,601,602,613,614,617,618,661,662,665
%N A032925 Numbers whose set of base-4 digits is a subset of {1,2}.
%C A032925 Intersection of A023705 and A023717; A179888 is the intersection of this sequence and A053754. - _Reinhard Zumkeller_, Jul 31 2010
%H A032925 R. Zumkeller, <a href="/A032925/b032925.txt">Table of n, a(n) for n = 1..1000</a>
%F A032925 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
%p A032925 A032925 := proc(n)
%p A032925     option remember;
%p A032925     if n <= 2 then
%p A032925         n;
%p A032925     else
%p A032925         if type(n,'even') then
%p A032925             2+4*procname(n/2-1) ;
%p A032925         else
%p A032925             1+4*procname(floor(n/2)) ;
%p A032925         end if;
%p A032925     end if;
%p A032925 end proc:
%p A032925 seq(A032925(n),n=1..100) ;  # _R. J. Mathar_, Sep 07 2016
%t A032925 Flatten[Table[FromDigits[#,4]&/@Tuples[{1,2},n],{n,5}]] (* _Vincenzo Librandi_, Jun 05 2012 *)
%o A032925 (Magma) [n: n in [1..1000] | Set(IntegerToSequence(n, 4)) subset {1, 2}]; // _Vincenzo Librandi_, Jun 05 2012
%o A032925 (Haskell)
%o A032925 import Data.List (transpose)
%o A032925 a032925 n = a032925_list !! (n-1)
%o A032925 a032925_list = 1 : 2 : (concat $ transpose [map (+ 1) fs, map (+ 2) fs])
%o A032925                where fs = map (* 4) a032925_list
%o A032925 -- _Reinhard Zumkeller_, Apr 18 2015
%o A032925 (C)
%o A032925 #include <stdint.h>
%o A032925 uint32_t a_next(uint32_t a_n) {
%o A032925     uint32_t t = (a_n + 0x55555556) ^ 0x55555555;
%o A032925     return (a_n - t) & t;
%o A032925 } /* _Falk Hüffner_, Jan 22 2022 */
%Y A032925 Cf. A023705, A023717, A179888, A053754.
%K A032925 nonn,base,easy
%O A032925 1,2
%A A032925 _Clark Kimberling_