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.

A048201 Triangular array T read by rows: T(i,j)=b(i+1)-b(i+1-j); j=1,2,...,i; i=1,2,3,...; b=A004978.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 5, 9, 11, 12, 8, 13, 17, 19, 20, 10, 18, 23, 27, 29, 30, 14, 24, 32, 37, 41, 43, 44, 15, 29, 39, 47, 52, 56, 58, 59, 16, 31, 45, 55, 63, 68, 72, 74, 75, 21, 37, 52, 66, 76, 84, 89, 93, 95, 96, 22, 43, 59, 74, 88, 98, 106, 111
Offset: 1

Views

Author

Keywords

Examples

			Rows: {1}, {2,3},{4,6,7}, ...
		

Crossrefs

T(n, 1)=c(n), where c=A002048.
T(n, n)=d(n), where d=A002049.

Formula

T(n, 1)=least number not in any preceding row and T(n, k)=T(n, 1)+T(n-1, 1)+...+T(n-k+1, 1) for k >= 2.

A002048 Segmented numbers, or prime numbers of measurement.

Original entry on oeis.org

1, 2, 4, 5, 8, 10, 14, 15, 16, 21, 22, 25, 26, 28, 33, 34, 35, 36, 38, 40, 42, 46, 48, 49, 50, 53, 57, 60, 62, 64, 65, 70, 77, 80, 81, 83, 85, 86, 90, 91, 92, 100, 104, 107, 108, 116, 119, 124, 127, 132, 133, 137, 141, 144, 145, 148, 150, 151, 154, 158, 159, 163, 165
Offset: 1

Views

Author

Keywords

Comments

The segmented numbers are the positive integers excluding those equal to the sum of two or more consecutive smaller terms. The prime numbers of measurement are their partial sums, cf. A002049. - M. F. Hasler, Jun 26 2019
Without the requirement that the smaller terms be consecutive, the sequence becomes the sequence of powers of 2 (A000079). - Alonso del Arte, Jan 25 2020

Examples

			Although 5 is the sum of the terms 1 and 4, those prior terms are not consecutive, and therefore 5 is in the sequence.
6 is not in the sequence because it is the sum of consecutive prior terms 2 and 4.
7 is not in the sequence either because it is also the sum of consecutive prior terms, in this case 1, 2, 4.
8 is in the sequence because no sum whatsoever of distinct prior terms adds up to 8.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E30.
  • Š. Porubský, On MacMahon's segmented numbers and related sequences. Nieuw Arch. Wisk. (3) 25 (1977), no. 3, 403--408. MR0485763 (58 #5575)
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A002049 (partial sums), A004978, A005242, A033627.

