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.

Showing 1-2 of 2 results.

A247648 Numbers whose binary expansion begins and ends with 1 and does not contain two adjacent zeros.

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 15, 21, 23, 27, 29, 31, 43, 45, 47, 53, 55, 59, 61, 63, 85, 87, 91, 93, 95, 107, 109, 111, 117, 119, 123, 125, 127, 171, 173, 175, 181, 183, 187, 189, 191, 213, 215, 219, 221, 223, 235, 237, 239, 245, 247, 251, 253
Offset: 1

Views

Author

N. J. A. Sloane, Sep 25 2014

Keywords

Comments

Decimal equivalents of A247647.
A265716(a(n)) = A265705(2*a(n),a(n)) = 2*a(n). - Reinhard Zumkeller, Dec 15 2015
The viabin numbers of the integer partitions having distinct parts (for the definition of viabin number see comment in A290253). For example, 109 is in the sequence because it is the viabin number of the integer partition [5,4,2]; 121 is not in the sequence because it is the viabin number of the integer partition [5,4,4]. - Emeric Deutsch, Aug 29 2017

Examples

			109 is in the sequence because its binary expansion is 1101101.
		

Crossrefs

Cf. A247875 (complement).

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a247648 n = a247648_list !! (n-1)
    a247648_list = f $ singleton 1 where
       f s = x : f (insert (4 * x + 1) $ insert (2 * x + 1) s')
             where (x, s') = deleteFindMin s
    -- Reinhard Zumkeller, Sep 25 2014
    
  • Maple
    vitopart := proc (n) local L, i, j, N, p, t: N := 2*n: L := ListTools:-Reverse(convert(N, base, 2)): j := 0: for i to nops(L) do if L[i] = 0 then j := j+1: p[j] := numboccur(L[1 .. i], 1) end if end do: sort([seq(p[t], t = 1 .. j)], `>=`) end proc: a := proc (n) if n = 1 then 1 elif `mod`(n, 2) = 0 then a((1/2)*n) elif `mod`(n, 2) = 1 and `mod`((1/2)*n-1/2, 2) = 0 then a((1/2)*n-1/2)+1 else a((1/2)*n-1/2) end if end proc: A := {}: for n to 254 do if a(n) = nops(vitopart(n)) then A := `union`(A, {n}) else end if end do: A; # program is based on my comment; the command vitopart(n) yields the integer partition having viabin number n. # Emeric Deutsch, Aug 29 2017
  • Mathematica
    Select[Range@ 256, And[First@ # == Last@ # == 1, NoneTrue[Map[Length, Select[Split[#], First@ # == 0 &]], # > 1 &]] &@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Aug 29 2017 *)
  • PARI
    isok(k) = if (k%2, my(b=binary(k)); #select(x->(x==0), vector(#b-1, k, b[k]+b[k+1])) == 0); \\ Michel Marcus, Jun 15 2024
  • Python
    A247648_list = [n for n in range(1,10**5) if n % 2 and not '00' in bin(n)]
    # Chai Wah Wu, Sep 25 2014
    

A004753 Numbers whose binary expansion contains 100.

Original entry on oeis.org

4, 8, 9, 12, 16, 17, 18, 19, 20, 24, 25, 28, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 44, 48, 49, 50, 51, 52, 56, 57, 60, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 88, 89, 92, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A003754.
Subsequence of A247875.

Programs

  • Haskell
    a004753 n = a004753_list !! (n-1)
    a004753_list = filter f [0..] where
       f 0 = False; f x = x `mod` 4 == 0 || f (x `div` 2)
    -- Reinhard Zumkeller, Oct 27 2011
    
  • Mathematica
    Select[Range[110],MemberQ[Partition[IntegerDigits[#,2],3,1],{1,0,0}]&] (* Harvey P. Dale, Mar 14 2014 *)
  • PARI
    is(n)=n=binary(n);for(i=3,#n,if(n[i-2]&&!n[i]&&!n[i-1],return(1)));0 \\ Charles R Greathouse IV, Sep 24 2012
    
  • PARI
    is(n)=while(n>3, if(bitand(n,7)==4, return(1)); n>>=1); 0 \\ Charles R Greathouse IV, Feb 11 2017

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 24 2012
Showing 1-2 of 2 results.