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 35 results. Next

A091855 Odious numbers (see A000069) in A003159.

Original entry on oeis.org

1, 4, 7, 11, 13, 16, 19, 21, 25, 28, 31, 35, 37, 41, 44, 47, 49, 52, 55, 59, 61, 64, 67, 69, 73, 76, 79, 81, 84, 87, 91, 93, 97, 100, 103, 107, 109, 112, 115, 117, 121, 124, 127, 131, 133, 137, 140, 143, 145, 148, 151, 155, 157, 161, 164, 167, 171, 173, 176, 179, 181
Offset: 1

Views

Author

Philippe Deléham, Mar 16 2004

Keywords

Comments

Also n such that A033485(n) == 1 (mod 4); see A007413.
Also n such that A029883(n-1) = 1, A036577(n-1) = 2, A036585(n-1) = 3. - Philippe Deléham, Mar 25 2004
The number of odd numbers before the n-th even number in this sequence is a(n). - Philippe Deléham, Mar 27 2004
Numbers n such that {A010060(n-1), A010060(n)}={0,1} where A010060 is the Thue-Morse sequence. - Benoit Cloitre, Jun 16 2006
Positive integers not of the form n+A010060(n). - Jeffrey Shallit, Feb 13 2024

Programs

Formula

a(n) = A003159(2n-1) = A036554(2n-1)/2.
a(n) is asymptotic to 3*n - Benoit Cloitre, Mar 22 2004
A050292(a(n)) = 2n - 1. - Philippe Deléham, Mar 26 2004

Extensions

More terms from Benoit Cloitre, Mar 22 2004

A003156 A self-generating sequence (see Comments for definition).

Original entry on oeis.org

1, 4, 5, 6, 9, 12, 15, 16, 17, 20, 21, 22, 25, 26, 27, 30, 33, 36, 37, 38, 41, 44, 47, 48, 49, 52, 55, 58, 59, 60, 63, 64, 65, 68, 69, 70, 73, 76, 79, 80, 81, 84, 85, 86, 89, 90, 91, 94, 97, 100, 101, 102, 105, 106, 107, 110, 111, 112, 115, 118, 121, 122, 123, 126, 129, 132
Offset: 1

Views

Author

Keywords

Comments

