A085406 Duplicate of A022340.
0, 2, 4, 8, 10, 16, 18, 20, 32, 34, 36, 40, 42, 64, 66, 68, 72, 74, 80, 82, 84, 128, 130, 132
Offset: 0
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.
From _Joerg Arndt_, Jun 11 2011: (Start) In the following, dots are used for zeros in the binary representation: a(n) binary(a(n)) n 0: ....... 0 1: ......1 1 2: .....1. 2 4: ....1.. 3 5: ....1.1 4 8: ...1... 5 9: ...1..1 6 10: ...1.1. 7 16: ..1.... 8 17: ..1...1 9 18: ..1..1. 10 20: ..1.1.. 11 21: ..1.1.1 12 32: .1..... 13 33: .1....1 14 34: .1...1. 15 36: .1..1.. 16 37: .1..1.1 17 40: .1.1... 18 41: .1.1..1 19 42: .1.1.1. 20 64: 1...... 21 65: 1.....1 22 (End)
import Data.Set (Set, singleton, insert, deleteFindMin) a003714 n = a003714_list !! n a003714_list = 0 : f (singleton 1) where f :: Set Integer -> [Integer] f s = m : (f $ insert (4*m + 1) $ insert (2*m) s') where (m, s') = deleteFindMin s -- Reinhard Zumkeller, Jun 03 2012, Feb 07 2012
A003714 := proc(n) option remember; if n < 3 then n ; else 2^(A072649(n)-1) + procname(n-combinat[fibonacci](1+A072649(n))) ; end if; end proc: seq(A003714(n),n=0..10) ; # To produce a table giving n, a(n) (base 10), a(n) (base 2) - from N. J. A. Sloane, Sep 30 2018 # binary: binary representation of n, in human order binary:=proc(n) local t1,L; if n<0 then ERROR("n must be nonnegative"); fi; if n=0 then return([0]); fi; t1:=convert(n,base,2); L:=nops(t1); [seq(t1[L+1-i],i=1..L)]; end; for n from 0 to 100 do t1:=A003714(n); lprint(n, t1, binary(t1)); od:
fibBin[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k--]; FromDigits[fr, 2]]; Table[fibBin[n], {n, 0, 61}] (* Robert G. Wilson v, Sep 18 2004 *) Select[Range[0, 270], ! MemberQ[Partition[IntegerDigits[#, 2], 2, 1], {1, 1}] &] (* Harvey P. Dale, Jul 17 2011 *) Select[Range[256], BitAnd[#, 2 #] == 0 &] (* Alonso del Arte, Jun 18 2012 *) With[{r = Range[10^5]}, Pick[r, BitAnd[r, 2 r], 0]] (* Eric W. Weisstein, Aug 18 2017 *) Select[Range[0, 299], SequenceCount[IntegerDigits[#, 2], {1, 1}] == 0 &] (* Requires Mathematica version 10 or later. -- Harvey P. Dale, Dec 06 2018 *)
msb(n)=my(k=1); while(k<=n, k<<=1); k>>1 for(n=1,1e4,k=bitand(n,n<<1);if(k,n=bitor(n,msb(k)-1),print1(n", "))) \\ Charles R Greathouse IV, Jun 15 2011
select( is_A003714(n)=!bitand(n,n>>1), [0..266]) {(next_A003714(n,t)=while(t=bitand(n+=1,n<<1), n=bitor(n,1<A003714(t)) \\ M. F. Hasler, Nov 30 2021
for n in range(300): if 2*n & n == 0: print(n, end=",") # Alex Ratushnyak, Jun 21 2012
def A003714(n): tlist, s = [1,2], 0 while tlist[-1]+tlist[-2] <= n: tlist.append(tlist[-1]+tlist[-2]) for d in tlist[::-1]: s *= 2 if d <= n: s += 1 n -= d return s # Chai Wah Wu, Jun 14 2018
def fibbinary(): x = 0 while True: yield x y = ~(x >> 1) x = (x - y) & y # Falk Hüffner, Oct 23 2021 (C++) /* start with x=0, then repeatedly call x=next_fibrep(x): */ ulong next_fibrep(ulong x) { // 2 examples: // ex. 1 // ex.2 // // x == [*]0 010101 // x == [*]0 01010 ulong y = x | (x>>1); // y == [*]? 011111 // y == [*]? 01111 ulong z = y + 1; // z == [*]? 100000 // z == [*]? 10000 z = z & -z; // z == [0]0 100000 // z == [0]0 10000 x ^= z; // x == [*]0 110101 // x == [*]0 11010 x &= ~(z-1); // x == [*]0 100000 // x == [*]0 10000 return x; } /* Joerg Arndt, Jun 22 2012 */
(0 to 255).filter(n => (n & 2 * n) == 0) // Alonso del Arte, Apr 12 2020 (C#) public static bool IsFibbinaryNum(this int n) => ((n & (n >> 1)) == 0) ? true : false; // Frank Hollstein, Jul 07 2021
The 100th composition in standard order is (1,3,3), so a(100) = 3.
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[If[n==0,0,Max@@stc[n]],{n,0,100}]
The 148th composition in standard order is (3,2,3), so a(148) = 2.
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[If[n==0,0,Min@@stc[n]],{n,0,100}]
F:= combinat[fibonacci]: b:= proc(n) local j; if n=0 then 0 else for j from 2 while F(j+1)<=n do od; b(n-F(j))+2^(j-2) fi end: a:= n-> 2*b(n)+1: seq(a(n), n=0..70); # Alois P. Heinz, Aug 03 2012
Select[Table[Mod[Binomial[3*k,k], k+1], {k,1200}], #>0&]
After the first 6 we see "1 2 3 1 4 1 2" then 7.
a035612 = a007814 . a022340 -- Reinhard Zumkeller, Jul 20 2015, Mar 10 2013
f[1] = {1}; f[2] = {1, 2}; f[n_] := f[n] = Join[f[n-1], Most[f[n-2]], {n}]; f[11] (* Jean-François Alcover, Feb 22 2012 *)
a:= n-> Bits[Xor](n, max(1, (numtheory[divisors](n) minus {n})[])): seq(a(n), n=1..100); # Alois P. Heinz, May 15 2016
a[1] = 0; a[n_] := BitXor[n, Divisors[n][[-2]]]; Array[a, 100] (* Jean-François Alcover, Mar 12 2019 *)
gpd(n) = if(n==1, 1, n/factor(n)[1, 1]); \\ A032742 a(n) = bitxor(n, gpd(n)); \\ Michel Marcus, Mar 12 2019
The terms, binary expansions, and standard compositions: 1: 1 (1) 3: 11 (1,1) 5: 101 (2,1) 6: 110 (1,2) 7: 111 (1,1,1) 9: 1001 (3,1) 11: 1011 (2,1,1) 12: 1100 (1,3) 13: 1101 (1,2,1) 14: 1110 (1,1,2) 15: 1111 (1,1,1,1) 17: 10001 (4,1) 19: 10011 (3,1,1) 21: 10101 (2,2,1) 22: 10110 (2,1,2) 23: 10111 (2,1,1,1) 24: 11000 (1,4) 25: 11001 (1,3,1) 26: 11010 (1,2,2) 27: 11011 (1,2,1,1) 28: 11100 (1,1,3) 29: 11101 (1,1,2,1) 30: 11110 (1,1,1,2) 31: 11111 (1,1,1,1,1)
F:= combinat[fibonacci]: b:= proc(n) local j; if n=0 then 0 else for j from 2 while F(j+1)<=n do od; b(n-F(j))+2^(j-2) fi end: a:= n-> 4*b(n)+1: seq(a(n), n=0..70); # Alois P. Heinz, May 15 2016
Select[Range[1, 511, 2], BitAnd[#, 2#] == 0 &] (* Alonso del Arte, Jun 18 2012 *)
for n in range(1, 700, 2): if n*2 & n == 0: print(n, end=',')
def A022341(n): tlist, s = [1,2], 0 while tlist[-1]+tlist[-2] <= n: tlist.append(tlist[-1]+tlist[-2]) for d in tlist[::-1]: if d <= n: s += 1 n -= d s <<= 1 return (s<<1)|1 # Chai Wah Wu, Apr 24 2025
(1 to 511 by 2).filter(n => (n & 2 * n) == 0) // Alonso del Arte, Apr 12 2020 (C#) public static bool IsOddFibbinaryNum(this int n) => ((n & (n >> 1)) == 0) && (n % 2 == 1) ? true : false; // Frank Hollstein, Jul 07 2021
The a(5) = 2 through a(12) = 14 compositions (empty column indicated by dot): (2,3) . (2,5) (3,5) (2,7) (3,7) (2,9) (5,7) (3,2) (3,4) (5,3) (4,5) (7,3) (3,8) (7,5) (4,3) (5,4) (2,3,5) (4,7) (2,3,7) (5,2) (7,2) (2,5,3) (5,6) (2,7,3) (3,2,5) (6,5) (3,2,7) (3,5,2) (7,4) (3,4,5) (5,2,3) (8,3) (3,5,4) (5,3,2) (9,2) (3,7,2) (4,3,5) (4,5,3) (5,3,4) (5,4,3) (7,2,3) (7,3,2)
Table[Length[Join@@Permutations/@Select[IntegerPartitions[n],!MemberQ[#,1]&&CoprimeQ@@#&]],{n,0,30}]
Comments