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.

Showing 1-4 of 4 results.

A049933 a(n) = a(1) + a(2) + ... + a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = a(3) = 1.

Original entry on oeis.org

1, 1, 1, 4, 8, 19, 35, 70, 140, 349, 663, 1310, 2609, 5214, 10425, 20850, 41700, 104249, 198073, 390935, 779265, 1557231, 3113815, 6227316, 12454423, 24908776, 49817517, 99635018, 199270025, 398540046, 797080089, 1594160178, 3188320356, 7970800889, 15144521689
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Nov 06 2019: (Start)
a(4) = a(2^ceiling(log_2(4-1)) + 2 - 4) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 4.
a(5) = a(2^ceiling(log_2(5-1)) + 2 - 5) + a(1) + a(2) + a(3) + a(4) = a(1) + a(1) + a(2) + a(3) + a(4) = 8.
a(6) = a(2^ceiling(log_2(6-1)) + 2 - 6) + a(1) + a(2) + a(3) + a(4) + a(5) = a(4) + a(1) + a(2) + a(3) + a(4) + a(5) = 19.
a(7) =  a(7 - 1 - A006257(7-2)) + Sum_{i = 1..6} a(i) = a(3) +  Sum_{i = 1..6} a(i) = 35.
a(8) =  a(8 - 1 - A006257(8-2)) + Sum_{i = 1..7} a(i) = a(2) +  Sum_{i = 1..7} a(i) = 70. (End)
		

Crossrefs

Cf. A006257, A049885 (similar, but with minus a(m)), A049937, A049945.

Programs

  • Maple
    s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)); end proc;
    a := proc(n) option remember;
      `if`(n < 4, 1, s(n - 1) + a(Bits:-Iff(n - 2, n - 2) + 3 - n));
    end proc;
    seq(a(n), n = 1 .. 30);
  • Mathematica
    b[n_] := Module[{p}, For[p = 0, True, p++, If[2^p < n - 1 <= 2^(p + 1), Return[p]]]];
    a[n_] := a[n] = If[n < 4, 1, With[{m = 2^(b[n] + 1) + 2 - n}, Total[ Array[a, n - 1]] + a[m]]];
    Array[a, 35] (* Jean-François Alcover, Apr 24 2020 *)

Formula

From Petros Hadjicostas, Nov 06 2019: (Start)
a(n) = a(2^ceiling(log_2(n-1)) + 2 - n) + Sum_{i = 1..n-1} a(i) for n >= 4.
a(n) = a(n - 1 - A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4. (End)

Extensions

Name edited by and more terms from Petros Hadjicostas, Nov 06 2019

A049893 a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = 1 and a(3) = 3.

Original entry on oeis.org

1, 1, 3, 4, 8, 13, 27, 56, 112, 169, 367, 748, 1501, 3006, 6013, 12028, 24056, 36085, 78185, 159377, 320259, 641271, 1282923, 2566044, 5132145, 10264346, 20528721, 41057456, 82114917, 164229838, 328459677, 656919356, 1313838712, 1970758069, 4269975817, 8704181473
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A049885.

Programs

  • Maple
    s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)) end proc:
    a := proc(n) option remember;
    `if`(n < 4, [1,1,3][n], s(n - 1) - a(2^ceil(log[2](n - 1)) + 2 - n)):
    end proc:
    seq(a(n), n = 1..34); # Petros Hadjicostas, Nov 11 2019
  • Mathematica
    nn = 36; a[1] = a[2] = 1; a[3] = 3; s = 5; Do[Set[k, s - a[2^(Ceiling@ Log2[n - 1]) + 2 - n]]; a[n] = k; s += k, {n, 4, nn}]; Array[a, nn] (* Michael De Vlieger, Oct 21 2024 *)

Extensions

Name edited by Petros Hadjicostas, Nov 11 2019
More terms from Michael De Vlieger, Oct 21 2024

A049897 a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = 1 and a(3) = 4.

Original entry on oeis.org

1, 1, 4, 5, 10, 16, 33, 69, 138, 208, 452, 921, 1848, 3701, 7403, 14809, 29618, 44428, 96262, 196226, 394305, 789537, 1579543, 3159330, 6318730, 12637529, 25275094, 50550205, 101100416, 202200837, 404401675, 808803353, 1617606706
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)) end proc:
    a := proc(n) option remember;
    `if`(n < 4, [1, 1, 4][n], s(n - 1) - a(2^ceil(log[2](n - 1)) + 2 - n)):
    end proc:
    seq(a(n), n = 1..40); # Petros Hadjicostas, Nov 14 2019

Extensions

Name edited by Petros Hadjicostas, Nov 14 2019

A049901 a(n) = a(1) + a(2) + ... + a(n-1) - a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1, a(2) = 2, and a(3) = 1.

Original entry on oeis.org

1, 2, 1, 2, 5, 9, 19, 37, 75, 114, 246, 502, 1008, 2019, 4039, 8077, 16155, 24234, 52506, 107032, 215075, 430656, 861568, 1723268, 3446575, 6893188, 13786394, 27572798, 55145600, 110291203, 220582407, 441164813, 882329627, 1323494442
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    s := proc(n) option remember; `if`(n < 1, 0, a(n) + s(n - 1)) end proc:
    a := proc(n) option remember;
    `if`(n < 4, [1, 2, 1][n], s(n - 1) - a(2^ceil(log[2](n - 1)) + 2 - n)):
    end proc:
    seq(a(n), n = 1..40); # Petros Hadjicostas, Nov 14 2019

Extensions

Name edited by Petros Hadjicostas, Nov 14 2019
Showing 1-4 of 4 results.