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

A101545 Inverse permutation to A101544.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 10, 6, 11, 13, 14, 9, 16, 17, 19, 20, 12, 22, 23, 25, 26, 15, 28, 29, 31, 32, 34, 18, 35, 37, 38, 21, 40, 41, 43, 44, 46, 24, 47, 49, 50, 27, 52, 53, 55, 56, 58, 30, 59, 61, 62, 33, 64, 65, 67, 68, 36, 70, 71, 73, 74, 39, 76, 77, 79, 80, 82, 42, 83, 85, 86
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 06 2004

Keywords

Comments

A101547(n) = a(a(n)).

Crossrefs

A101546 a(n) = A101544(A101544(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 13, 9, 6, 11, 7, 8, 29, 10, 18, 20, 12, 23, 25, 14, 15, 53, 16, 17, 63, 33, 19, 36, 39, 21, 41, 22, 43, 45, 24, 49, 48, 26, 27, 103, 28, 30, 113, 58, 31, 61, 32, 34, 129, 35, 69, 70, 37, 73, 75, 38, 40, 153, 78, 42, 82, 83, 44, 86, 89, 46, 91, 47, 93, 95, 50, 98
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 06 2004

Keywords

Comments

Inverse permutation to A101547.

Crossrefs

A132677 Period 3: repeat [1, 2, -3].

Original entry on oeis.org

1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3, 1, 2, -3
Offset: 0

Views

Author

Paul Curtz, Nov 15 2007

Keywords

Comments

a(n) is proportional to its 6n-th differences.
Nonsimple continued fraction expansion of 1+sqrt(2/5) = 1.63245553... (see A010494). - R. J. Mathar, Mar 08 2012

Crossrefs

Programs

Formula

G.f.: (1+3*x)/(1+x+x^2). - Jaume Oliver Lafont, Mar 24 2009
a(n) = cos(2*Pi*n/3) + 5*sin(2*Pi*n/3)/sqrt(3). - R. J. Mathar, Oct 08 2011
a(n) + a(n-1) + a(n-2) = 0 for n > 1, a(n) = a(n-3) for n > 2. - Wesley Ivan Hurt, Jul 01 2016

A309157 Rectangular array in 3 columns that solve the complementary equation c(n) = a(n) + b(2n), where a(1) = 1; see Comments.

Original entry on oeis.org

1, 2, 5, 3, 4, 12, 6, 7, 20, 8, 9, 26, 10, 11, 33, 13, 14, 41, 15, 16, 47, 17, 18, 54, 19, 21, 61, 22, 23, 68, 24, 25, 75, 27, 28, 83, 29, 30, 89, 31, 32, 96, 34, 35, 104, 36, 37, 110, 38, 39, 117, 40, 42, 124, 43, 44, 131, 45, 46, 138, 48, 49, 146, 50, 51
Offset: 1

Views

Author

Clark Kimberling, Jul 15 2019

Keywords

Comments

Let A = (a(n)), B = (b(n)), and C = (c(n)). A unique solution (A,B,C) exists for these conditions: (1) A,B,C must partition the positive integers, and (2) A and B are defined by mex (minimal excludant, as in A067017); that is, a(n) is the least "new" positive integer, and likewise for b(n).

Examples

			c(1) = a(1) + b(2) > = 1 + 3, so that
a(2) = mex{1,2} = 3;
b(2) = mex{1,2,3} = 4;
c(1) = 5.
Then c(2) = a(2) + b(4) >= 3 + 8, so that
a(3) = 6, b(3) = 7;
a(4) = 8, b(4) = 9;
c(2) = a(2) + b(4) = 3 + 9 = 12.
   n    a(n) b(n) c(n)
  --------------------
   1      1    2    5
   2      3    4   12
   3      6    7   20
   4      8    9   26
   5     10   11   33
   6     13   14   41
   7     15   16   47
   8     17   18   54
   9     19   21   61
  10     22   23   68
		

Crossrefs

Cf. A326663 (3rd column),
A101544 solves c(n) = a(n) + b(n),
A326661 solves c(n) = a(n) + b(3n),
A326662 solves c(n) = a(2n) + b(2n).

Programs

  • Mathematica
    mex[list_, start_] := (NestWhile[# + 1 &, start, MemberQ[list, #] &]);
    a = b = c = {}; h = 1; k = 2;
    Do[Do[AppendTo[a,
      mex[Flatten[{a, b, c}], Max[Last[a /. {} -> {0}], 1]]];
      AppendTo[b, mex[Flatten[{a, b, c}], Max[Last[b /. {} -> {0}], 1]]], {k}];
      AppendTo[c, a[[h Length[a]/k]] + Last[b]], {150}];
    {a, b, c} // ColumnForm
    a = Take[a, Length[c]]; b = Take[b, Length[c]];
    Flatten[Transpose[{a, b, c}]] (* Peter J. C. Moses, Jul 04 2019 *)

A332341 Prime scale sequence (see comments).

Original entry on oeis.org

-2, -3, 5, -7, -11, -13, 31, -17, -19, -23, 59, -29, -37, -41, 107, -43, -47, -53, -61, -67, 271, -71, -73, -79, 223, -83, -89, -97, 269, -101, -103, -109, 313, -113, -127, -131, -137, -139, 647, -149, -151, -157, 457, -163, -167, -173, 503, -179, -181, -191, -193, -197, 941
Offset: 1

Views

Author

Ivan N. Ianakiev, Feb 10 2020

Keywords

Comments

Take a double-pan balance scale and name the pans "negative" and "positive". At each step, the question is: "Is there an unused prime that would balance the scale if added to the positive pan?" If the answer is positive, add that prime to the positive pan. Otherwise, add the smallest unused prime to the negative pan.
Is the number of primes in the positive pan infinite?

Examples

			2 and 3 unbalance the scale (and are negative), but 5 = 2 + 3 balances it (and is positive).
		

Crossrefs

Programs

  • Mathematica
    a[1]=-2;a[n_]:=a[n]=Module[{tab=Table[a[i],{i,1,n-1}],
    totalN=Abs[Total[Select[Table[a[i],{i,1,n-1}],Negative]]],
    totalP=Total[Select[Table[a[i],{i,1,n-1}],Positive]],
    l=NextPrime[Last[Select[Table[a[i],{i,1,n-1}],Negative]],-1],
    m=NextPrime[Abs[Last[Select[Table[a[i],{i,1,n-1}],Negative]]]]},
    If[totalN==totalP,If[PrimePi[tab[[-1]]]-PrimePi[Abs[tab[[-2]]]]==1,-NextPrime[tab[[-1]]],
    If[FreeQ[Abs[tab],m],-m,While[!FreeQ[Abs[tab],m],m=NextPrime[m]];-m]],
    If[PrimeQ[totalN-totalP]&&FreeQ[Abs[tab],totalN-totalP],totalN-totalP,
    If[FreeQ[Abs[tab],Abs[l]],l,While[!FreeQ[Abs[tab],Abs[l]],l=NextPrime[l,-1]];l]]]];a/@Range[53]
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        used, d, nextp = set(), 0, 2
        while True:
            if d > 0 and d not in used and isprime(d):
                used.add(d); yield d; d = 0
            while nextp in used:
                nextp = nextprime(nextp)
            used.add(nextp); yield -nextp; d += nextp
    print(list(islice(agen(), 53))) # Michael S. Branicky, May 12 2022

A080427 a(1)=1 and, for n>1, a(n) is the smallest positive integer such that the absolute difference |a(n)-a(n-1)| has not occurred previously.

Original entry on oeis.org

1, 1, 2, 4, 1, 5, 10, 1, 7, 14, 1, 9, 19, 1, 12, 24, 1, 15, 30, 1, 17, 34, 1, 20, 40, 1, 22, 44, 1, 25, 50, 1, 27, 54, 1, 29, 59, 1, 32, 64, 1, 35, 70, 1, 37, 74, 1, 39, 79, 1, 42, 84, 1, 45, 90, 1, 47, 94, 1, 49, 99, 1, 52, 104, 1, 55, 110, 1, 57, 114, 1, 60, 120, 1, 62, 124, 1, 65, 130
Offset: 1

Views

Author

John W. Layman, Feb 19 2003

Keywords

Comments

It appears (1) that a(3n+2)=1 for n=1,2,3,... and (2) that the sequence {a(3n+3)-a(3n)}={3,2,2,3,3,2,3,2,3,2,2,3,3,2,2,3,3,2,...} consists only of 2's and 3's and that the sequence of the lengths of runs of consecutive 3's in {a(3n+3)-a(3n)} is given by {1,2,1,1,2,2,2,1,...}=A026465.

Crossrefs

Programs

  • PARI
    { my(s=0, v=1, d); for (n=1, 79, print1 (v, ", "); for (w=1, oo, if (!bittest(s, d=abs(v-w)), s+=2^d; v=w; break))) } \\ Rémy Sigrist, Apr 12 2020

Formula

It appears that abs(a(n+2)-a(n+1)) = A101544(n) for any n > 0. - Rémy Sigrist, Apr 12 2020

A351298 Concatenation of the lexicographically earliest 6-term closed circuits formed on a square grid by distinct segments of length a(n) at right angle.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 6, 8, 9, 10, 15, 18, 11, 12, 13, 14, 24, 26, 16, 17, 19, 20, 35, 37, 21, 22, 23, 25, 44, 47, 27, 28, 29, 30, 56, 58, 31, 32, 33, 34, 64, 66, 36, 38, 39, 40, 75, 78, 41, 42, 43, 45, 84, 87, 46, 48, 49, 50, 95, 98, 51, 52, 53, 54, 104, 106, 55, 57, 59, 60, 114, 117, 61, 62, 63, 65, 124, 127, 67
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Feb 07 2022

Keywords

Examples

			[1, 2, 3, 5, 4, 7]  is a closed circuit on a square grid formed by going 1 cell up (North), 2 cells to the right (East), 3 cells up again (North), 5 cells to the right again (East), 4 cells down (South) and 7 cells to the left (West); the next smallest such circuit is given by [6, 8, 9, 10, 15, 18] as all the terms of the final sequence must be distinct; the next circuit is [11, 12, 13, 14, 24, 26], etc. Concatenating all circuits gives the sequence.
		

Crossrefs

Cf. A101544 (where the array has 3 columns; there are 6 columns here: if we label them a, b, c, d, e, f the terms a + c = e and b + d = f).
Showing 1-7 of 7 results.