A112346 Duplicate of A062318.
1, 2, 5, 8, 17, 26, 53, 80, 161, 242, 485, 728, 1457, 2186, 4373, 6560, 13121, 19682
Offset: 1
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.
For n=3, a(3)=S(4,2)=7, a Stirling number of the second kind, since there are 7 ways to partition {a,b,c,d} into 2 nonempty subsets, namely, {a}U{b,c,d}, {b}U{a,c,d}, {c}U{a,b,d}, {d}U{a,b,c}, {a,b}U{c,d}, {a,c}U{b,d}, and {a,d}U{b,c}. - _Dennis P. Walsh_, Mar 29 2011 From _Justin M. Troyka_, Aug 13 2011: (Start) Since a(3) = 7, there are 7 signed permutations of 4 that are equal to the bar of their reverse-complements and avoid {(-2,-1), (-1,+2), (+2,+1)}. These are: (+1,+2,-3,-4), (+1,+3,-2,-4), (+1,-3,+2,-4), (+2,+4,-1,-3), (+3,+4,-1,-2), (-3,+1,-4,+2), (-3,-4,+1,+2). (End) G.f. = x + 3*x^2 + 7*x^3 + 15*x^4 + 31*x^5 + 63*x^6 + 127*x^7 + ... For the Towers of Hanoi problem with 2 disks, the moves are as follows, so a(2) = 3. 12|_|_ -> 2|1|_ -> _|1|2 -> _|_|12 - _Allan Bickle_, Aug 07 2024
a000225 = (subtract 1) . (2 ^) a000225_list = iterate ((+ 1) . (* 2)) 0 -- Reinhard Zumkeller, Mar 20 2012
A000225 := n->2^n-1; [ seq(2^n-1,n=0..50) ]; A000225:=1/(2*z-1)/(z-1); # Simon Plouffe in his 1992 dissertation, sequence starting at a(1)
a[n_] := 2^n - 1; Table[a[n], {n, 0, 30}] (* Stefan Steinerberger, Mar 30 2006 *) Array[2^# - 1 &, 50, 0] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 26 2006 *) NestList[2 # + 1 &, 0, 32] (* Robert G. Wilson v, Feb 28 2011 *) 2^Range[0, 20] - 1 (* Eric W. Weisstein, Jul 17 2017 *) LinearRecurrence[{3, -2}, {1, 3}, 20] (* Eric W. Weisstein, Sep 21 2017 *) CoefficientList[Series[1/(1 - 3 x + 2 x^2), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 21 2017 *)
A000225(n) = 2^n-1 \\ Michael B. Porter, Oct 27 2009
concat(0, Vec(x/((1-2*x)*(1-x)) + O(x^100))) \\ Altug Alkan, Oct 28 2015
def A000225(n): return (1<Chai Wah Wu, Jul 06 2022
def isMersenne(n): return n == sum([(1 - b) << s for (s, b) in enumerate((n+1).bits())]) # Peter Luschny, Sep 01 2019
G.f. = 2*x + 4*x^2 + 6*x^3 + 8*x^4 + 10*x^5 + 12*x^6 + 14*x^7 + 16*x^8 + ...
a005843 = (* 2) a005843_list = [0, 2 ..] -- Reinhard Zumkeller, Feb 11 2012
[ 2*n : n in [0..100]];
A005843 := n->2*n; A005843:=2/(z-1)**2; # Simon Plouffe in his 1992 dissertation
Range[0,120,2] (* Harvey P. Dale, Aug 16 2011 *)
A005843(n) = 2*n
def a(n): return 2*n # Martin Gergov, Oct 20 2022
seq(0,200,2)
G.f. = 1 + 2*x + 5*x^2 + 10*x^3 + 17*x^4 + 26*x^5 + 37*x^6 + 50*x^7 + 65*x^8 + ...
a002522 = (+ 1) . (^ 2) a002522_list = scanl (+) 1 [1,3..] -- Reinhard Zumkeller, Apr 06 2012
[n^2 + 1: n in [0..50]]; // Vincenzo Librandi, May 01 2011
A002522 := proc(n) numtheory[cyclotomic](4,n) ; end proc: seq(A002522(n),n=0..20) ; # R. J. Mathar, Feb 07 2014
Table[n^2 + 1, {n, 0, 50}]; (* Vladimir Joseph Stephan Orlovsky, Dec 15 2008 *)
A002522(n):=n^2+1$ makelist(A002522(n),n,0,30); /* Martin Ettl, Nov 07 2012 */
a(n)=n^2+1 \\ Charles R Greathouse IV, Jun 10 2011
a(20) = 2 + 0 + 2 = 4 because 20 is written as 202 base 3. From _Omar E. Pol_, Feb 20 2010: (Start) This can be written as a triangle with row lengths A025192 (see the example in the entry A000120): 0, 1,2, 1,2,3,2,3,4, 1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6, 1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6,3,4,5,4,5,6,5,6,7,2,3,4,3,4,5,4,5,6,3,... where the k-th row contains a(3^k+i) for 0<=i<2*3^k and converges to A173523 as k->infinity. (End) [Changed conjectures to statements in this entry. - _Franklin T. Adams-Watters_, Jul 02 2015] G.f. = x + 2*x^2 + x^3 + 2*x^4 + 3*x^5 + 2*x^6 + 3*x^7 + 4*x^8 + x^9 + 2*x^10 + ...
a053735 = sum . a030341_row -- Reinhard Zumkeller, Feb 21 2013, Feb 19 2012
m=1; for u=0:104; sol(m)=sum(dec2base(u,3)-'0'); m=m+1;end sol; % Marius A. Burtea, Jan 17 2019
[&+Intseq(n,3):n in [0..104]]; // Marius A. Burtea, Jan 17 2019
seq(convert(convert(n,base,3),`+`),n=0..100); # Robert Israel, Jul 02 2015
Table[Plus @@ IntegerDigits[n, 3], {n, 0, 100}] (* or *) Nest[Join[#, # + 1, # + 2] &, {0}, 6] (* Robert G. Wilson v, Jul 27 2006 and modified Jul 27 2014 *)
{a(n) = if( n<1, 0, a(n\3) + n%3)}; /* Michael Somos, Mar 06 2004 */
A053735(n)=sumdigits(n,3) \\ Requires version >= 2.7. Use sum(i=1,#n=digits(n,3),n[i]) in older versions. - M. F. Hasler, Mar 15 2016
(define (A053735 n) (let loop ((n n) (s 0)) (if (zero? n) s (let ((d (mod n 3))) (loop (/ (- n d) 3) (+ s d)))))) ;; For R6RS standard. Use modulo instead of mod in older Schemes like MIT/GNU Scheme. - Antti Karttunen, Jun 03 2017
After 3 folds one sees 4 fold lines. Example: a(3) = 6 because the strings 001, 010, 100, 011, 101, 110 have the property. Binary: 1, 10, 100, 110, 1010, 1110, 10110, 11110, 101110, 111110, 1011110, 1111110, 10111110, 11111110, 101111110, 111111110, 1011111110, 1111111110, 10111111110, ... - _Jason Kimberley_, Nov 02 2011 Example: Partial sums of powers of 2 repeated 2 times: a(3) = 1+1+2 = 4; a(4) = 1+1+2+2 = 6; a(5) = 1+1+2+2+4 = 10. _Yuchun Ji_, Nov 16 2018
import Data.List (transpose) a027383 n = a027383_list !! n a027383_list = concat $ transpose [a033484_list, drop 2 a000918_list] -- Reinhard Zumkeller, Jun 17 2015
[2^Floor((n+2)/2)+2^Floor((n+1)/2)-2: n in [0..50]]; // Vincenzo Librandi, Aug 16 2011
a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=2*a[n-2]+2 od: seq(a[n], n=1..41); # Zerinvary Lajos, Mar 16 2008
a[n_?EvenQ] := 3*2^(n/2)-2; a[n_?OddQ] := 2^(2+(n-1)/2)-2; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 21 2011, after Quim Castellsaguer *) LinearRecurrence[{1, 2, -2}, {1, 2, 4}, 41] (* Robert G. Wilson v, Oct 06 2014 *) Table[Length[Select[Tuples[{0,1},n],And[Max@@Length/@Split[#]<=2,!MatchQ[Length/@Split[#],{_,2,ins:1..,2,_}/;OddQ[Plus[ins]]]]&]],{n,0,15}] (* Gus Wiseman, Nov 28 2019 *)
a(n)=2^(n\2+1)+2^((n+1)\2)-2 \\ Charles R Greathouse IV, Oct 21 2011
def a(n): return 2**((n+2)//2) + 2**((n+1)//2) - 2 print([a(n) for n in range(43)]) # Michael S. Branicky, Feb 19 2022
a051885 n = (m + 1) * 10^n' - 1 where (n',m) = divMod n 9 -- Reinhard Zumkeller, Jul 10 2011
[i*10^j-1: i in [1..9], j in [0..5]];
b:=10; t1:=[]; for j from 0 to 15 do for i from 1 to b-1 do t1:=[op(t1), i*b^j-1]; od: od: t1; # N. J. A. Sloane, Jan 25 2011
a[n_] := (Mod[n, 9] + 1)*10^Floor[n/9] - 1; Table[a[n], {n, 0, 49}](* Jean-François Alcover, Dec 01 2011, after Henry Bottomley *)
A051885(n) = (n%9+1)*10^(n\9)-1 \\ M. F. Hasler, Jun 17 2012
first(n) = Vec(x*(x^2 + x + 1)*(x^6 + x^3 + 1)/((x - 1)*(10*x^9 - 1)) + O(x^n), -n) \\ Iain Fox, Dec 30 2017
def A051885(n): return ((n % 9)+1)*10**(n//9)-1 # Chai Wah Wu, Apr 04 2021
List([0..50], n-> 2*(n^2-n+1)); # G. C. Greubel, Feb 21 2019
[2*(n^2-n+1): n in [0..50]]; // G. C. Greubel, Feb 21 2019
A051890 := n->2*(n^2-n+1); seq(A051890(n) = n=0..50);
Table[2*(n^2-n+1), {n, 0, 50}] (* G. C. Greubel, Jul 14 2017 *) LinearRecurrence[{3,-3,1},{2,2,6},50] (* Harvey P. Dale, Jul 14 2025 *)
a(n)=2*(n^2-n+1) \\ Charles R Greathouse IV, Sep 24 2015
[2*(n^2-n+1) for n in (0..50)] # G. C. Greubel, Feb 21 2019
a(4)=6 because the only 132 and 213-avoiding permutations of {1,2,3,4} without fixed points are: 2341, 3412, 3421, 4123, 4312 and 4321.
[(3/8)*2^n +(1/24)*(-2)^n - 2/3: n in [1..35]]; // Vincenzo Librandi, Aug 13 2011
A061547:=n->ceil(abs((3/8)*2^n +(1/24)*(-2)^n - 2/3)); seq(A061547(n), n=1..30); # Wesley Ivan Hurt, Apr 03 2014
f[n_] := (9*2^(n-3) - (-2)^(n-3) - 2)/3; Array[f, 32] (* Robert G. Wilson v, Aug 13 2011 *)
a(n)=(3/8)*2^n+(1/24)*(-2)^n-2/3 \\ Charles R Greathouse IV, Sep 24 2015
Range[2,100] (* Harvey P. Dale, Aug 31 2015 *) PierceExp[A_, n_] := Join[Array[1 &, Floor[A]], First@Transpose@ NestList[{Floor[1/Expand[1 - #[[1]] #[[2]]]], Expand[1 - #[[1]] #[[2]]]} &, {Floor[1/(A - Floor[A])], A - Floor[A]}, n - 1]]; PierceExp[N[1/E , 7!], 50] (* G. C. Greubel, Nov 14 2016 *)
a(n)=n+1 \\ Charles R Greathouse IV, Aug 23 2011
Comments