Programs

  • C
    // See Links section for C program by Samuel B. Reid, Jan 26 2020
    
  • Haskell
    import Data.List ((\\))
    a002048 n = a002048_list !! (n-1)
    a002048_list = f [1..] [] where
       f (x:xs) ys = x : f (xs \\ scanl (+) x ys) (x : ys)
    -- Reinhard Zumkeller, May 23 2013
    
  • Maple
    A002048 := proc(anmax::integer,printlist::boolean)
    local a, asum,su,i,piv,j;
    a := [];
    for i from 1 to anmax do
    a := [op(a),i];
    od:
    if printlist then
    printf("%d %d\n",1,a[1]);
    printf("%d %d\n",2,a[2]);
    fi;
    asum := [a[1]+a[2],a[2]];
    for i from 3 to anmax do
    asum := [op(asum),0];
    od:
    piv := 3;
    while piv <= nops(a) do
    for i from 1 to piv-2 do
    a := remove(has,a, asum[i]);
    od:
    if printlist then
    printf("%a %a\n",piv,a[piv]);
    fi;
    for i from 1 to piv do
    asum := subsop(i=asum[i]+a[piv], asum);
    od:
    piv := piv+1;
    od;
    RETURN(a);
    end:
    A002048(40000,true);
    # R. J. Mathar, Jun 04 2006
  • Mathematica
    A002048[anmax_] := (a = {}; Do[AppendTo[a, i], {i, anmax}]; asum = {a[[1]] + a[[2]], a[[2]]}; Do[AppendTo[asum, 0], {i, 3, anmax}]; piv = 3; While[piv <= Length[a], Do[a = DeleteCases[a, asum[[i]]], {i, 1, piv - 2}]; Do[asum[[i]] += a[[piv]], {i, piv}]; piv = piv + 1;]; a); A002048[63] (* Jean-François Alcover, Jul 28 2011, converted from R. J. Mathar's Maple prog. *)
    searchMax = 200; segmNums = {1}; curr = 2; While[curr < searchMax, If[Not[MemberQ[Apply[Plus, Subsequences[segmNums], 1], curr]], AppendTo[segmNums, curr], ];  curr = curr + 1]; segmNums (* Alonso del Arte, Jan 25 2020 *)
  • Python
    from itertools import count, accumulate, islice
    from collections import deque
    def A002048_gen(): # generator of terms
        aset, alist = set(), deque()
        for k in count(1):
            if k in aset:
                aset.remove(k)
            else:
                yield k
                aset |= set(k+d for d in accumulate(alist))
                alist.appendleft(k)
    A002048_list = list(islice(A002048_gen(),20)) # Chai Wah Wu, Sep 01 2025

Formula

Andrews conjectures that lim_{n -> oo} n log n / (a(n) loglog n) = 1. - N. J. A. Sloane, Dec 01 2013

Extensions

More terms from R. J. Mathar, May 31 2006

A002049 Prime numbers of measurement.

Original entry on oeis.org

1, 3, 7, 12, 20, 30, 44, 59, 75, 96, 118, 143, 169, 197, 230, 264, 299, 335, 373, 413, 455, 501, 549, 598, 648, 701, 758, 818, 880, 944, 1009, 1079, 1156, 1236, 1317, 1400, 1485, 1571, 1661, 1752, 1844, 1944, 2048, 2155, 2263, 2379, 2498, 2622, 2749, 2881
Offset: 1

Views

Author

Keywords

Comments

Partial sums of A002048. - Reinhard Zumkeller, May 23 2013

References

  • R. K. Guy, Unsolved Problems in Number Theory, E30.
  • Š. Porubský, On MacMahon's segmented numbers and related sequences. Nieuw Arch. Wisk. (3) 25 (1977), no. 3, 403--408. MR0485763 (58 #5575)
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A002048.
a(n) = A004978(n+1)-1 = A048204(n-1)+1.

Programs

  • Haskell
    import Data.List ((\\))
    a002049 n = a002049_list !! (n-1)
    a002049_list = g [1..] [] where
       g (x:xs) ys = (last zs) : g (xs \\ zs) (x : ys) where
         zs = scanl (+) x ys
    -- Reinhard Zumkeller, May 23 2013
    
  • Mathematica
    A002048[anmax_] := (a = {}; Do[AppendTo[a, i], {i, 1, anmax}]; asum = {a[[1]] + a[[2]], a[[2]]}; Do[AppendTo[asum, 0], {i, 3, anmax}]; piv = 3; While[piv <= Length[a], Do[a = DeleteCases[a, asum[[i]]], {i, 1, piv - 2}]; Do[asum[[i]] += a[[piv]], {i, 1, piv}]; piv = piv + 1;]; a); A002048[200] // Accumulate (* Jean-François Alcover, Oct 05 2016, adapted from R. J. Mathar's Maple code in A002048. *)
  • Python
    from itertools import count, accumulate, islice
    from collections import deque
    def A002049_gen(): # generator of terms
        aset, alist, c = set(), deque(), 0
        for k in count(1):
            if k in aset:
                aset.remove(k)
            else:
                yield (c:=c+k)
                aset |= set(k+d for d in accumulate(alist))
                alist.appendleft(k)
    A002049_list = list(islice(A002049_gen(),20)) # Chai Wah Wu, Sep 01 2025

Formula

Andrews conjectures that a(n) ~ (1/2) n^2 log n / loglog n. - N. J. A. Sloane, Dec 01 2013

A001856 A self-generating sequence: every positive integer occurs as a(i)-a(j) for a unique pair i,j.

Original entry on oeis.org

1, 2, 4, 8, 16, 21, 42, 51, 102, 112, 224, 235, 470, 486, 972, 990, 1980, 2002, 4004, 4027, 8054, 8078, 16156, 16181, 32362, 32389, 64778, 64806, 129612, 129641, 259282, 259313, 518626, 518658, 1037316, 1037349, 2074698, 2074734, 4149468
Offset: 1

Views

Author

Keywords

Comments

This is a B_2 sequence. More economical recursion: a(1)=1, a(2n)=2a(2n-1), a(2n+1)=a(2n)+r(n), where r(n) is the smallest positive integer not of the form a(j)-a(i) with 1<=iA247556. - Thomas Ordowski, Sep 28 2014

References

  • R. K. Guy, Unsolved Problems in Number Theory, E25.
  • W. Sierpiński, Elementary Theory of Numbers. Państ. Wydaw. Nauk., Warsaw, 1964, p. 444.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[2] = 2; a[n_?OddQ] := a[n] = 2*a[n-1]; a[n_?EvenQ] := a[n] = a[n-1] + r[(n-2)/2]; r[n_] := ( diff = Table[a[j] - a[i], {i, 1, 2*n+1}, {j, i+1, 2*n+1}] // Flatten // Union; max = diff // Last; notDiff = Complement[Range[max], diff]; If[notDiff == {}, max+1, notDiff // First]); Table[a[n], {n, 1, 39}] (* Jean-François Alcover, Dec 31 2012 *)

Formula

a(1)=1, a(2)=2, a(2n+1) = 2a(2n), a(2n+2) = a(2n+1) + r(n), where r(n) = smallest positive number not of form a(j) - a(i) with 1 <= i < j <= 2n+1.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 14 2000

A048204 a(n) = T(n+1,n), array T given by A048201.

Original entry on oeis.org

2, 6, 11, 19, 29, 43, 58, 74, 95, 117, 142, 168, 196, 229, 263, 298, 334, 372, 412, 454, 500, 548, 597, 647, 700, 757, 817, 879, 943, 1008, 1078, 1155, 1235, 1316, 1399, 1484, 1570, 1660, 1751, 1843, 1943, 2047, 2154, 2262, 2378, 2497, 2621, 2748, 2880, 3013
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, accumulate, islice
    from collections import deque
    def A048204_gen(): # generator of terms
        aset, alist, c = {1}, deque([1]), 0
        for k in count(2):
            if k in aset:
                aset.remove(k)
            else:
                yield (c:=c+k)
                aset |= set(k+d for d in accumulate(alist))
                alist.appendleft(k)
    A048204_list = list(islice(A048204_gen(),50)) # Chai Wah Wu, Sep 01 2025

Formula

a(n) = A004978(n+2) - 2. - Sean A. Irvine, Jun 05 2021

A048205 a(n)=T(n+2,n), array T given by A048201.

Original entry on oeis.org

4, 9, 17, 27, 41, 56, 72, 93, 115, 140, 166, 194, 227, 261, 296, 332, 370, 410, 452, 498, 546, 595, 645, 698, 755, 815, 877, 941, 1006, 1076, 1153, 1233, 1314, 1397, 1482, 1568, 1658, 1749, 1841, 1941, 2045, 2152, 2260, 2376
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A004978.

Programs

  • Python
    from itertools import count, accumulate, islice
    from collections import deque
    def A048205_gen(): # generator of terms
        aset, alist, c = {1,3}, deque([2,1]), 0
        for k in count(3):
            if k in aset:
                aset.remove(k)
            else:
                yield (c:=c+k)
                aset |= set(k+d for d in accumulate(alist))
                alist.appendleft(k)
    A048205_list = list(islice(A048205_gen(),50)) # Chai Wah Wu, Sep 02 2025

Formula

a(n) = A004978(n+3) - 4. - Sean A. Irvine, Jun 05 2021

A048208 a(n) = T(2n-1,n), array T given by A048201.

Original entry on oeis.org

1, 6, 17, 37, 63, 98, 139, 186, 240, 298, 359, 431, 505, 589, 683, 779, 892, 1018, 1150, 1288, 1431, 1593, 1762, 1949, 2151, 2366, 2591, 2823, 3061, 3304, 3557, 3820, 4095, 4367, 4645, 4930, 5222, 5530, 5851, 6176, 6517, 6868, 7222, 7582, 7952, 8331, 8710
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, accumulate, islice
    from collections import deque
    def A048208_gen(): # generator of terms
        aset, alist, b, blist, c = set(), deque(), 1, [], 0
        for k in count(1):
            if k in aset:
                aset.remove(k)
            else:
                if c&1:
                    yield b-blist[c>>1]
                aset |= set(k+d for d in accumulate(alist))
                alist.appendleft(k)
                blist.append(b)
                b += k
                c += 1
    A048208_list = list(islice(A048208_gen(),47)) # Chai Wah Wu, Sep 02 2025

Formula

a(n) = A004978(2*n) - A004978(n). - Sean A. Irvine, Jun 05 2021

Extensions

More terms from Sean A. Irvine, Jun 05 2021

A048210 T(n,1) + T(n,n), array T given by A048201.

Original entry on oeis.org

2, 5, 11, 17, 28, 40, 58, 74, 91, 117, 140, 168, 195, 225, 263, 298, 334, 371, 411, 453, 497, 547, 597, 647, 698, 754, 815, 878, 942, 1008, 1074, 1149, 1233, 1316, 1398, 1483, 1570, 1657, 1751, 1843, 1936, 2044, 2152, 2262, 2371
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, accumulate, islice
    from collections import deque
    def A048210_gen(): # generator of terms
        aset, alist, c = set(), deque(), 0
        for k in count(1):
            if k in aset:
                aset.remove(k)
            else:
                yield (c:=c+k)+k
                aset |= set(k+d for d in accumulate(alist))
                alist.appendleft(k)
    A048210_list = list(islice(A048210_gen(),45)) # Chai Wah Wu, Sep 02 2025

Formula

a(n) = 2*A004978(n+1) - A004978(n) - 1. - Sean A. Irvine, Jun 05 2021
Showing 1-8 of 8 results.