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.

User: Luc Rousseau

Luc Rousseau's wiki page.

Luc Rousseau has authored 71 sequences. Here are the ten most recent ones:

A378734 Number of multisets E(n) generable by the following procedure: E(0) = { 0, 0, ... }; to get an E(n+1) from an E(n), first increment all elements then optionally choose an x and a y and replace them with 0 and x+y.

Original entry on oeis.org

1, 2, 6, 23, 108, 579, 3447, 22190, 152407, 1103566, 8355894, 65701413
Offset: 0

Author

Luc Rousseau, Dec 06 2024

Keywords

Comments

Let there be an infinite number of producers whose initial stocks are equal to 0. At each step (n >= 1), each producer produces 1 resource and adds it to its stock; then a facetious imp may decide to move one producer's stock to another's. a(n) is the number of possible configurations after n steps.

Examples

			E(0) is:
        { 0, 0, 0, 0, 0, 0, ... }
E(1) can be:
   A := { 1, 1, 1, 1, 1, 1, ... } // A = E(0) + 1
   B := { 0, 2, 1, 1, 1, 1, ... } // B is A where a 1 moved onto a 1: B = A<1,1>
E(2) can be:
   C := { 2, 2, 2, 2, 2, 2, ... } // C = A + 1
   D := { 1, 3, 2, 2, 2, 2, ... } // D = B + 1
        { 0, 4, 2, 2, 2, 2, ... } // = C<2,2> = D<1,3> = D<3,1>
        { 0, 3, 3, 2, 2, 2, ... } // = D<1,2> = D<2,1>
        { 0, 1, 5, 2, 2, 2, ... } // = D<2,3> = D<3,2>
        { 0, 1, 3, 4, 2, 2, ... } // = D<2,2>
So, the sequence starts: 1, 2, 6, ...
		

A374601 Defined by: Sum_{i=1..n} i*a(i)/n^i = 1, n>=1.

Original entry on oeis.org

1, 1, 4, 28, 278, 3554, 55382, 1015750, 21401830, 508932130, 13475090126, 393026736854, 12518884854734, 432357148756210, 16092438499462630, 642170913160160710, 27351173629037613494, 1238472705706192189442, 59411223892666111129022, 3010044856761072109710262
Offset: 1

Author

Luc Rousseau, Jul 13 2024

Keywords

Examples

			1*a(1)/1^1 = 1, so a(1) = 1.
1*a(1)/2^1 + 2*a(2)/2^2 = 1, so a(2) = 1.
1*a(1)/3^1 + 2*a(2)/3^2 + 3*a(3)/3^3 = 1, so a(3) = 4.
		

Crossrefs

Cf. A374562.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<1, 0,
          n^(n-1)-add(n^(n-1-i)*a(i)*i, i=1..n-1))
        end:
    seq(a(n), n=1..20);  # Alois P. Heinz, Jul 13 2024
  • Mathematica
    a[n_]:=a[n]=n^(n-1)-Sum[n^(n-1-i)*i*a[i],{i,1,n-1}]
  • PARI
    a(n)=n^(n-1)-sum(i=1,n-1,n^(n-1-i)*i*a(i))

Formula

a(n) = n^(n-1) - Sum_{i=1..n-1} n^(n-1-i)*i*a(i).
a(n) = A374562(n)/n.

A374562 Defined by: Sum_{i=1..n} a(i) / n^i = 1, n >= 1.

Original entry on oeis.org

1, 2, 12, 112, 1390, 21324, 387674, 8126000, 192616470, 5089321300, 148225991386, 4716320842248, 162745503111542, 6053000082586940, 241386577491939450, 10274734610562571360, 464969951693639429398, 22292508702711459409956, 1128813253960656111451418, 60200897135221442194205240
Offset: 1

Author

Luc Rousseau, Jul 12 2024

Keywords

Comments

Constant terms of the following polynomials: P(0,x) = -1 and, for n>0, P(n,x) = x*P(n-1,x) + a(n), a(n) chosen such that P(n,n)=0.

Examples

			a(1) = 1^1 = 1.
a(2) = 2^2 - 2^1*a(1) = 2.
a(3) = 3^3 - 3^2*a(1) - 3^1*a(2) = 12.
a(1) = + 1^1                  ( 0---1 )
     = 1.
a(2) = + 2^2                  ( 0-------2 )
       - 2^1 * 1^1            ( 0---1---2 )
     = 2.
a(3) = + 3^3                  ( 0-----------3 )
       - 3^2 * 1^1            ( 0---1-------3 )
       - 3^1 * 2^2            ( 0-------2---3 )
       + 3^1 * 2^1 * 1^1      ( 0---1---2---3 )
     = 12.
		

