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-8 of 8 results.

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

Original entry on oeis.org

1, 1, 2, 5, 14, 24, 52, 123, 345, 568, 1140, 2299, 4697, 9839, 21409, 50358, 141235, 232113, 464230, 928479, 1857057, 3714559, 7430849, 14869238, 29778995, 59739745, 120175856, 243137792, 497430263, 1039731033, 2262860113
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Sep 24 2019: (Start)
a(4) = a(1 + A006257(4-2)) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 1 + 1 + 1 + 2 = 5.
a(5) = a(1 + A006257(5-2)) + a(1) + a(2) + a(3) + a(4) = a(4) + a(1) + a(2) + a(3) + a(4) = 5 + 1 + 1 + 2 + 5 = 14.
a(6) = a(1 + A006257(6-2)) + a(1) + a(2) + a(3) + a(4) + a(5) = a(2) +  a(1) + a(2) + a(3) + a(4) + a(5) = 1 + 1 + 1 + 2 + 5 + 14 = 24.
(End)
		

Crossrefs

Cf. A006257, A049890 (similar, but with minus a(m/2)), A049891 (similar, but with minus a(m)), A049938 (similar, but with plus a(m/2)), A049940, A049960, A049964.

Programs

  • Maple
    a := proc(n) local i; option remember; if n < 4 then return [1, 1, 2][n]; end if; add(a(i), i = 1 .. n - 1) + a(2*n - 3 - Bits:-Iff(n - 2, n - 2)); end proc;
    seq(a(n), n = 1 .. 37); # Petros Hadjicostas, Sep 24 2019, courtesy of Peter Luschny

Formula

