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.

A064579 Inverse permutation to A054082.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 16 2001

Keywords

Crossrefs

Cf. A054082.

Programs

  • Maple
    A054082 := proc(nmax) local a,k,n,p ; a := [2,1] ; while nops(a) < nmax do n := nops(a)+1 : k := floor((n+1)/2) ; p := 1; while p in a do p := p+1 ; od ; if n mod 2 = 1 then a := [op(a), p+k-1] ; else a := [op(a), p] ; fi ; od ; RETURN(a) ; end: A064579 := proc(a054082) local a,n,ainv ; n := 1; a := [] ; while member(n,a054082,'ainv') do a := [op(a),ainv] ; n := n+1; od; RETURN(a) ; end: a054082 := A054082(200) : a064579 := A064579(a054082) : print(op(a064579)) ; # R. J. Mathar, Jun 27 2007
  • Mathematica
    a[n_] := If[OddQ[n], Floor[((n+1)/2 - 1) GoldenRatio] + (n+1)/2 + 1, Floor[(n/2 - 1) GoldenRatio] + 2]; a[2] = 1;
    Sort[Array[{a[#], #}&, 100]][[All, 2]] (* Jean-François Alcover, Apr 01 2020 *)

Extensions

Corrected and extended by R. J. Mathar, Jun 27 2007

A054083 a(n) = order of n in the permutation A054082 of the natural numbers if this order exists; a(n) = -1 otherwise.

Original entry on oeis.org

2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 9, 7, 9, 9, 9, 9, 9, 9, -1, 9, -1, 9, -1, -1, -1, -1, 16, -1, 16, -1, 16, -1, -1, 16, 16, 16, 16, 16, -1, -1, 16, 16, -1, 16, -1, 16, -1, -1, 16, -1, -1, 16, -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1, -1, -1, -1
Offset: 1

Views

Author

Keywords

Comments

From Peter J. C. Moses, Jan 26 2022: (Start)
For n up to 60000,
a(n) = 2 for n = 1, 2, 3, 4;
a(n) = 7 for n = 5, 6, 7, 8, 9, 10, 12
a(n) = 9 for n = 11, 13, 14, 15, 16, 17, 18, 20, 22
a(n) = 16 for n = 27, 29, 31, 34, 35, 36, 37, 38, 41, 42, 44, 46, 49, 52, 54, 64
a(n) = 25 for n = 267, 283, 330, 343, 350, 371, 385, 393, 408, 424, 449, 467, 476, 486, 495, 504, 515, 524, 545, 578, 588, 612, 648, 674, 714. (End)

Examples

			5 -> 7 -> 9 -> 12 -> 10 -> 8-> 6-> 5, so that 5 has order 7.
		

Crossrefs

Programs

  • Mathematica
    a054082[n_] := a054082[n] = If[OddQ[n], Floor[((n + 1)/2 - 1) GoldenRatio] + (n + 1)/2 + 1,
    Floor[(n/2 - 1) GoldenRatio] + 2]; a054082[2] = 1;
    Array[a054082[#] &, 40]  (* after Jean-François Alcover *)
    Table[Length[NestWhileList[a054082, a054082[n], # != n &, 1,
        10000]] /. (10001 -> -1), {n, 1, 500}]
    (* Peter J. C. Moses, Jan 26 2022 *)

Extensions

Data truncated by Sean A. Irvine, Jan 23 2022
Edited by Clark Kimberling, Jan 26 2022

A054084 Permutation of N: for each k >= 1, let p(k)=least natural number not already an a(i), q(k)=p(k)+k, a(2k-1)=q(k), a(2k)=p(k).

Original entry on oeis.org

2, 1, 5, 3, 7, 4, 10, 6, 13, 8, 15, 9, 18, 11, 20, 12, 23, 14, 26, 16, 28, 17, 31, 19, 34, 21, 36, 22, 39, 24, 41, 25, 44, 27, 47, 29, 49, 30, 52, 32, 54, 33, 57, 35, 60, 37, 62, 38, 65, 40, 68, 42, 70, 43, 73, 45, 75, 46, 78, 48, 81, 50, 83
Offset: 1

Views

Author

Keywords

Crossrefs

Odd-indexed terms: A001950 (Upper Wythoff sequence). Even-indexed terms: A000201 (Lower Wythoff sequence). Inverse permutation: A064786.

Programs

  • Python
    from math import isqrt
    def A054084(n): return ((m:=n+1>>1)+isqrt(5*m**2)>>1)+m*(n&1) # Chai Wah Wu, Aug 25 2022
Showing 1-3 of 3 results.