Crossrefs

Cf. A374601.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<1, 0,
           n^n-add(n^(n-i)*a(i), i=1..n-1))
        end:
    seq(a(n), n=1..20);  # Alois P. Heinz, Jul 13 2024
  • Mathematica
    a[n_] := a[n] = n^n - Sum[n^(n - i)*a[i], {i, 1, n - 1}]
    a /@ Range[20]
  • PARI
    a(n)=n^n-sum(i=1,n-1,n^(n-i)*a(i))

Formula

a(n) = n^n - Sum_{i=1..n-1} n^(n-i)*a(i).
a(n) = -Sum_{c composition of n} ((-1)^(#c) * Product_{k=1..#c} (n - (Sum_{i
a(n) = n * A374601(n).

A373325 Number of semi-infinite curves of the plane with n simple, transverse self-intersections and no other self-intersections, up to an orientation-preserving homeomorphism.

Original entry on oeis.org

1, 2, 10, 66, 498, 4072, 35144, 315352, 2914074, 27553880, 265387528, 2595131328
Offset: 0

Author

Luc Rousseau, Jun 01 2024

Keywords

Examples

			Curves without self-intersection are equivalent; one might for instance take the half-line y <= 0 as their representative; so a(0) = 1.
To get a curve with n+1 self-intersections, one can start from a curve with n self-intersections; identify the cycle of oriented edges that directly surrounds the finite extremity of the curve; choose an edge from that cycle and extend the curve so that it crosses that edge.
When "outside" it might help visualization to imagine that a noncrossable oriented edge "at infinity" closes the cycle.
Thus, for a transition between 0 and 1 self-intersection, the choice is between making a loop that turns left and making a loop that turns right; so a(1) = 2.
See provided illustration for n=0..3 in section 'Links'.
		

Crossrefs

A367795 Triangle read by rows, where row n = L(n) is defined by L(1) = [1,0] and L(n+1) is obtained from L(n) by inserting their binary concatenation between elements x,y.

Original entry on oeis.org

1, 0, 1, 2, 0, 1, 6, 2, 4, 0, 1, 14, 6, 26, 2, 20, 4, 8, 0, 1, 30, 14, 118, 6, 218, 26, 106, 2, 84, 20, 164, 4, 72, 8, 16, 0, 1, 62, 30, 494, 14, 1910, 118, 950, 6, 1754, 218, 7002, 26, 3434, 106, 426, 2, 340, 84, 2708, 20, 5284, 164, 1316, 4, 584, 72, 1160, 8, 272, 16, 32, 0
Offset: 1

Author

Luc Rousseau, Nov 30 2023

Keywords

Comments

0 is considered to be a 1-bit-long number and has 0 for binary expansion.
The numbers of bits of the numbers in this triangle are provided by the A049456 triangle.
The sorted set of the numbers that occur in some row of this triangle is provided by A367745.

Examples

			Triangle begins:
  1 0
  1 2 0
  1 6 2 4 0
  1 14 6 26 2 20 4 8 0
  1 30 14 118 6 218 26 106 2 84 20 164 ...
Or the same in binary:
  1 0
  1 10 0
  1 110 10 100 0
  1 1110 110 11010 10 10100 100 1000 0
  1 11110 1110 1110110 110 11011010 11010 1101010 10 1010100 10100 10100100 ...
		

Crossrefs

Programs

  • PARI
    sz(n)=if(n==0, 1, logint(n, 2)+1)
    L(n)=if(n==1, List([1, 0]), my(LL=L(n-1), k=#LL); while(k>1, listinsert(LL, (LL[k-1] << sz(LL[k])) + LL[k], k); k--); LL)
    for(k=1,8,my(l=L(k));for(i=1,#l,print1(l[i],", ")))
    
  • Python
    from itertools import chain, count, islice, zip_longest
    def agen(): # generator of terms
        L = ["1", "0"]
        for k in count(1):
            yield from (int(t, 2) for t in L)
            Lnew = [s+t for s, t in zip(L[:-1], L[1:])]
            L = [t for t in chain(*zip_longest(L, Lnew)) if t is not None]
    print(list(islice(agen(), 69))) # Michael S. Branicky, Nov 30 2023

Formula

Length of row n = #L(n) = 2^(n-1) + 1 = A000051(n-1).

A367745 Numbers which occur anywhere in A367795, i.e. in lists L(k) where L(1) = [1,0] and L(k+1) is obtained from L(k) by inserting their binary concatenation between elements x,y.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 14, 16, 20, 26, 30, 32, 62, 64, 72, 84, 106, 118, 126, 128, 164, 218, 254, 256, 272, 340, 426, 494, 510, 512, 584, 950, 1022, 1024, 1056, 1160, 1316, 1364, 1706, 1754, 1910, 2014, 2046, 2048, 2708, 3434, 4094, 4096, 4160, 4368, 4680, 5284, 5460, 6826, 7002, 7606, 7918, 8126, 8190
Offset: 1

Author

Luc Rousseau, Nov 29 2023

Keywords

Comments

0 is considered to be a 1-bit-long number and has 0 for binary expansion.
Empirically, there are A000010(n) positive terms with n binary digits. - Rémy Sigrist, Jan 01 2024

Examples

			The L(k) lists written in binary begin:
L(1) = [1, 0]
L(2) = [1, 10, 0] -- 10 inserted between 1 and 0
L(3) = [1, 110, 10, 100, 0] -- 110 inserted between 1 and 10, 100 between 10 and 0
L(4) = [1, 1110, 110, 11010, 10, 10100, 100, 1000, 0] -- etc.
0, 1, 10, 100, 110, 1000, ... are producible binary expansions, so the corresponding numbers (0, 1, 2, 4, 6, 8, ...) are in this sequence.
		

Crossrefs

Cf. A000010, A367795 (the triangle of L(k) lists).

Programs

  • PARI
    sz(n)=if(n==0,1,logint(n,2)+1)
    L(n)=if(n==1, List([1, 0]), my(LL=L(n-1), k=#LL); while(k>1, listinsert(LL, (LL[k-1] << sz(LL[k])) + LL[k], k); k--); LL)
    list_a(depth)=my(aa=vecsort(L(depth)), i=1, j=2^depth); while(i<=#aa&&aa[i]
    				
  • PARI
    explore(w, p, s) = { my (ps=concat(p, s)); if (#ps <= w, if (nb++ > #vv, vv=concat(vv, vector(#vv))); vv[nb]=fromdigits(ps,2); explore(w, p, ps); explore(w, ps, s);); }
    list_a(w) = { nb = 2; vv = [1,0]; explore(w,[1],[0]); Set(vv[1..nb]); } \\ terms < 2^w; Rémy Sigrist, Jan 01 2024
    
  • Python
    from itertools import chain, count, islice, zip_longest
    def agen(): # generator of terms
        L = ["1", "0"]
        for k in count(1):
            yield from sorted(int(t, 2) for t in L if len(t) == k)
            Lnew = [s+t for s, t in zip(L[:-1], L[1:])]
            L = [t for t in chain(*zip_longest(L, Lnew)) if t is not None]
    print(list(islice(agen(), 60))) # Michael S. Branicky, Nov 30 2023

A364311 Lexicographically earliest infinite sequence of nonnegative integers, {a(n)} for n>=0, such that all lines with equations y = a(n)*x + n are in general position.

Original entry on oeis.org

0, 1, 3, 2, 5, 4, 8, 11, 6, 13, 12, 7, 22, 16, 17, 21, 9, 14, 10, 27, 18, 15, 19, 28, 31, 43, 34, 38, 23, 39, 25, 36, 41, 20, 55, 63, 42, 30, 24, 33, 26, 32, 65, 66, 51, 59, 29, 56, 35, 62, 85, 81, 37, 49, 46, 68, 74, 78, 88, 48, 44, 75, 40, 47, 97, 76, 93, 79, 92, 54, 58, 100, 61, 101, 107, 52
Offset: 0

Author

Luc Rousseau, Sep 22 2023

Keywords

Comments

By "in general position" we mean that no two lines are parallel or coincident, and no three are concurrent.

Examples

			Line #0 is y = 0*x + 0, as no constraint other than the default one (lexicographically earliest) applies yet, so a(0)=0;
Line #1 cannot be y = 0*x + 1, as the reuse of the slope of a previously defined line implies parallelism; but it can be y = 1*x + 1, so a(1)=1;
Line #2 cannot be y = 2*x + 2, as lines #0, #1 and #2 would be concurrent at (-1,0); but Line #2 can be y = 3*x + 2, so a(2)=3; ...
		

Crossrefs

Cf. A000217 (number of intersection points to avoid after line #n is created).

Programs

  • PARI
    g(n,an,p)=my(b=1);for(i=1,#p,if(p[i][2]==an*p[i][1]+n,b=0;break));b
    c(n,s,p)=my(an=0);while((setsearch(s,an,0)!=0)||!g(n,an,p),an++);an
    w(n,a,an,p)=for(m=0,#a-1,my(am=a[1+m]);listput(p,[(m-n)/(an-am),(am*n-an*m)/(am-an)]));p
    list_a(N)=my(a=List(),s=List(),p=List(),n=0,an);while(n<=N,an=c(n,s,p);p=w(n,a,an,p);listput(a,an);listinsert(s,an,setsearch(s,an,1));n++);Vec(a)
    list_a(75)

A362978 The y-coordinates of the even-ranked elements of the lexicographically earliest sequence of points satisfying staircase and no-three-in-a-line conditions. Companion sequence of A362977.

Original entry on oeis.org

0, 1, 3, 2, 4, 7, 5, 8, 12, 11, 10, 6, 13, 23, 20, 14, 28, 21, 15, 24, 9, 35, 43, 38, 37, 52, 33, 45, 36, 32, 22, 44, 46, 59, 53, 54, 64, 19, 34, 27, 72, 70, 84, 74, 55, 49, 26, 50, 17, 31, 77, 56, 107, 85, 47, 60, 16, 62, 29, 25, 69, 41, 42, 106, 82, 61, 65
Offset: 0

Author

Luc Rousseau, May 11 2023

Keywords

Comments

This sequence is tightly coupled to A362977, which is the main entry. See A362977.

Crossrefs

Cf. A362977 (the corresponding x-coordinates).

A362977 The x-coordinates of the even-ranked elements of the lexicographically earliest sequence of points satisfying staircase and no-three-in-a-line conditions (see comments).

Original entry on oeis.org

0, 1, 2, 5, 6, 3, 12, 13, 4, 15, 8, 27, 19, 11, 9, 32, 25, 16, 33, 35, 59, 30, 24, 7, 51, 45, 10, 18, 29, 26, 54, 58, 14, 53, 23, 34, 37, 49, 44, 60, 43, 31, 41, 66, 17, 72, 80, 81, 78, 88, 87, 46, 83, 22, 76, 79, 130, 97, 108, 111, 94, 119, 153, 89, 39, 112
Offset: 0

Author

Luc Rousseau, May 11 2023

Keywords

Comments

We construct the lexicographically earliest sequence of points M(i), for i >= 0, with the following rules:
- their (x, y) coordinates are taken among the nonnegative integers;
- if i > 0 and i is odd, then "move horizontally to a free column"; i.e., M(i) must have the same y as M(i-1), and M(i) is not allowed to have the same x as any M(k) for k < i;
- if i > 0 and i is even, then "move vertically to a free row"; i.e., M(i) must have the same x as M(i-1), and M(i) is not allowed to have the same y as any M(k) for k < i;
- three points are not allowed to be aligned.
See SVG illustration, Links section.
Then a(n) (resp. A362978(n)) is defined as the x-coordinate (resp. y-coordinate) of M(i), where i := 2n (to eliminate duplicates).

Examples

			  y
  ^
  | . . . 9 . . 8
  | . . 4 . . 5 .
  | . . . . . 6 7
  | . 2 3 . . . .
  | 0 1 . . . . .
  +-------------------> x
    0 1 2 3 4 5 6
Abscissas of the points 0, 2, 4, 6, 8, ...: 0, 1, 2, 5, 6, ...
		

Crossrefs

Cf. A362978 (the corresponding y-coordinates).
Cf. A161680 (number of nonalignment checks to pass).

Programs

  • Java
    // See Rousseau link.

A360303 a(n) = Sum_{k=1..floor(sqrt(n))} 2^floor(n/k-k).

Original entry on oeis.org

0, 1, 2, 4, 9, 17, 34, 66, 132, 261, 521, 1033, 2066, 4114, 8226, 16420, 32837, 65605, 131209, 262281, 524554, 1048850, 2097682, 4194834, 8389668, 16778277, 33556517, 67110981, 134221897, 268439625, 536879242, 1073750154, 2147500178, 4294983954, 8589967634, 17179902228, 34359804453
Offset: 0

Author

Luc Rousseau, Feb 02 2023

Keywords

Comments

This sequence corresponds to the left half of a drawing, the whole drawing being reconstituted by symmetry (see the Illustration link). The divisors of n are closely related to the occurrences of the bit pattern "01 over 10" in the 2 X 2 squares along the (n-1)th and n-th lines (see the pattern link). In particular, n is a prime number if and only if a(n) - a(n-1) = 2^(n-2).

Examples

			For n = 5, floor(sqrt(n)) = 2. So, two bits are set in a(n); they are the bits number floor(5/1-1)=4 and floor(5/2-2)=0, so a(n) = 10001_2 = 17.
		

Crossrefs

Cf. A034729.

Programs

  • PARI
    a(n)=sum(k=1,floor(sqrt(n)),2^floor(n/k-k))

Formula

a(n) = Sum_{k=1..floor(sqrt(n))} 2^floor(n/k - k).