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.

Previous Showing 51-60 of 61 results. Next

A195185 Inverse permutation of A195184; every positive integer occurs exactly once.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 10 2011

Keywords

Crossrefs

Programs

  • Mathematica
    p[n_] := If[PrimeQ[n], n, 1]
    Table[p[n], {n, 1, 90}]  (* A089026 *)
    g[1] = {1}; g[n_] := Insert[g[n - 1], n, p[n]]
    f[1] = g[1]; f[n_] := Join[f[n - 1], g[n]]
    f[20] (* A195183 *)
    row[n_] := Position[f[30], n];
    u = TableForm[Table[row[n], {n, 1, 5}]]
    v[n_, k_] := Part[row[n], k];
    w = Flatten[Table[v[k, n - k + 1], {n, 1, 13},
      {k, 1, n}]]  (* A195184 *)
    q[n_] := Position[w, n]; Flatten[
    Table[q[n], {n, 1, 80}]]  (* A195185 *)

A329303 If the run lengths in binary expansion of n are (r(1), ..., r(w)), then the run lengths in binary expansion of a(n) are (r(1), r(3), r(5), ..., r(6), r(4), r(2)).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Dec 01 2019

Keywords

Comments

This sequence is a permutation of the nonnegative integers that preserves the binary length as well as the number of runs. See A330091 for the inverse.

Examples

			For n = 19999:
- the binary representation of 19999 is "100111000011111",
- the corresponding run lengths are (1, 2, 3, 4, 5),
- hence the run lengths of a(n) are (1, 3, 5, 4, 2),
- and its binary representation is "100011111000011",
- so a(n) = 18371.
		

Crossrefs

See A330081 for a similar sequence.
Cf. A003558, A194959, A330091 (inverse).