From N. J. A. Sloane, Dec 26 2020: (Start)
The best definitions of the triple [this sequence, A003157, A003158] are as the rows a(n), b(n), c(n) of the table:
n: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...
a: 1, 4, 5, 6, 9, 12, 15, 16, 17, 20, 21, 22, ...
b: 3, 8, 11, 14, 19, 24, 29, 32, 35, 40, 43, 46, ...
c: 2, 7, 10, 13, 18, 23, 28, 31, 34, 39, 42, 45, ...
where a(1)=1, b(1)=3, c(1)=2, and thereafter
a(n) = mex{a(i), b(i), c(i), i
b(n) = a(n) + 2*n,
c(n) = b(n) - 1.
Then a,b,c form a partition of the positive integers.
Note that there is another triple of sequences (A003144, A003145, A003146) also called a, b, c and also a partition of the positive integers, in a different paper by the same authors (Carlitz-Scovelle-Hoggatt) in the same volume of the same journal.
(End)
a(n) is the number of ones before the n-th zero in the Feigenbaum sequence A035263. - Philippe Deléham, Mar 27 2004
Number of odd numbers before the n-th even number in A007413, A007913, A001511, A029883, A033485, A035263, A036585, A065882, A065883, A088172, A092412. - Philippe Deléham, Apr 03 2004
Indices of a in the sequence closed under a -> abc, b -> a, c -> a, starting with a(1) = a; see A092606 where a = 0, b = 2, c = 1. - Philippe Deléham, Apr 12 2004

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

  • Haskell
    following Deléham
    a003156 n = a003156_list !! (n-1)
    a003156_list = scanl1 (+) a080426_list
    -- Reinhard Zumkeller, Oct 27 2014
    
  • Maple
    a:= proc(n) global l; while nops(l) [1, 3$d, 1][], l) od; `if` (n=1, 1, a(n-1) +l[n]) end: l:= [1]: seq (a(n), n=1..80); # Alois P. Heinz, Oct 31 2009
  • Mathematica
    Position[Nest[Flatten[# /. {0 -> {0, 2, 1}, 1 -> {0}, 2 -> {0}}]&, {0}, 7], 0] // Flatten (* Jean-François Alcover, Mar 14 2014 *)
  • Python
    def A003156(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c, s = n+x, bin(x)[2:]
            l = len(s)
            for i in range(l&1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        return bisection(f,n,n)-n # Chai Wah Wu, Jan 29 2025

Formula

a(n) = A079523(n) - n + 1 = A003157(n) - 2n = A003158(n) - 2n + 1. - Philippe Deléham, Feb 28 2004
a(n) = A036554(n) - n = A072939(n) - n - 1 = 2*A003159(n) - n. - Philippe Deléham, Apr 10 2004
a(n) = Sum_{k = 1..n} A080426(k). - Philippe Deléham, Apr 16 2004

Extensions

More terms from Alois P. Heinz, Oct 31 2009
Incorrect equation removed from formula by Peter Munn, Dec 11 2020

A102378 a(n) = a(n-1) + a([n/2]) + 1, a(1) = 1.

Original entry on oeis.org

1, 3, 5, 9, 13, 19, 25, 35, 45, 59, 73, 93, 113, 139, 165, 201, 237, 283, 329, 389, 449, 523, 597, 691, 785, 899, 1013, 1153, 1293, 1459, 1625, 1827, 2029, 2267, 2505, 2789, 3073, 3403, 3733, 4123, 4513, 4963, 5413, 5937, 6461, 7059, 7657, 8349
Offset: 1

Author

Mitch Harris, Jan 05 2005

Keywords

Comments

From Gus Wiseman, Mar 23 2019: (Start)
The offset could safely be changed to zero by setting the boundary condition to a(0) = 0.
Also the number of integer partitions of 2n into powers of 2 with at least one part > 1. The Heinz numbers of these partitions are given by A324927. For example, the a(1) = 1 through a(5) = 13 integer partitions are:
(2) (4) (42) (8) (82)
(22) (222) (44) (442)
(211) (411) (422) (811)
(2211) (2222) (4222)
(21111) (4211) (4411)
(22211) (22222)
(41111) (42211)
(221111) (222211)
(2111111) (421111)
(2221111)
(4111111)
(22111111)
(211111111)
(End)

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],And[Max@@#>1,And@@IntegerQ/@Log[2,#]]&]],{n,0,30,2}] (* Gus Wiseman, Mar 23 2019 *)
  • Python
    from itertools import islice
    from collections import deque
    def A102378_gen(): # generator of terms
        aqueue, f, b, a = deque([2]), True, 1, 2
        yield from (1, 3)
        while True:
            a += b
            yield 2*a - 1
            aqueue.append(a)
            if f: b = aqueue.popleft()
            f = not f
    A102378_list = list(islice(A102378_gen(),40)) # Chai Wah Wu, Jun 08 2022

Formula

a(n) - a(n-1) = A018819(n+1)
G.f. A(x) satisfies (1-x)*A(x) = 2(1 + x)*B(x^2), where B(x) is the gf of A033485
a(n) = A000123(n) - 1. - Gus Wiseman, Mar 23 2019
G.f. A(x) satisfies: A(x) = (x + (1 - x^2) * A(x^2)) / (1 - x)^2. - Ilya Gutkovskiy, Aug 11 2021

A091785 Evil numbers (see A001969) in A003159.

Original entry on oeis.org

3, 5, 9, 12, 15, 17, 20, 23, 27, 29, 33, 36, 39, 43, 45, 48, 51, 53, 57, 60, 63, 65, 68, 71, 75, 77, 80, 83, 85, 89, 92, 95, 99, 101, 105, 108, 111, 113, 116, 119, 123, 125, 129, 132, 135, 139, 141, 144, 147, 149, 153, 156, 159, 163, 165, 169, 172, 175, 177, 180, 183
Offset: 1

Author

Philippe Deléham, Mar 16 2004

Keywords

Comments

Also n such that A033485(n) == 3 (mod 4); see A007413.
Also n such that A029883(n-1) = -1, A036577(n-1) = 0, A036585(n-1) = 1. - Philippe Deléham, Mar 25 2004
The number of odd numbers before the n-th even number in this sequence is a(n). - Philippe Deléham, Mar 27 2004
Numbers n such that {A010060(n-1), A010060(n)}={1,0} where A010060 is the Thue-Morse sequence. - Benoit Cloitre, Jun 16 2006

Programs

Formula

a(n) = A003159(2*n) = A036554(2*n)/2.
a(n) is asymptotic to 3*n. - Benoit Cloitre, Mar 22 2004
A050292(a(n)) = 2n. - Philippe Deléham, Mar 26 2004

Extensions

More terms from Benoit Cloitre, Mar 22 2004

A022907 The sequence m(n) in A022905.

Original entry on oeis.org

0, 2, 5, 8, 14, 20, 29, 38, 53, 68, 89, 110, 140, 170, 209, 248, 302, 356, 425, 494, 584, 674, 785, 896, 1037, 1178, 1349, 1520, 1730, 1940, 2189, 2438, 2741, 3044, 3401, 3758, 4184, 4610, 5105, 5600, 6185, 6770, 7445, 8120, 8906, 9692, 10589
Offset: 1

Keywords

Programs

  • Mathematica
    a123[n_] := a123[n] = If[n == 0, 1, a123[Floor[n/2]] + a123[n-1]];
    a[n_] := If[n == 1, 0, (3/2) a123[n-1] - 1]; Array[a, 50] (* Jean-François Alcover, Dec 04 2018 *)
  • Python
    from itertools import islice
    from collections import deque
    def A022907_gen(): # generator of terms
        aqueue, f, b, a = deque([2]), True, 1, 2
        yield from (0, 2, 5)
        while True:
            a += b
            yield 3*a-1
            aqueue.append(a)
            if f: b = aqueue.popleft()
            f = not f
    A022907_list = list(islice(A022907_gen(),40)) # Chai Wah Wu, Jun 08 2022

Formula

a(n) = 3 * A033485(n-1) - 1 = (3/2) * A000123(n-1) - 1, n>1. Proved by Jeremy Dover. - Ralf Stephan, Dec 08 2004

A131205 a(n) = a(n-1) + a(floor(n/2)) + a(ceiling(n/2)).

Original entry on oeis.org

1, 3, 7, 13, 23, 37, 57, 83, 119, 165, 225, 299, 393, 507, 647, 813, 1015, 1253, 1537, 1867, 2257, 2707, 3231, 3829, 4521, 5307, 6207, 7221, 8375, 9669, 11129, 12755, 14583, 16613, 18881, 21387, 24177, 27251, 30655, 34389, 38513, 43027, 47991
Offset: 1

Author

Reinhard Zumkeller, Oct 22 2007

Keywords

Comments

From Gary W. Adamson, Dec 16 2009: (Start)
Let M = an infinite lower triangular matrix with (1, 3, 4, 4, 4, ...) in every column shifted down twice, with the rest zeros:
1;
3, 0;
4, 1, 0;
4, 3, 0, 0;
4, 4, 1, 0, 0;
4, 4, 3, 0, 0, 0;
...
A131205 = lim_{n->infinity} M^n, the left-shifted vector considered as a sequence. (End)
The subsequence of primes in this sequence begins with 5 in a row: 3, 7, 13, 23, 37, 83, 647, 1867, 2707, 88873, 388837, 655121, 754903, 928621, 1062443. - Jonathan Vos Post, Apr 25 2010

Crossrefs

Cf. A000123, A008619. Bisection of A033485.

Programs

  • Haskell
    a131205 n = a131205_list !! (n-1)
    a131205_list = scanl1 (+) a000123_list -- Reinhard Zumkeller, Oct 10 2013
  • Maple
    A[1]:= 1:
    for n from 2 to 100 do A[n]:= A[n-1] + A[floor(n/2)] + A[ceil(n/2)] od:
    seq(A[n],n=1..100); # Robert Israel, Sep 06 2016
  • Mathematica
    Nest[Append[#1, #1[[-1]] + #1[[Floor@ #3]] + #[[Ceiling@ #3]] ] & @@ {#1, #2, #2/2} & @@ {#, Length@ # + 1} &, {1}, 42] (* Michael De Vlieger, Jan 16 2020 *)

Formula

Partial sums of A000123. - Gary W. Adamson, Oct 26 2007
G.f.: r(x) * r(x^2) * r(x^4) * r(x^8) * ... where r(x) = (1 + 3x + 4x^2 + 4x^3 + 4x^4 + ...) is the g.f. of A113311. - Gary W. Adamson, Sep 01 2016
G.f.: (x/(1 - x))*Product_{k>=0} (1 + x^(2^k))/(1 - x^(2^k)). - Ilya Gutkovskiy, Jun 05 2017
a(n) = A033485(2n-1). - Jean-Paul Allouche, Aug 11 2021

A322156 Irregular triangle where row n includes all decreasing sequences S = {k_0 = n, k_1, k_2, ..., k_m} in reverse lexicographic order such that the sum of subsequent terms k_j for all i < j <= m does not exceed any k_i.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 3, 3, 1, 3, 1, 1, 3, 2, 3, 2, 1, 3, 3, 4, 4, 1, 4, 1, 1, 4, 2, 4, 2, 1, 4, 2, 1, 1, 4, 2, 2, 4, 3, 4, 3, 1, 4, 4, 5, 5, 1, 5, 1, 1, 5, 2, 5, 2, 1, 5, 2, 1, 1, 5, 2, 2, 5, 3, 5, 3, 1, 5, 3, 1, 1, 5, 3, 2, 5, 4, 5, 4, 1, 5, 5, 6, 6, 1, 6, 1, 1, 6, 2, 6, 2, 1, 6, 2, 1, 1, 6, 2, 2, 6
Offset: 1

Author

Michael De Vlieger, Dec 11 2018

Keywords

Comments

Algorithm:
Let S be a sequence starting with n. Let k be the index of a term in S, with n at position k = 0. Let S_r be the r-th sequence in row n.
Starting with S_1 = {n}, we either (A) append a 1 to the left of S_r, or (B) we drop the most recently-appended term S_(k) and increment the rightmost term (k - 1).
By default we execute (A) and test according to the following. Consider the reversed accumulation A_(r + 1) = Sum(reverse(S_(k + 1))) = Sum(k_m, k_(m - 1), ..., k_2, k_1). If S_r - A_(r + 1) contains nothing less than 0, then S_(k + 1) is retained, otherwise we execute (B).
We end after k_1 = n, since otherwise we would enter an endless loop that also increments k_0 ad infinitum.
The first sequence S in row n is {n} while the last is {n, n}.
All rows n contain {{n}, {n, 1}, {n, n}}.
Only one repeated term k may appear at the end of any S in row n.
The longest possible sequence S in row n has 2 + floor(log_2(n)) terms = 2 + A113473(n).
The sequence S describes unique integer partitions L that are recursively symmetrical. Example: We can convert S = {4, 2, 1} into the partition (7, 6, 5, 4, 3, 2, 1), a partition of N = 28. We set a 4X Durfee square with its upper-left corner at origin. Then we set 2^k = 2^1 = 2 2X squares, each with its upper-left corner in any coordinate bounded at left and top by either a previously-lain square or an axis. Finally, we set 2^2 = 4 1X squares as above once again. We obtain a Ferrer diagram as below, with the k marked, i.e., the 1st term 4X, the 2nd term 2X, the 3rd term 1X squares:
0 0 0 0 1 1 2
0 0 0 0 1 1
0 0 0 0 2
0 0 0 0
1 1 2
1 1
2
The resulting partition L is recursively self-conjugate; its arms are identical to its legs. We can eliminate the Durfee square and the other appendage and have a symmetrical partition L_1 with Durfee square of k_1 units, etc.
Were we to admit either more than 1 repeated k or a term such that S_k - A_(k + 1) had differences less than 1, we would have overlapping squares in the Ferrer diagram. Such diagrams are generated by larger n and all resulting diagrams are unique given the described algorithm.
The sequences S in row n, converted into integer partitions L, sum to n^2 <= N <= 3 * n^2.

Examples

			Triangle begins:
1; 1,1;
2; 2,1; 2,1,1; 2,2;
3; 3,1; 3,1,1; 3,2; 3,2,1; 3,3;
4; 4,1; 4,1,1; 4,2; 4,2,1; 4,2,1,1; 4,2,2; 4,3; 4,3,1; 4,4;
...
Row n = 5 starts with S_1 = 5. We append 1 to get {5,1}. 1 does not exceed 5, thus S_2 = {5,1}. We append 1 to get {5,1,1}. A = {1,2}; {5,1}-{2,1} = {3,0}, thus S_3 = {5,1,1} and we drop the last term and increment the new last term to get {5,2}. S_4 = {5,2}, and the ensuing terms {5,2,1}, {5,2,1,1}, {5,2,2} enter into the row. Since there are repeated terms at the last sequence, we drop the last term and increment the new last to get {5,3}. The terms {5,3,1}, {5,3,1,1}, {5,3,2}, {5,3,2,1}, are admitted. {5,3,2,1,1} has A = {1,2,4,6}. {5,3,2,1}-{6,4,2,1} = {-1,1,0,0}: {5,3,2,1,1} cannot be admitted, so we drop the last term and increment to {5,3,2,2} but the sum of the last two terms exceeds the second and we drop the last term and increment to {5,3,3}. For similar reasons, this cannot be admitted, so we drop the last term and increment to {5,4}. This enters as well as {5,4,1}. Since any appendage or increment proves invalid, we end up incrementing to {5,5}. The two terms are the same, therefore we end the row n = 5.
		

Programs

  • Mathematica
    (* Generate sequence: *)
    f[n_] := Block[{w = {n}, c}, c[x_] := Apply[Times, Most@ x - Reverse@ Accumulate@ Reverse@ Rest@ x]; Reap[Do[Which[And[Length@ w == 2, SameQ @@ w], Sow[w]; Break[], Length@ w == 1, Sow[w]; AppendTo[w, 1], c[w] > 0, Sow[w]; AppendTo[w, 1], True, Sow[w]; w = MapAt[1 + # &, Drop[w, -1], -1]], {i, Infinity}] ][[-1, 1]] ]; Array[f, 6] // Flatten
    (* Convert S = row n to standard partition: *)
    g[w_] := Block[{k}, k = Total@ w; Total@ Map[Apply[Function[{s, t}, s Array[Boole[t <= # <= s + t - 1] &, k] ], #] &, Apply[Join, Prepend[Table[Function[{v, c}, Map[{w[[k]], # + 1} &, Map[Total[v #] &, Tuples[{0, 1}, {Length@ v}]]]] @@ {Most@ #, ConstantArray[1, Length@ # - 1]} &@ Take[w, k], {k, 2, Length@ w}], {{w[[1]], 1}}]]] ]

Formula

Row n contains A000123(n) = 2*A033485(n) sequences S.

A062188 a(n+1) = a(n) + a(floor(n/2)), with a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 1, 2, 3, 4, 5, 7, 9, 12, 15, 19, 23, 28, 33, 40, 47, 56, 65, 77, 89, 104, 119, 138, 157, 180, 203, 231, 259, 292, 325, 365, 405, 452, 499, 555, 611, 676, 741, 818, 895, 984, 1073, 1177, 1281, 1400, 1519, 1657, 1795, 1952, 2109, 2289, 2469, 2672, 2875, 3106
Offset: 0

Author

Henry Bottomley, Jun 13 2001

Keywords

Examples

			a(6) = a(5)+a(2) = 4+1 = 5.
a(7) = a(6)+a(3) = 5+2 = 7.
		

Crossrefs

Programs

  • Magma
    [n le 2 select n-1 else  Self(n-1)+Self(Floor(n/2)): n in [1..60]]; // Vincenzo Librandi, Mar 03 2016
    
  • Mathematica
    Join[{0}, Nest[Append[#, #[[-1]] + #[[Quotient[Length@#, 2]]]] &, {1, 1}, 53]] (* Ivan Neretin, Mar 03 2016 *)
  • Python
    from itertools import islice
    from collections import deque
    def A062188_gen(): # generator of terms
        aqueue, f, b, a = deque([1]), True, 0, 1
        yield from (0,1)
        while True:
            a += b
            yield a
            aqueue.append(a)
            if f: b = aqueue.popleft()
            f = not f
    A062188_list = list(islice(A062188_gen(),40)) # Chai Wah Wu, Jun 08 2022

Formula

G.f. A(x) satisfies: A(x) = x * (1 + (1 + x)*A(x^2))/(1 - x). - Ilya Gutkovskiy, May 04 2019

A092412 Fixed point of the morphism 0->11, 1->12, 2->13, 3->10, starting from a(1) = 1.

Original entry on oeis.org

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

Author

Philippe Deléham, Mar 22 2004

Keywords

Crossrefs

Cf. A001511, A033485, A035263, A346070 (same with values 3,0,1,2).

Programs

  • Mathematica
    Nest[ Function[ l, {Flatten[(l /. {0 -> {1, 1}, 1 -> {1, 2}, 2 -> {1, 3}, 3 -> {1, 0}})] }], {0}, 7] (* Robert G. Wilson v, Mar 04 2005 *)
    SubstitutionSystem[{0 -> {1, 1}, 1 -> {1, 2}, 2 -> {1, 3}, 3 -> {1, 0}}, {1}, 7] // Last (* Jean-François Alcover, Sep 20 2019 *)
    Mod[IntegerExponent[Range[100], 2] + 1, 4] (* Paolo Xausa, Feb 25 2025 *)
  • PARI
    a(n)=(1 + valuation(n, 2)) %4; \\ Andrew Howroyd, Aug 06 2018
    
  • Python
    def A092412(n): return (n&-n).bit_length()&3 # Chai Wah Wu, Jul 13 2022

Formula

a(n) = A001511(n) mod 4.
a(2n+1) = 1; a(2n) = a(n) + 1 mod 4.
a(n) == A035263(n) (mod 2); a(n) == A033485(n) (mod 2).
Multiplicative with a(2^e) = (1 + e) mod 4, a(p^e) = 1 for odd prime p. - Andrew Howroyd, Aug 06 2018
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 22/15. - Amiram Eldar, Nov 29 2022
Dirichlet g.f.: zeta(s)*(3*2^s+2^(2*s+1)+2^(3*s))/(1+2^s+4^s+8^s). - Amiram Eldar, Jan 04 2023

A022905 a(n) = M(n) + m(n) for n >= 2, where M(n) = max{ a(i) + a(n-i): i = 1..n-1 }, m(n) = min{ a(i) + a(n-i): i = 1..n-1 }.

Original entry on oeis.org

1, 4, 10, 19, 34, 55, 85, 124, 178, 247, 337, 448, 589, 760, 970, 1219, 1522, 1879, 2305, 2800, 3385, 4060, 4846, 5743, 6781, 7960, 9310, 10831, 12562, 14503, 16693, 19132, 21874, 24919, 28321, 32080, 36265, 40876, 45982, 51583, 57769
Offset: 1

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 1,
          a(n-1)+1+a(floor(n/2))+a(ceil(n/2)))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 17 2013
  • Mathematica
    a[n_] := a[n] = If[n==1, 1, a[n-1]+1+a[Floor[n/2]]+a[Ceiling[n/2]]]; Array[a,100] (* Jean-François Alcover, Aug 07 2017, after Alois P. Heinz *)
  • Python
    from itertools import islice
    from collections import deque
    def A022905_gen(): # generator of terms
        aqueue, f, b, a = deque([2]), True, 1, 2
        yield 1
        while True:
            a += b
            aqueue.append(a)
            if f:
                yield (3*a-1)//2
                b = aqueue.popleft()
            f = not f
    A022905_list = list(islice(A022905_gen(),40)) # Chai Wah Wu, Jun 08 2022

Formula

a(n) = n + Sum_{k=2..n} A022907(k).
a(n+1) = 1+3*Sum_{k=1..n} A033485(k). - Philippe Deléham, Jun 17 2010
a(n) = a(n-1) + 1 + a(floor(n/2)) + a(ceiling(n/2)) for n>1, a(1) = 1. - Alois P. Heinz, Sep 17 2013
a(n+1) = (3*A033485(2n+1)-1)/2. - Chai Wah Wu, Jun 08 2022
Previous Showing 11-20 of 35 results. Next