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.

Previous Showing 11-20 of 27 results. Next

A004742 Numbers whose binary expansion does not contain 101.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 12, 14, 15, 16, 17, 18, 19, 24, 25, 28, 30, 31, 32, 33, 34, 35, 36, 38, 39, 48, 49, 50, 51, 56, 57, 60, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 76, 78, 79, 96, 97, 98, 99, 100, 102, 103, 112, 113, 114, 115, 120, 121, 124, 126, 127
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007088; A003796 (no 000), A004745 (no 001), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004743 (no 110), A003726 (no 111).

Programs

  • Haskell
    a004742 n = a004742_list !! (n-1)
    a004742_list = filter f [0..] where
       f x  = x < 4 || x `mod` 8 /= 5 && f (x `div` 2)
    -- Reinhard Zumkeller, Jul 01 2013
  • Mathematica
    Select[Range[0, 130], !StringContainsQ[IntegerString[#, 2], "101"] &] (* Amiram Eldar, Feb 13 2022 *)
  • PARI
    is(n)=n=binary(n);for(i=3,#n,if(n[i]&&n[i-2]&&!n[i-1],return(0))); 1 \\ Charles R Greathouse IV, Mar 26 2013
    
  • PARI
    is(n)=while(n>4, if(bitand(n,7)==5, return(0)); n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017
    
  • PARI
    is(n)=!bitand(bitand(n,n>>2),bitneg(n>>1)) \\ Charles R Greathouse IV, Oct 28 2021
    
  • PARI
    searchLE(S,x)=my(t=setsearch(S,x)); if(t,t,setsearch(S,x,1)-1); \\ finds last element <= x
    expand(~v, lim)=my(b=exponent(v[#v]+1), B=1<lim, listpop(~v));
    list(lim)=lim\=1; if(lim<5, return(if(lim<0,[],[0..lim]))); my(v=List([0..3])); for(b=3,exponent(lim+1), expand(~v, 2^b-1)); expand(~v, lim); Vec(v)
    

Formula

Sum_{n>=2} 1/a(n) = 6.198475910942069028389983717965787117743378665090593775808705963863146498248... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A004743 Numbers whose binary expansion does not contain 110.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 23, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 47, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 79, 80, 81, 82, 83, 84, 85, 87, 95, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007088; A003796 (no 000), A004745 (no 001), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004742 (no 101), A003726 (no 111).

Programs

  • Haskell
    a004743 n = a004743_list !! (n-1)
    a004743_list = filter f [0..] where
       f x  = x < 4 || x `mod` 8 /= 6 && f (x `div` 2)
    -- Reinhard Zumkeller, Jul 01 2013
  • Mathematica
    Select[Range[0, 140], !StringContainsQ[IntegerString[#, 2], "110"] &] (* Amiram Eldar, Feb 13 2022 *)
    Select[Range[0,150],SequenceCount[IntegerDigits[#,2],{1,1,0}]==0&] (* Harvey P. Dale, Mar 14 2025 *)
  • PARI
    is(n)=n=binary(n);for(i=3,#n,if(!n[i]&&n[i-2]&&n[i-1],return(0))); 1 \\ Charles R Greathouse IV, Mar 26 2013
    
  • PARI
    is(n)=while(n>5, if(bitand(n,7)==6, return(0)); n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017
    

Formula

Sum_{n>=2} 1/a(n) = 5.126608057149204485684180689064467269298250594297584060475240185531109866051... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A004744 Numbers whose binary expansion does not contain 011.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 36, 37, 40, 41, 42, 48, 49, 50, 52, 53, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 68, 69, 72, 73, 74, 80, 81, 82, 84, 85, 96, 97, 98, 100, 101, 104, 105
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007088; A003796 (no 000), A004745 (no 001), A004746 (no 010), A003754 (no 100), A004742 (no 101), A004743 (no 110), A003726 (no 111).

Programs

  • Haskell
    a004744 n = a004744_list !! (n-1)
    a004744_list = filter f [0..] where
       f x  = x < 4 || x `mod` 8 /= 3 && f (x `div` 2)
    -- Reinhard Zumkeller, Jul 01 2013
  • Mathematica
    Select[Range[0,110],!MemberQ[Partition[IntegerDigits[#,2],3,1],{0,1,1}]&] (* Harvey P. Dale, Oct 15 2013 *)
  • PARI
    is(n)=n=binary(n);for(i=3,#n,if(n[i]&&n[i-1]&&!n[i-2], return(0)));1 \\ Charles R Greathouse IV, Mar 26 2013
    
  • PARI
    is(n)=while(n>10, if(bitand(n,7)==3, return(0)); n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017
    

Formula

Sum_{n>=2} 1/a(n) = 6.084750966700965350831194838591995529232464122788387705746226526437263331240... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A117546 Number of representations of n as a sum of distinct tribonacci numbers (A000073).

Original entry on oeis.org

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

Views

Author

T. D. Noe and Jonathan Vos Post, Mar 28 2006

Keywords

Comments

It can be shown that, like the Fibonacci numbers, the tribonacci numbers are complete; that is, a(n)>0 for all n. There is always a representation, free of three consecutive tribonacci numbers, which is analogous to the Zeckendorf representation of Fibonacci numbers. See A003726.

Examples

			a(14)=2 because 14 is both 13+1 and 7+4+2+1.
		

Crossrefs

Cf. A000119 (number of representations of n as a sum of distinct Fibonacci numbers).
Cf. A240844.

Programs

  • Haskell
    a117546 = p $ drop 3 a000073_list where
       p _  0     = 1
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
    -- Reinhard Zumkeller, Apr 13 2014
  • Mathematica
    tr={1,2,4,7,13,24,44,81,149}; len=tr[[ -1]]; cnt=Table[0,{len}]; Do[v=IntegerDigits[k,2,Length[tr]]; s=Dot[tr,v]; If[s<=len, cnt[[s]]++ ], {k,2^(Length[tr])-1}]; cnt

Extensions

a(0)=1 added and offset changed by Reinhard Zumkeller, Apr 13 2014

A004745 Numbers whose binary expansion does not contain 001.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 40, 42, 43, 44, 45, 46, 47, 48, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 80, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 104, 106, 107, 108, 109, 110
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007088; A003796 (no 000), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004742 (no 101), A004743 (no 110), A003726 (no 111).

Programs

  • Haskell
    a004745 n = a004745_list !! (n-1)
    a004745_list = filter f [0..] where
       f x  = x < 4 || x `mod` 8 /= 1 && f (x `div` 2)
    -- Reinhard Zumkeller, Jul 01 2013
  • Mathematica
    Select[Range[0, 110], ! StringContainsQ[IntegerString[#, 2], "001"] &] (* Amiram Eldar, Feb 13 2022 *)
    Select[Range[0,120],SequenceCount[IntegerDigits[#,2],{0,0,1}]==0&] (* Harvey P. Dale, Jul 05 2024 *)
  • PARI
    is(n)=n=binary(n);for(i=4,#n,if(n[i]&&!n[i-1]&&!n[i-2], return(0))); 1 \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    is(n)=while(n>8, if(bitand(n,7)==1, return(0)); n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017
    

Formula

Sum_{n>=2} 1/a(n) = 5.808784664093998434778841785199192904637860758506854276321167162567685504669... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A004746 Numbers whose binary expansion does not contain 010.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 19, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 35, 38, 39, 44, 45, 46, 47, 48, 49, 51, 54, 55, 56, 57, 59, 60, 61, 62, 63, 64, 65, 67, 70, 71, 76, 77, 78, 79, 88, 89, 91, 92, 93, 94, 95, 96, 97, 99, 102
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007088; A003796 (no 000), A004745 (no 001), A004744 (no 011), A003754 (no 100), A004742 (no 101), A004743 (no 110), A003726 (no 111).

Programs

  • Haskell
    a004746 n = a004746_list !! (n-1)
    a004746_list = filter f [0..] where
       f x  = x < 4 || x `mod` 8 /= 2 && f (x `div` 2)
    -- Reinhard Zumkeller, Jul 01 2013
  • Mathematica
    Select[Range[0,110],SequenceCount[IntegerDigits[#,2],{0,1,0}]==0&] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, Oct 19 2015 *)
  • PARI
    is(n)=n=binary(n);for(i=4,#n,if(!n[i]&&n[i-1]&&!n[i-2], return(0))); 1 \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    is(n)=while(n>9, if(bitand(n,7)==2, return(0)); n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017
    

Formula

Sum_{n>=2} 1/a(n) = 7.338340181978485860731253930056466995425939377143636935044890325770833657631... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A004781 Binary expansion contains 3 adjacent 1's.

Original entry on oeis.org

7, 14, 15, 23, 28, 29, 30, 31, 39, 46, 47, 55, 56, 57, 58, 59, 60, 61, 62, 63, 71, 78, 79, 87, 92, 93, 94, 95, 103, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 142, 143, 151, 156, 157, 158, 159, 167
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A003726.

Programs

  • Haskell
    a004781 n = a004781_list !! (n - 1)
    a004781_list = filter f [0..] where
       f x | x < 7     = False
           | otherwise = (x `mod` 8) == 7 || f (x `div` 2)
    -- Reinhard Zumkeller, Jun 03 2012
    
  • Maple
    q:= n-> verify([1$3], Bits[Split](n), 'sublist'):
    select(q, [$0..200])[];  # Alois P. Heinz, Oct 22 2021
  • Mathematica
    Select[Range[200],MemberQ[Partition[IntegerDigits[#,2],3,1], {1,1,1}]&]  (* Harvey P. Dale, Mar 31 2011 *)
    Select[Range[200], StringContainsQ[IntegerString[#, 2], "111"] &] (* Amiram Eldar, Oct 22 2021 *)
    Select[Range[200],SequenceCount[IntegerDigits[#,2],{1,1,1}]>0&] (* Harvey P. Dale, Dec 28 2021 *)
  • PARI
    is(n)=!!bitand(bitand(n,n<<1),n<<2) \\ Charles R Greathouse IV, Sep 24 2012

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 24 2012

Extensions

Offset corrected by Reinhard Zumkeller, Jun 03 2012

A003265 Not representable by truncated tribonacci sequence 2, 4, 7, 13, 24, 44, 81, ....

Original entry on oeis.org

1, 3, 5, 8, 10, 12, 14, 16, 18, 21, 23, 25, 27, 29, 32, 34, 36, 38, 40, 42, 45, 47, 49, 52, 54, 56, 58, 60, 62, 65, 67, 69, 71, 73, 76, 78, 80, 82, 84, 86, 89, 91, 93, 95, 97, 99, 102, 104, 106, 108, 110, 113, 115, 117, 119, 121, 123
Offset: 1

Views

Author

Keywords

Comments

The usual tribonacci representation of n writes n as a sum of tribonacci numbers 1, 2, 4, 7, 13, 24, ... (A000073) avoiding using three consecutive numbers (see A003726, A278038). But if we are not allowed to use 1, then some numbers cannot be represented, and such numbers are listed here. - N. J. A. Sloane, Oct 08 2018
Indices of odd terms of A003726. - Charlie Neder, Apr 25 2019
Numbers whose tribonacci representation ends in 1. Equivalently, the first column of the Trithoff (tribonacci) array, see A136175. - Tanya Khovanova and PRIMES STEP Senior group, May 07 2022

References

  • A. Brousseau, Fibonacci and Related Number Theoretic Tables. Fibonacci Association, San Jose, CA, 1972, p. 65.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Extensions

Edited by N. J. A. Sloane, Oct 08 2018
a(47)-a(57) from Charlie Neder, Apr 25 2019

A356964 Replace 2^k in binary expansion of n with tribonacci(k+3) (where tribonacci corresponds to A000073).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 26, 27, 24, 25, 26, 27, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 37, 38, 39, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 51, 44, 45, 46, 47
Offset: 0

Views

Author

Rémy Sigrist, Sep 06 2022

Keywords

Comments

This sequence is to tribonacci numbers (A000073) what A022290 is to Fibonacci numbers (A000045).
For any k >= 0, k appears A117546(k) times in this sequence.

Examples

			For n = 9:
- 9 = 2^3 + 2^0,
- so a(9) = A000073(3+3) + A000073(0+3) = 7 + 1 = 8.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, k); while (n, n-=2^k=valuation(n,2); v+=([0,1,0; 0,0,1; 1,1,1]^(3+k))[2,1]); return (v); }
    
  • Python
    def A356964(n):
        a, b, c, s = 1,2,4,0
        for i in bin(n)[-1:1:-1]:
            s += int(i)*a
            a, b, c = b, c, a+b+c
        return s # Chai Wah Wu, Sep 10 2022

Formula

a(A003726(n+1)) = n.
a(A003796(n+1)) = n.

A305377 Tribonacci representation of primes, written in base 10.

Original entry on oeis.org

2, 3, 5, 8, 12, 16, 20, 22, 27, 37, 40, 48, 52, 54, 67, 74, 82, 84, 91, 99, 101, 108, 130, 137, 147, 152, 154, 162, 164, 169, 194, 198, 205, 209, 256, 258, 265, 273, 277, 288, 294, 297, 309, 320, 324, 326, 341, 358, 363, 365, 387, 394, 396, 409, 419, 426, 434, 436, 515, 520, 522, 534, 554, 560
Offset: 1

Views

Author

N. J. A. Sloane, Jun 12 2018

Keywords

Crossrefs

Equals A003726(prime(n)).

Programs

  • Maple
    L[0]:= [0]: L[1]:= [1]:
    for d from 2 to 15 do
      L[d]:= map(t -> (2*t, `if`(t mod 4 <> 3, 2*t+1,NULL)), L[d-1])
    od:
    A003726:=map(op,[seq(L[i],i=0..15)]):
    seq(A003726[ithprime(i)+1],i=1..numtheory:-pi(nops(A003726)-1)); # Robert Israel, Jun 12 2018
  • Python
    from sympy import prime
    def A305377(n):
        m, tlist, s = prime(n), [1,2,4], 0
        while tlist[-1]+tlist[-2]+tlist[-3] <= m:
            tlist.append(tlist[-1]+tlist[-2]+tlist[-3])
        for d in tlist[::-1]:
            s *= 2
            if d <= m:
                s += 1
                m -= d
        return s # Chai Wah Wu, Jun 12 2018

Extensions

More terms from Robert Israel, Jun 12 2018
Previous Showing 11-20 of 27 results. Next