Programs

  • PARI
    torl(n) = { my (rr=[]); while (n, my (r=valuation(n+(n%2),2)); rr = concat(r, rr); n\=2^r); rr }
    shuffle(v) = { my (w=vector(#v), o=0, e=#v+1); for (k=1, #v, w[if (k%2, o++, e--)]=v[k]); w }
    fromrl(rr) = { my (v=0); for (k=1, #rr, v = (v+(k%2))*2^rr[k]-(k%2)); v }
    a(n) = fromrl(shuffle(torl(n)))

Formula

If n has w binary runs, then a^A003558(w-1)(n) = n (where a^k denotes the k-th iterate of the sequence).

A194919 Inverse permutation of A194918; every positive integer occurs exactly once.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 08 2011

Keywords

Crossrefs

Programs

A195081 Inverse permutation of A195080; every positive integer occurs exactly once.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 08 2011

Keywords

Crossrefs

Programs

A195099 Inverse permutation of A195098; every positive integer occurs exactly once.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 08 2011

Keywords

Crossrefs

Programs

A195109 Inverse permutation of A195108; every positive integer occurs exactly once.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 09 2011

Keywords

Crossrefs

Programs

A195112 Inverse permutation of A195111; every positive integer occurs exactly once.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Sep 09 2011

Keywords

Crossrefs

Programs

A307088 The position function the fractalization of which yields A307081.

Original entry on oeis.org

1, 2, 2, 4, 2, 6, 2, 8, 5, 7, 2, 12, 2, 9, 9, 15, 2, 17, 2, 19, 10, 13, 2, 24, 9, 15, 13, 23, 2, 28, 2, 29, 13, 19, 13, 35, 2, 21, 15, 37, 2, 37, 2, 32, 29, 24, 2, 48, 14, 34, 19, 37, 2, 48, 18, 50, 21, 30, 2, 60, 2, 31, 38, 56, 20, 51, 2, 47, 25, 52, 2, 71
Offset: 1

Views

Author

Luc Rousseau, Mar 23 2019

Keywords

Comments

For a definition of the fractalization process, see comments in A194959. The sequence A307081, triangular array where row n is the list of the numbers from 1 to n sorted in ascending order of f(n) = A095112(n)/n, is clearly the result of a fractalization. Let {a(n)} (this sequence) be its position function.

Examples

			In A307081 in triangular form,
- row 8 is:  1  7  5  3  2  4  6  8
- row 9 is:  1  7  5  3  9  2  4  6  8
Row 9 is row 8 in which 9 has been inserted in position 5, so a(9) = 5.
		

Crossrefs

Cf. A194959 (introducing fractalization).
Cf. A307081 (fractalization of this sequence).
Cf. A307187 (positions of the records of f).
Cf. A095112.

Programs

  • PARI
    f(n)={my(s=0,T); T=factorint(n); for(i=1, #T[,1], for(j=1, T[i,2], s+=1/T[i,1]^j)); s}
    prog(n)={my(V,v,j); V=List(); for(k=1, n, v=f(k)+0.; j=setsearch(V,v,1); if(j==0, print("err"); return, listinsert(V,v,j); print1(j,", ")))}

Formula

a(n)=1 iff n=1.
a(n)=2 iff n is a prime number.
a(n)=n iff n is in A307187.

A323608 The position function the fractalization of which yields A323607.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 5, 4, 6, 5, 8, 6, 9, 7, 12, 8, 12, 9, 15, 10, 15, 11, 19, 12, 18, 13, 22, 14, 21, 15, 27, 16, 24, 17, 29, 18, 27, 19, 34, 20, 30, 21, 36, 22, 33, 23, 42, 24, 36, 25, 43, 26, 39, 27, 49, 28, 42, 29, 50, 30, 45, 31, 58, 32, 48, 33, 57, 34, 51, 35, 64, 36, 54, 37, 64, 38, 57, 39, 73
Offset: 1

Views

Author

Luc Rousseau, Jan 19 2019

Keywords

Comments

For a definition of the fractalization process, see comments in A194959. The sequence A323607, triangular array where row n is the list of the numbers from 1 to n sorted in Sharkovsky order, is clearly the result of a fractalization. Let {a(n)} (this sequence) be its position function.

Examples

			In A323607 in triangular form,
- row 5 is:  3  5  4  2  1
- row 6 is:  3  5  6  4  2  1
Row 6 is row 5 in which 6 has been inserted in position 3, so a(6) = 3.
		

Crossrefs

Cf. A194959 (introducing fractalization).
Cf. A323607 (fractalization of this sequence).
Cf. A000325.

Programs

  • Mathematica
    lt[x_, y_] := Module[
      {c, d, xx, yy, u, v},
      {c, d} = IntegerExponent[#, 2] & /@ {x, y};
      xx = x/2^c;
      yy = y/2^d;
      u = If[xx == 1, \[Infinity], c];
      v = If[yy == 1, \[Infinity], d];
      If[u != v, u < v, If[u == \[Infinity], c > d, xx < yy]]]
    row[n_] := Sort[Range[n], lt]
    a[n_] := First[FirstPosition[row[n], n]]
    Table[a[n], {n, 1, 80}]

Formula

Empirical observations: (Start)
For all odd numbers x >= 3,
a(x) = (1/2)*x - 1/2,
a(2x) = (3/4)*(2x) - 3/2,
a(4x) = (7/8)*(4x) - 5/2,
a(8x) = (15/16)*(8x) - 7/2,
etc.
For all c, a(2^c) = A000325(c) = 2^c-c.
Summarized by:
a((2^c)*(2k+1)) = A126646(c)*k + A000295(c) + A000007(k) = (2^(c+1)-1)*k + (2^c-1-c) + [k==0].
(End)
From Luc Rousseau, Apr 01 2019: (Start)
It appears that for all k > 0,
a(4k + 0) = 3k - 2 + a(k),
a(4k + 1) = 2k,
a(4k + 2) = 3k,
a(4k + 3) = 2k + 1.
(End)

A328720 The position function the fractalization of which yields A328719.

Original entry on oeis.org

1, 2, 2, 4, 2, 5, 2, 8, 5, 7, 2, 11, 2, 9, 7, 16, 2, 14, 2, 17, 9, 13, 2, 23, 9, 15, 14, 23, 2, 22, 2, 32, 13, 19, 11, 32, 2, 21, 15, 37, 2, 30, 2, 35, 22, 25, 2, 47, 14, 34, 19, 41, 2, 41, 17, 51, 21, 31, 2, 52, 2, 33, 30, 64, 19, 46, 2, 53, 25, 46, 2, 68, 2
Offset: 1

Views

Author

Luc Rousseau, Oct 26 2019

Keywords

Comments

For a definition of the fractalization process, see comments in A194959. The sequence A328719, triangular array where row n is the list of the numbers k from 1 to n sorted in ascending lexicographic order of their sequences of p-adic valuations, is clearly the result of a fractalization. Let {a(n)} (this sequence) be its position function.

Examples

			In A328719 in triangular form, rows 19 and 20 are:
  1, 19, 17, 13, 11,  7,  5,  3, 15,  9,  2, 14, 10,  6, 18,  4, 12,  8, 16;
  1, 19, 17, 13, 11,  7,  5,  3, 15,  9,  2, 14, 10,  6, 18,  4, 20, 12,  8, 16.
Row 20 is row 19 in which 20 has been inserted in position 17, so a(20) = 17.
		

Crossrefs

Programs

  • PARI
    L=List();n=1;while(n<=100,i=1;while(i
    				

Formula

a(1) = 1.
a(p) = 2 iff p is a prime number.
a(2^k) = 2^k.
a(3^k) = (3^k+1)/2 = A007051(k).
A328719(n, a(n)) = n. - Rémy Sigrist, Nov 11 2019
Previous Showing 51-60 of 61 results. Next