a(n) = a(1 + A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = a(2) = 1 and a(3) = 2.

Extensions

Name edited by Petros Hadjicostas, Sep 24 2019

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

Original entry on oeis.org

1, 3, 1, 6, 12, 24, 48, 107, 250, 453, 906, 1823, 3682, 7566, 15788, 34352, 80810, 145833, 291666, 583343, 1166722, 2333646, 4667948, 9338672, 18689450, 37443922, 75098700, 151072456, 305646138, 625313778, 1307036806, 2844621050, 6690632768, 12074228731, 24148457462, 48296914935, 96593829906
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Sep 24 2019: (Start)
a(4) = a(1) + a(2) + a(3) + a(m=1) = 1 + 3 + 1 + 1 = 6 because m = A006257(4-2) = 2*4 - 3 - 2^ceiling(log_2(4-1)) = 1.
a(5) = a(1) + a(2) + a(3) + a(4) + a(m=3) = 1 + 3 + 1 + 6 + 1 = 12 because m = A006257(5-2) = 2*5 - 3 - 2^ceiling(log_2(5-1)) = 3.
a(6) = a(1) + a(2) + a(3) + a(4) + a(5) + a(m=1) = 1 + 3 + 1 + 6 + 12 + 1 = 24 because m = A006257(6-2) = 2*6 - 3 - 2^ceiling(log_2(6-1)) = 1.
(End)
		

Crossrefs

Programs

  • Maple
    a := proc(n) option remember; if n<4 then return [1,3,1][n] fi; add(a(i), i=1..n-1) + a(2*(n-2) - Bits:-Iff(n-2, n-2)) end: seq(a(n), n=1..37); # Petros Hadjicostas, Sep 24 2019, courtesy of Peter Luschny

Formula

a(n) = a(2*n - 3 - 2^ceiling(log_2(n-1))) + Sum_{i = 1..n-1} a(i) = a(A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 1. - Petros Hadjicostas, Sep 24 2019

Extensions

Name edited by and more terms from Petros Hadjicostas, Sep 23 2019

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

Original entry on oeis.org

1, 1, 3, 6, 14, 26, 54, 119, 278, 503, 1008, 2027, 4094, 8412, 17554, 38194, 89848, 162143, 324288, 648587, 1297214, 2594652, 5190034, 10383154, 20779768, 41631830, 83498100, 167969126, 339831072, 695251878, 1453222088, 3162777148, 7438945312, 13424668537, 26849337076, 53698674163
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Sep 24 2019: (Start)
a(3) = a(1) + a(2) + a(m=1) = 1 + 1 + 1 = 3 because m = A006257(3-2) = 2*3 - 3 - 2^ceiling(log[2](3-1)) = 1.
a(4) = a(1) + a(2) + a(3) + a(m=1) = 1 + 1 + 3 + 1 = 6 because m = A006257(4-2) = 2*4 - 3 - 2^ceiling(log[2](4-1)) = 1.
a(5) = a(1) + a(2) + a(3) + a(4) + a(m=3) = 1 + 1 + 3 + 6 + 3 = 14 because m = A006257(5-2) = 2*5 - 3 - 2^ceiling(log[2](5-1)) = 3.
a(6) = a(1) + a(2) + a(3) + a(4) + a(5) + a(m=1) = 1 + 1 + 3 + 6 + 14 + 1 = 26 because m = A006257(6-2) = 2*6 - 3 - 2^ceiling(log[2](6-1)) = 1.
(End)
		

Crossrefs

Programs

  • Maple
    a := proc(n) local vv, i; option remember; if n = 1 then vv := 1; end if; if n = 2 then vv := 1; end if; if 3 <= n then vv := 0; for i to n - 1 do vv := vv + a(i); end do; vv := vv + a(2*n - 3 - 2^ceil(log[2](n - 1))); end if; vv; end proc; # Petros Hadjicostas, Sep 24 2019
    # second Maple program:
    s:= proc(n) option remember; `if`(n<1, 0, a(n)+s(n-1)) end:
    a:= proc(n) option remember; `if`(n<3, 1,
          s(n-1)+a(2*(n-2^ilog2(n-2))-3))
        end:
    seq(a(n), n=1..36);  # Alois P. Heinz, Sep 24 2019
  • Mathematica
    s[n_] := s[n] = If[n < 1, 0, a[n] + s[n-1]];
    a[n_] := a[n] = If[n < 3, 1, s[n-1] + a[2(n - 2^Floor@Log[2, n-2]) - 3]];
    Array[a, 36] (* Jean-François Alcover, Apr 23 2020, after Alois P. Heinz *)

Formula

a(n) = a(2*n - 3 - 2^ceiling(log_2(n-1))) + Sum_{i = 1..n-1} a(i) = a(A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 3 with a(1) = a(2) = 1. - Petros Hadjicostas, Sep 24 2019

Extensions

Name edited by and more terms from Petros Hadjicostas, Sep 24 2019

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

Original entry on oeis.org

1, 1, 2, 5, 10, 20, 40, 81, 165, 326, 652, 1305, 2613, 5231, 10472, 20964, 41969, 83858, 167716, 335433, 670869, 1341743, 2683496, 5367012, 10734065, 21468214, 42936589, 85873504, 171747661, 343496630, 686995878, 1373996997, 2748004486, 5495988009, 10991976018, 21983952037, 43967904077
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Oct 01 2019: (Start)
a(4) = a(4 - 1 - 2^ceiling(-1 + log_2(3))) + a(1) + a(2) + a(3) = a(1) + a(1) + a(2) + a(3) = 5.
a(5) = a(5 - 1 - 2^ceiling(-1 + log_2(4))) + a(1) + a(2) + a(3) + a(4) = a(2) + a(1) + a(2) + a(3) + a(4) = 10.
a(6) = a(6 - 1 - 2^ceiling(-1 + log_2(5))) + a(1) + a(2) + a(3) + a(4) + a(5) = a(1) + a(1) + a(2) + a(3) + a(4) + a(5) = 20.
(End)
		

Crossrefs

Cf. A006257, A049890 (similar, but with minus a(m)), A049891 (similar, but with minus a(2*m)), A049939 (similar, but with plus a(2*m)), A049940, A049960, A049964, A049978.

Programs

  • Maple
    a := proc(n) local i; option remember; if n < 4 then return [1, 1, 2][n]; end if; add(a(i), i = 1 .. n - 1) + a(n - 3/2 - 1/2*Bits:-Iff(n - 2, n - 2)); end proc; # Petros Hadjicostas, Oct 01 2019
  • PARI
    lista(nn) = { nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 1; va[3] = 2; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa + va[n - 1 - 2^ceil(-1 + log(n-1)/log(2))]; sa += va[n]; ); va; } \\ Petros Hadjicostas, Apr 27 2020

Formula

a(n) = a(n - 1 - 2^ceiling(-1 + log_2(n-1))) + Sum_{i = 1..n-1} a(i) = a((1 + A006257(n-2))/2) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = a(2) = 1 and a(3) = 2. - Petros Hadjicostas, Oct 01 2019

Extensions

More terms from Petros Hadjicostas, Oct 01 2019

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

Original entry on oeis.org

1, 2, 4, 9, 25, 43, 93, 220, 617, 1016, 2039, 4112, 8401, 17598, 38292, 90070, 252612, 415156, 830319, 1660672, 3321521, 6643838, 13290772, 26595030, 53262532, 106850150, 214945816, 434874798, 889700788, 1859656696
Offset: 1

Views

Author

Keywords

Comments

The number m in the definition of the sequence equals 2*n - 2 - x, where x is the smallest power of 2 >= n-1. It turns out that m = 1 + A006257(n-2), where the sequence b(n) = A006257(n) satisfies b(2*n) = 2*b(n) - 1 and b(2*n + 1) = 2*b(n) + 1, and it is related to the so-called Josephus problem. - Petros Hadjicostas, Sep 25 2019

Examples

			From _Petros Hadjicostas_, Sep 25 2019: (Start)
a(4) = a(1 + A006257(4-2)) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 9.
a(7) = a(1 + A006257(7-2)) + a(1) + a(2) + a(3) + a(4) + a(5) + a(6) = a(4) + a(1) + a(2) + a(3) + a(4) + a(5) + a(6) = 93.
(End)
		

Crossrefs

Cf. A049914 (similar, but with minus a(m/2)), A049915 (similar, but with minus a(m)), A049962 (similar, but with plus a(m/2)).

Programs

  • Maple
    a := proc(n) local i; option remember; if n < 4 then return [1, 2, 4][n]; end if; add(a(i), i = 1 .. n - 1) + a(2*n - 3 - Bits:-Iff(n - 2, n - 2)); end proc;
    seq(a(n), n = 1..40); # Petros Hadjicostas, Sep 25 2019, courtesy of Peter Luschny

Formula

a(n) = a(1 + A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 2 and a(3) = 4. - Petros Hadjicostas, Sep 25 2019

Extensions

Name edited by Petros Hadjicostas, Sep 25 2019

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

Original entry on oeis.org

1, 3, 2, 5, 9, 19, 37, 67, 106, 248, 495, 983, 1938, 3807, 7225, 13007, 20727, 48678, 97355, 194703, 389378, 778687, 1556985, 3112527, 6219767, 12426032, 24775436, 49258849, 97350091, 190037400, 361519131, 650463607, 1036758174
Offset: 1

Views

Author

Keywords

Comments

The number m in the definition of the sequence equals 2*n - 3 - x, where x is the smallest power of 2 >= n-1. It turns out that m = A006257(n-2), where the sequence b(n) = A006257(n) satisfies b(2*n) = 2*b(n) - 1 and b(2*n + 1) = 2*b(n) + 1, and it is related to the so-called Josephus problem. - Petros Hadjicostas, Sep 25 2019

Examples

			From _Petros Hadjicostas_, Sep 25 2019: (Start)
a(4) = -a(A006257(4-2)) + a(1) + a(2) + a(3) = -a(1) + a(1) + a(2) + a(3) = 5.
a(5) = -a(A006257(5-2)) + a(1) + a(2) + a(3) + a(4) = -a(3) + a(1) + a(2) + a(3) + a(4) = 9.
a(6) = -a(A006257(6-2)) + a(1) + a(2) + a(3) + a(4) + a(5) = 19.
a(7) = -a(A006257(7-2)) + a(1) + a(2) + a(3) + a(4) + a(5) + a(6) = 37.
(End)
		

Crossrefs

Programs

  • Maple
    A[1]:= 1: A[2]:= 3: A[3]:= 2:
    for n from 4 to 100 do
      q:= ceil(log[2](n-1));
      m:= 2*n-3-2^q;
      A[n]:= add(A[i],i=1..n-1)-A[m];
    od:
    seq(A[i],i=1..100); # Robert Israel, Feb 27 2017

Formula

a(n) = -a(A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 2.

Extensions

Name edited by Petros Hadjicostas, Sep 25 2019

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

Original entry on oeis.org

1, 3, 4, 11, 30, 52, 112, 265, 743, 1224, 2456, 4953, 10119, 21197, 46123, 108490, 304273, 500059, 1000126, 2000293, 4000799, 8002557, 16008843, 32033930, 64155153, 128701875, 258903984, 523810232, 1071651837, 2239971619
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Sep 24 2019: (Start)
a(4) = a(1 + A006257(4-2)) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 3 + 1 + 3 + 4 = 11.
a(7) = a(1 + A006257(7-2)) + a(1) + ... + a(6) = a(4) + a(1) + ... + a(6) = 11 + 1 + 3 + 4 + 11 + 30 + 52 = 112.
(End)
		

Crossrefs

Programs

  • Maple
    a := proc(n) local i; option remember; if n < 4 then return [1, 3, 4][n]; end if; add(a(i), i = 1 .. n - 1) + a(2*n - 3 - Bits:-Iff(n - 2, n - 2)); end proc;
    seq(a(n), n = 1 .. 37); # Petros Hadjicostas, Sep 24 2019, courtesy of Peter Luschny

Formula

a(n) = a(1 + A006257(n-2)) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 4. - Petros Hadjicostas, Sep 24 2019

Extensions

Name edited by Petros Hadjicostas, Sep 24 2019

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

Original entry on oeis.org

1, 3, 4, 9, 20, 38, 78, 157, 319, 630, 1262, 2525, 5055, 10121, 20260, 40560, 81199, 162242, 324486, 648973, 1297951, 2595913, 5191844, 10383728, 20767535, 41535232, 83070775, 166142182, 332285627, 664573784, 1329152634, 2658315407, 5316651114, 10633261669, 21266523340, 42533046681, 85066093367, 170132186745
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Sep 27 2019: (Start)
a(4) = a(4-1-2^ceiling(-1 + log_2(4-1))) + a(1) + a(2) + a(3) = a(1) + a(1) + a(2) + a(3) = 9.
a(5) = a(5-1-2^ceiling(-1 + log_2(5-1))) + a(1) + a(2) + a(3) + a(4) = a(2) + a(1) + a(2) + a(3) + a(4) = 20.
a(6) = a(6-1-2^ceiling(-1 + log_2(6-1))) + a(1) + a(2) + a(3) + a(4) + a(5) = a(1) + a(1) + a(2) + a(3) + a(4) + a(5) = 38.
(End)
		

Crossrefs

Programs

  • Maple
    a := proc(n) local i; option remember; if n < 4 then return [1, 3, 4][n]; end if; add(a(i), i = 1 .. n - 1) + a(n - 3/2 - 1/2*Bits:-Iff(n - 2, n - 2)); end proc;
    seq(a(n), n = 1 .. 37); # Petros Hadjicostas, Sep 27 2019 using a modification of a program by Peter Luschny

Formula

a(n) = a(n - 1 - 2^ceiling(-1 + log_2(n-1))) + Sum_{i = 1..n-1} a(i) = a((1 + A006257(n-2))/2) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 4. - Petros Hadjicostas, Sep 27 2019

Extensions

Name edited by and more terms from Petros Hadjicostas, Sep 27 2019
Showing 1-8 of 8 results.