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

A129299 a(1)=1, a(n) = a(n-1) + (sum of the earlier terms of the sequence which are <= n).

Original entry on oeis.org

1, 2, 5, 8, 16, 24, 32, 48, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256, 288, 320, 352, 384, 416, 472, 528, 584, 640, 696, 752, 808, 864, 952, 1040, 1128, 1216, 1304, 1392, 1480, 1568, 1656, 1744, 1832, 1920, 2008, 2096, 2184, 2272, 2408, 2544, 2680, 2816
Offset: 1

Views

Author

Leroy Quet, Apr 08 2007

Keywords

Examples

			The terms that are <= 9 are a(1) through a(4). So a(9) = a(8) + a(1) + a(2) + a(3) + a(4) = 48 + 1 + 2 + 5 + 8 = 64.
		

Crossrefs

Programs

  • Haskell
    a129299 n = a129299_list !! (n-1)
    a129299_list = 1 : f [1] 2 where
       f xs@(x:_) k = y : f (y:xs) (k+1) where
         y = x + sum [z | z <- xs, z <= k]
    -- Reinhard Zumkeller, Feb 09 2012
  • Maple
    a[1]:=1: for n from 2 to 60 do b:=a[n-1]: for j from 1 to n-1 do if a[j]<=n then b:=b+a[j] else b:=b: fi: od: a[n]:=b: od: seq(a[n],n=1..60); # Emeric Deutsch, Apr 10 2007
  • Mathematica
    s={1};Do[AppendTo[s,s[[-1]]+Total[Select[s,#<=n&]]],{n,2,51}];s (* James C. McMahon, Jan 20 2025 *)

Extensions

More terms from Emeric Deutsch, Apr 10 2007

A129300 a(0)=1. a(n) = a(n-1) + (sum of the terms of the sequence which are <= n).

Original entry on oeis.org

1, 2, 5, 8, 11, 19, 27, 35, 51, 67, 83, 110, 137, 164, 191, 218, 245, 272, 299, 345, 391, 437, 483, 529, 575, 621, 667, 740, 813, 886, 959, 1032, 1105, 1178, 1251, 1359, 1467, 1575, 1683, 1791, 1899, 2007, 2115, 2223, 2331, 2439, 2547, 2655, 2763, 2871, 2979
Offset: 0

Views

Author

Leroy Quet, Apr 08 2007

Keywords

Examples

			The terms that are <= 9 are a(0) through a(3). So a(9) = a(8) + a(0) + a(1) + a(2) + a(3) = 51 + 1 + 2 + 5 + 8 = 67.
		

Crossrefs

Programs

  • Haskell
    a129300 n = a129300_list !! (n-1)
    a129300_list = 1 : f [1] 1 where
       f xs@(x:_) k = y : f (y:xs) (k+1) where
         y = x + sum [z | z <- xs, z <= k]
    -- Reinhard Zumkeller, Feb 09 2012
  • Maple
    a[0]:=1: for n from 1 to 60 do b:=0: for j from 0 to n-1 do if a[j]<=n then b:=b+a[j] else fi od: a[n]:=a[n-1]+b: od: seq(a[n],n=0..60); # Emeric Deutsch, Apr 12 2007
  • Mathematica
    Nest[Function[{s,n},Append[s,s[[-1]]+Total[TakeWhile[s,#<=n&]]]]@@{#,Length[#]}&,{1}, 50] (* James C. McMahon, Jan 20 2025 *)

Extensions

More terms from Emeric Deutsch, Apr 12 2007

A368784 a(0) = 1. For n > 0, a(n) is the smallest integer k > n such that (Sum_{i = 1..n} i)/(Sum_{i = n + 1..k} i) < 1/n.

Original entry on oeis.org

1, 2, 4, 7, 10, 13, 17, 21, 25, 30, 35, 40, 45, 50, 56, 62, 68, 74, 81, 87, 94, 101, 108, 115, 122, 130, 138, 145, 153, 162, 170, 178, 187, 195, 204, 213, 222, 231, 240, 250, 259, 269, 279, 289, 298, 309, 319, 329, 339, 350, 361, 371, 382, 393, 404, 415, 427, 438
Offset: 0

Views

Author

Felix Huber, Feb 15 2024

Keywords

Comments

(Sum_{i = 1..n} i)/(Sum_{i = n + 1..k} i) = n*(n + 1)/((k - n)*(n + 1 + k)) < 1/n. It follows that k > -1/2 + sqrt(4*n^3 + 8*n^2 + 4*n + 1)/2.

Examples

			a(3) = 7, because (1 + 2 + 3)/(4 + 5 + 6 + 7) = 3/11 < 1/3 and (1 + 2 + 3)/(4 + 5 + 6) = 2/5 > 1/3.
		

Crossrefs

Programs

  • Maple
    A368784 := n -> floor(-1/2 + 1/2*sqrt(4*n^3 + 8*n^2 + 4*n + 1)) + 1;
    seq(A368784(n), n = 0 .. 57);
  • Mathematica
    a[n_]:= Floor[-1/2 + Sqrt[4*n^3 + 8*n^2 + 4*n + 1]/2] + 1; Array[a,58,0] (* Stefano Spezia, Feb 17 2024 *)

Formula

a(n) = floor(-1/2 + sqrt(4*n^3 + 8*n^2 + 4*n + 1)/2) + 1.
a(n) = round(sqrt(n*(n+1)^2 + 1/4)). - Chai Wah Wu, Mar 11 2024
Showing 1-3 of 3 results.