A060153 Duplicate of A055010.
0, 2, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 98303
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.
Binary: 1, 100, 1010, 10110, 101110, 1011110, 10111110, 101111110, 1011111110, 10111111110, 101111111110, 1011111111110, 10111111111110, G.f. = 1 + 4*x + 10*x^2 + 22*x^3 + 46*x^4 + 94*x^5 + 190*x^6 + 382*x^7 + ...
List([0..35], n-> 3*2^n -2); # G. C. Greubel, Nov 18 2019
a033484 = (subtract 2) . (* 3) . (2 ^) a033484_list = iterate ((subtract 2) . (* 2) . (+ 2)) 1 -- Reinhard Zumkeller, Apr 23 2013
[3*2^n-2: n in [1..36]]; // Vincenzo Librandi, Nov 22 2010
with(combinat):a:=n->stirling2(n,2)+stirling2(n+1,2): seq(a(n), n=1..35); # Zerinvary Lajos, Oct 07 2007 a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=(a[n-1]+1)*2 od: seq(a[n], n=1..35); # Zerinvary Lajos, Feb 22 2008
Table[3 2^n - 2, {n, 0, 35}] (* Vladimir Joseph Stephan Orlovsky, Dec 16 2008 *) (* Start from Eric W. Weisstein, Sep 21 2017 *) 3*2^Range[0, 35] - 2 LinearRecurrence[{3, -2}, {1, 4}, 36] CoefficientList[Series[(1+x)/(1-3x+2x^2), {x, 0, 35}], x] (* End *)
a(n) = 3<Charles R Greathouse IV, Nov 02 2011
[3*2^n -2 for n in (0..35)] # G. C. Greubel, Nov 18 2019
a(0) = (3*2^0 - 2 + 0^0)/2 = 2/2 = 1 (use 0^0=1).
a083329 n = a083329_list !! n a083329_list = 1 : iterate ((+ 1) . (* 2)) 2 -- Reinhard Zumkeller, Dec 26 2012, Feb 22 2012
[1] cat [3*2^(n-1)-1: n in [1..40]]; // Vincenzo Librandi, Jan 01 2016
seq(ceil((2^i+2^(i+1)-2)/2), i=0..31); # Zerinvary Lajos, Oct 02 2007
a[1] = 2; a[n_] := 2a[n - 1] + 1; Table[ a[n], {n, 31}] (* Robert G. Wilson v, May 04 2004 *) Join[{1}, LinearRecurrence[{3, -2}, {2, 5}, 40]] (* Vincenzo Librandi, Jan 01 2016 *)
a(n)=(3*2^n-2+0^n)/2 \\ Charles R Greathouse IV, Sep 24 2015
G.f. = 1 + 2*x + 3*x^2 + 5*x^3 + 7*x^4 + 11*x^5 + 15*x^6 + 23*x^7 + ... - _Michael Somos_, Jun 24 2018
List([0..45], n-> ((5-(-1)^n)/2)*2^((2*n-1+(-1)^n)/4)-1); # G. C. Greubel, Oct 22 2019
a052955 n = a052955_list !! n a052955_list = 1 : 2 : map ((+ 1) . (* 2)) a052955_list -- Reinhard Zumkeller, Feb 22 2012
[((5-(-1)^n)/2)*2^((2*n-1+(-1)^n)/4)-1: n in [0..45]]; // G. C. Greubel, Oct 22 2019
spec := [S,{S=Prod(Sequence(Prod(Union(Z,Z),Z)),Union(Sequence(Z),Z))}, unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20); a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=2*a[n-2]+2 od: seq(a[n]/2, n=2..43); # Zerinvary Lajos, Mar 16 2008
a[n_]:= If[EvenQ[n], 2^(n/2+1) -1, 3*2^((n-1)/2) -1]; Table[a[n], {n, 0, 41}] (* Robert G. Wilson v, Jun 05 2004 *) a[0]=1; a[1]=2; a[n_]:= a[n]= 2 a[n-2] +1; Array[a, 42, 0] a[n_]:= (2 + Mod[n, 2]) 2^Quotient[n, 2] - 1; (* Michael Somos, Jun 24 2018 *)
a(n)=(2+n%2)<<(n\2)-1 \\ Charles R Greathouse IV, Jun 19 2011
{a(n) = (n%2 + 2) * 2^(n\2) - 1}; /* Michael Somos, Jun 24 2018 */
# command line argument tells how high to take n # Beyond a(38) = 786431 you may need a special code to handle large integers $lim = shift; sub show{}; $n = $incr = $P = 1; show($n, $incr, $P); $incr = 1; for $n (2..$lim) { $P += $incr; show($n, $P, $incr, $P); $incr *=2 if ($n % 2); # double the increment after an odd n } sub show { my($n, $P) = @_; printf("%4d\t%16g\n", $n, $P); } # Mark A. Mandel (thnidu aT g ma(il) doT c0m), Dec 29 2010
def A052955(n): return ((2|n&1)<<(n>>1))-1 # Chai Wah Wu, Jul 13 2023
[((5-(-1)^n)/2)*2^((2*n-1+(-1)^n)/4)-1 for n in (0..45)] # G. C. Greubel, Oct 22 2019
From _Tilman Piesk_, May 09 2012: (Start) This may also be viewed as a triangle: In binary: 0 0 1 2 01 10 3 5 6 011 101 110 7 11 13 14 0111 1011 1101 1110 15 23 27 29 30 01111 10111 11011 11101 11110 31 47 55 59 61 62 63 95 111 119 123 125 126 Left three diagonals are A000225, A055010, A086224. Right diagonal is A000918. Central column is A129868. Numbers in row n (counted from 0) have n binary 1s. (End) From _Gus Wiseman_, May 24 2024: (Start) The terms together with their binary expansions and binary indices begin: 0: 0 ~ {} 1: 1 ~ {1} 2: 10 ~ {2} 3: 11 ~ {1,2} 5: 101 ~ {1,3} 6: 110 ~ {2,3} 7: 111 ~ {1,2,3} 11: 1011 ~ {1,2,4} 13: 1101 ~ {1,3,4} 14: 1110 ~ {2,3,4} 15: 1111 ~ {1,2,3,4} 23: 10111 ~ {1,2,3,5} 27: 11011 ~ {1,2,4,5} 29: 11101 ~ {1,3,4,5} 30: 11110 ~ {2,3,4,5} 31: 11111 ~ {1,2,3,4,5} 47: 101111 ~ {1,2,3,4,6} 55: 110111 ~ {1,2,3,5,6} 59: 111011 ~ {1,2,4,5,6} 61: 111101 ~ {1,3,4,5,6} 62: 111110 ~ {2,3,4,5,6} (End)
a089633 n = a089633_list !! (n-1) a089633_list = [2 ^ t - 2 ^ k - 1 | t <- [1..], k <- [t-1,t-2..0]] -- Reinhard Zumkeller, Feb 23 2012
seq(seq(2^a-1-2^b,b=a-1..0,-1),a=1..11); # Robert Israel, Dec 14 2018
fQ[n_] := DigitCount[n, 2, 0] < 2; Select[ Range[0, 2^10], fQ] (* Robert G. Wilson v, Aug 02 2012 *)
{insq(n) = local(dd, hf, v); v=binary(n);hf=length(v);dd=sum(i=1,hf,v[i]);if(dd<=hf-2,-1,1)} {for(w=0,1536,if(insq(w)>=0,print1(w,", ")))} \\ Douglas Latimer, May 07 2013
isoka(n) = #select(x->(x==0), binary(n)) <= 1; \\ Michel Marcus, Dec 14 2018
from itertools import count, islice def A089633_gen(): # generator of terms return ((1<A089633_list = list(islice(A089633_gen(),30)) # Chai Wah Wu, Feb 10 2023
from math import isqrt, comb def A089633(n): return (1<<(a:=(isqrt((n<<3)+1)-1>>1)+1))-(1<Chai Wah Wu, Dec 19 2024
a(6)=9 since 6 has two one-bits (i.e., 6=2+4) and 9 is the next higher integer of binary weight two (7 is weight three and 8 is weight one).
a057168 n = a057168_list !! (n-1) a057168_list = f 2 $ tail a000120_list where f x (z:zs) = (x + length (takeWhile (/= z) zs)) : f (x + 1) zs -- Reinhard Zumkeller, Aug 26 2012
a[n_] := (bw = DigitCount[n, 2, 1]; k = n+1; While[ DigitCount[k, 2, 1] != bw, k++]; k); Table[a[n], {n, 1, 71}](* Jean-François Alcover, Nov 28 2011 *)
a(n)=my(u=bitand(n,-n),v=u+n);(bitxor(v,n)/u)>>2+v \\ Charles R Greathouse IV, Oct 28 2009
A057168(n)=n+bitxor(n,n+n=bitand(n,-n))\n\4+n \\ M. F. Hasler, Aug 27 2014
def a(n): u = n&-n; v = u+n; return (((v^n)//u)>>2)+v print([a(n) for n in range(1, 72)]) # Michael S. Branicky, Jul 10 2022 after Charles R Greathouse IV
def A057168(n): return ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b # Chai Wah Wu, Mar 06 2025
[ &+[ k: k in [2^n..2^(n+1)-1] ]: n in [0..21] ]; // Klaus Brockhaus, Nov 27 2009
[2^n *(2^n+(2^(n+1)-1))/2: n in [0..25]]; // Vincenzo Librandi, Sep 11 2015
f:= n-> 3*2^(2*n-1)-2^(n-1): seq(f(n), n=0..30);
Table[2^n (2^n+(2^(n+1)-1))/2,{n,0,25}] (* or *) LinearRecurrence[{6,-8},{1,5},30] (* Harvey P. Dale, Jan 23 2012 *) With[{nn=30},Total/@TakeList[Range[2^(nn+1)-1],2^Range[0,nn]]] (* Harvey P. Dale, May 26 2024 *)
a(n)=3<<(2*n-1)-1<<(n-1) \\ Charles R Greathouse IV, Jul 02 2013
[3*2^n-1: n in [0..30]]; // Vincenzo Librandi, Oct 28 2011
Table[3*2^n - 1 , {n,0,25}] (* G. C. Greubel, Sep 01 2016 *) LinearRecurrence[{3,-2},{2,5},40] (* Harvey P. Dale, Mar 01 2024 *)
a(n)=3*2^n-1 \\ Charles R Greathouse IV, Sep 24 2015
Block[{a = {1, 2}}, Do[AppendTo[a, If[EvenQ[i], Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[a[[i/2 + 1]], 2], If[# == 1, 1, Function[{n, c}, SelectFirst[Range[n + 1, n^2], Times @@ FactorInteger[#][[All, 1]] == c &]] @@ {#, Times @@ FactorInteger[#][[All, 1]]}] &[a[[(i - 1)/2 + 1]] ] ]], {i, 2, 70}]; a] (* Michael De Vlieger, Mar 12 2021 *)
A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler A007947(n) = factorback(factorint(n)[, 1]); \\ From Andrew Lelechenko, May 09 2014 A065642(n) = { my(r=A007947(n)); if(1==n,n,n = n+r; while(A007947(n) <> r, n = n+r); n); }; A285332(n) = { if(n<=1,n+1,if(!(n%2),A019565(A285332(n/2)),A065642(A285332((n-1)/2)))); }; for(n=0, 4095, write("b285332.txt", n, " ", A285332(n)));
from operator import mul from sympy import prime, primefactors def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n)) def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # This function from Chai Wah Wu def a065642(n): if n==1: return 1 r=a007947(n) n = n + r while a007947(n)!=r: n+=r return n def a(n): if n<2: return n + 1 if n%2==0: return a019565(a(n//2)) else: return a065642(a((n - 1)//2)) print([a(n) for n in range(51)]) # Indranil Ghosh, Apr 18 2017
;; With memoization-macro definec. (definec (A285332 n) (cond ((<= n 1) (+ n 1)) ((even? n) (A019565 (A285332 (/ n 2)))) (else (A065642 (A285332 (/ (- n 1) 2))))))
Comments