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-10 of 38 results. Next

A163358 Inverse permutation to A163357.

Original entry on oeis.org

0, 1, 4, 2, 5, 9, 13, 8, 12, 18, 24, 17, 11, 7, 3, 6, 10, 16, 22, 15, 21, 28, 37, 29, 38, 47, 58, 48, 39, 30, 23, 31, 40, 50, 60, 49, 59, 70, 83, 71, 84, 97, 112, 98, 85, 72, 61, 73, 62, 52, 42, 51, 41, 32, 25, 33, 26, 19, 14, 20, 27, 34, 43, 35, 44, 54, 64, 53, 63, 74, 87
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Comments

abs(A025581(a(n+1)) - A025581(a(n))) + abs(A002262(a(n+1)) - A002262(a(n))) = 1 for all n.

Crossrefs

Inverse: A163357. a(n) = A054239(A163356(n)). One-based version: A163362. See also A163334 and A163336.

A302781 Divisor-or-multiple permutation of natural numbers constructed from two-dimensional Hilbert curve (A163357) and Fermi-Dirac primes (A050376).

Original entry on oeis.org

1, 2, 6, 3, 15, 5, 10, 30, 120, 40, 20, 60, 12, 24, 8, 4, 28, 84, 168, 56, 14, 7, 21, 42, 210, 105, 35, 70, 280, 840, 420, 140, 1260, 3780, 7560, 2520, 630, 315, 945, 1890, 378, 189, 63, 126, 504, 1512, 756, 252, 36, 72, 216, 108, 540, 180, 360, 1080, 270, 90, 45, 135, 27, 54, 18, 9, 117, 351, 702, 234, 936, 468
Offset: 0

Views

Author

Antti Karttunen, Apr 14 2018

Keywords

Comments

Note that the starting offset is 0, to align with A052330 and A207901.
Shares with A064736, A207901, A298480, A302350, A302783, A303771, etc. the property that a(n) is either a divisor or a multiple of a(n+1). Permutations satisfying such property are called "divisor-or-multiple permutations" in the OEIS, although Mazet & Saias call them "chain permutations" in their paper. [Edited by Antti Karttunen, Aug 26 2018]
One way to construct such permutations is by composing A052330 from the right with any such permutation like A003188 or A302846 where the binary expansions of a(n) and a(n+1) always differ by just a single bit-position.
Further permutations satisfying the same condition could be constructed from higher-dimensional versions (i.e., greater than 2) of Hilbert's space-filling curves, where the coordinates of each dimension would be Gray coded separately and then interleaved together. Permutation A207901 is essentially a one-dimensional variant of the same idea, while this is constructed from the 2-dimensional curve A163357, which is a Hamiltonian path on N X N grid.
See Peter Munn's A300012 for another idea for constructing such a permutation. - Antti Karttunen, Aug 26 2018

Crossrefs

Programs

  • PARI
    up_to_e = 14;
    v050376 = vector(up_to_e);
    A050376(n) = v050376[n];
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break));
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A064706(n) = bitxor(n, n>>2);
    A057300(n) = { my(t=1,s=0); while(n>0, if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); };
    A163356(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); (((((2+(i%2))^d)%5)-1)*f) + if(3==d,f-1-A163356(r),A057300(A163356(r))));
    A302781(n) = A052330(A064706(A163356(n)));

Formula

a(n) = A052330(A302846(n)), where A302846(n) = A000695(A003188(A059253(n))) + 2*A000695(A003188(A059252(n))).

Extensions

Name edited by Antti Karttunen, Aug 26 2018

A163540 The absolute direction (0=east, 1=south, 2=west, 3=north) taken by the type I Hilbert's Hamiltonian walk A163357 at the step n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Comments

Taking every sixteenth term gives the same sequence: (and similarly for all higher powers of 16 as well): a(n) = a(16*n).

Crossrefs

a(n) = A163540(A008598(n)) = A004442(A163541(n)). See also A163542.

Programs

  • Mathematica
    HC = {L[n_ /; IntegerQ[n/2]] :> {F[n], L[n], L[n + 1], R[n + 2]},
       R[n_ /; IntegerQ[(n + 1)/2]] :> {F[n], R[n], R[n + 3], L[n + 2]},
       R[n_ /; IntegerQ[n/2]] :> {L[n], R[n + 1], R[n], F[n + 3]},
       L[n_ /; IntegerQ[(n + 1)/2]] :> {R[n], L[n + 3], L[n], F[n + 1]},
       F[n_ /; IntegerQ[n/2]] :> {L[n], R[n + 1], R[n], L[n + 3]},
       F[n_ /; IntegerQ[(n + 1)/2]] :> {R[n], L[n + 3], L[n], R[n + 1]}};
    a[1] = F[0]; Map[(a[n_ /; IntegerQ[(n - #)/16]] :=
        Part[Flatten[a[(n + 16 - #)/16] /. HC /. HC], #]) &, Range[16]];
    Part[FoldList[Mod[Plus[#1, #2], 4] &, 0,
      a[#] & /@ Range[4^4] /. {F[n_] :> 0, L[n_] :> 1, R[n_] :> -1}],
    2 ;; -1] (* Bradley Klee, Aug 07 2015 *)
  • Scheme
    (define (A163540 n) (modulo (+ 3 (A163538 n) (A163539 n) (abs (A163539 n))) 4))

Formula

a(n) = A010873(A163538(n)+A163539(n)+abs(A163539(n))+3).

A163542 The relative direction (0=straight ahead, 1=turn right, 2=turn left) taken by the type I Hilbert's Hamiltonian walk A163357 at the step n.

Original entry on oeis.org

1, 1, 2, 0, 2, 2, 1, 1, 2, 2, 0, 2, 1, 1, 0, 1, 2, 2, 1, 0, 1, 1, 2, 2, 1, 1, 0, 1, 2, 2, 0, 0, 2, 2, 1, 0, 1, 1, 2, 2, 1, 1, 0, 1, 2, 2, 1, 0, 1, 1, 2, 0, 2, 2, 1, 1, 2, 2, 0, 2, 1, 1, 2, 0, 2, 2, 1, 0, 1, 1, 2, 2, 1, 1, 0, 1, 2, 2, 0, 2, 1, 1, 2, 0, 2, 2, 1, 1, 2, 2, 0, 2, 1, 1, 0, 0, 1, 1, 2, 0, 2, 2
Offset: 1

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Comments

a(16*n) = a(256*n) for all n.

Crossrefs

a(n) = A014681(A163543(n)). See also A163540.

Programs

  • Mathematica
    HC = {L[n_ /; IntegerQ[n/2]] :> {F[n], L[n], L[n + 1], R[n + 2]},
       R[n_ /; IntegerQ[(n + 1)/2]] :> {F[n], R[n], R[n + 3], L[n + 2]},
       R[n_ /; IntegerQ[n/2]] :> {L[n], R[n + 1], R[n], F[n + 3]},
       L[n_ /; IntegerQ[(n + 1)/2]] :> {R[n], L[n + 3], L[n], F[n + 1]},
       F[n_ /; IntegerQ[n/2]] :> {L[n], R[n + 1], R[n], L[n + 3]},
       F[n_ /; IntegerQ[(n + 1)/2]] :> {R[n], L[n + 3], L[n], R[n + 1]}};
    a[1] = L[0]; Map[(a[n_ /; IntegerQ[(n - #)/16]] :=
        Part[Flatten[a[(n + 16 - #)/16] /. HC /. HC], #]) &, Range[16]];
    Part[a[#] & /@ Range[4^4] /. {L[] -> 2, R[] -> 1, F[_] -> 0},
    2 ;; -1] (* Bradley Klee, Aug 07 2015 *)
  • Scheme
    (define (A163542 n) (A163241 (modulo (- (A163540 (1+ n)) (A163540 n)) 4)))

Formula

a(n) = A163241((A163540(n+1)-A163540(n)) modulo 4).

A163547 The square of the distance from the origin to the n-th term in the type I Hilbert's Hamiltonian walk A163357.

Original entry on oeis.org

0, 1, 2, 1, 4, 9, 10, 5, 8, 13, 18, 13, 10, 5, 4, 9, 16, 17, 26, 25, 36, 49, 50, 37, 40, 53, 58, 45, 34, 29, 20, 25, 32, 41, 50, 41, 52, 65, 74, 61, 72, 85, 98, 85, 74, 61, 52, 65, 58, 53, 40, 45, 34, 25, 20, 29, 26, 17, 16, 25, 36, 37, 50, 49, 64, 81, 82, 65, 68, 73, 90, 85
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

See also: A059261, A163531.

Formula

a(n) = A000290(A059252(n))+A000290(A059253(n)).

A163898 Array A(i,j) giving the square of distance from (i,j) to the location where A054238(i,j) is situated in array A163357(i,j), listed antidiagonally as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ...

Original entry on oeis.org

0, 0, 1, 8, 1, 4, 18, 5, 2, 9, 0, 5, 2, 5, 16, 2, 1, 2, 9, 10, 25, 0, 1, 4, 9, 16, 17, 36, 0, 1, 4, 9, 16, 25, 36, 49, 128, 1, 2, 1, 10, 9, 10, 25, 64, 162, 113, 4, 5, 18, 5, 4, 5, 50, 81, 128, 113, 100, 9, 10, 5, 10, 1, 64, 65, 100, 128, 113, 100, 89, 16, 17, 20, 25, 64, 81, 100
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Examples

			The top left 8 X 8 corner of this array:
   0  0  8 18  0  2  0  0
   1  1  5  5  1  1  1  1
   4  2  2  2  4  4  2  4
   9  5  9  9  9  1  5  9
  16 10 16 16 10 18 10 16
  25 17 25  9  5  5 17 25
  36 36 10  4 10 20 36 36
  49 25  5  1 25 29 25 49
		

Crossrefs

a(n) = A163900(A054238(n)). Positions of zeros: A165403. See also A163899, A163904.

A163899 Array A(i,j) giving the square of distance from (i,j) to the location where A163357(i,j) is situated in array A054238(i,j), listed antidiagonally as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ...

Original entry on oeis.org

0, 0, 1, 9, 1, 8, 9, 2, 5, 18, 0, 2, 4, 5, 25, 1, 2, 5, 2, 20, 29, 0, 1, 5, 9, 17, 10, 36, 0, 1, 4, 9, 16, 25, 36, 49, 225, 1, 4, 2, 16, 10, 5, 25, 128, 225, 170, 4, 1, 17, 10, 5, 18, 113, 162, 196, 170, 125, 9, 16, 25, 5, 10, 128, 113, 149, 225, 170, 125, 90, 16, 9, 4, 1, 128
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Examples

			The top left 8x8 corner of this array:
+0 +0 +9 +9 +0 +1 +0 +0
+1 +1 +2 +2 +2 +1 +1 +1
+8 +5 +4 +5 +5 +4 +4 +4
18 +5 +2 +9 +9 +2 +1 +9
25 20 17 16 16 17 16 16
29 10 25 10 10 25 +9 25
36 36 +5 +5 +5 +4 36 36
49 25 18 10 +1 10 25 49
		

Crossrefs

a(n) = A163900(A163357(n)). Positions of zeros: A165403. See also A163898, A163904.

A163900 Squared distance between n's location in A054238 array and A163357 array.

Original entry on oeis.org

0, 0, 1, 1, 8, 18, 5, 5, 4, 2, 9, 5, 2, 2, 9, 9, 0, 2, 1, 1, 0, 0, 1, 1, 4, 4, 9, 1, 2, 4, 5, 9, 16, 10, 25, 17, 16, 16, 25, 9, 36, 36, 49, 25, 10, 4, 5, 1, 10, 18, 5, 5, 10, 16, 17, 25, 10, 20, 25, 29, 36, 36, 25, 49, 128, 162, 113, 113, 128, 128, 113, 145, 100, 100, 89, 113, 162
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Crossrefs

Positions of zeros: A163901. See also A163898, A163899.

Formula

a(n) = A000290(abs(A059906(n)-A059252(n))) + A000290(abs(A059905(n)-A059253(n))).

A163538 The change in X-coordinate when moving from the n-1:th to the n-th term in the type I Hilbert's Hamiltonian walk A163357.

Original entry on oeis.org

0, 1, 0, -1, 0, 0, 1, 0, 1, 0, 1, 0, 0, -1, 0, 1, 1, 0, 1, 0, 1, 1, 0, -1, 0, 1, 0, -1, -1, 0, -1, 0, 0, 0, 1, 0, 1, 1, 0, -1, 0, 1, 0, -1, -1, 0, -1, 0, -1, -1, 0, 1, 0, 0, -1, 0, -1, 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0, 1, 1, 0, -1, 0, 1, 0, -1, -1, 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0, 1, 0, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

These are the first differences of A059253. See also: A163539, A163540, A163542.

Formula

a(0)=0, a(n) = A059253(n) - A059253(n-1).

A163539 The change in Y-coordinate when moving from the n-1:th to the n-th term in the type I Hilbert's Hamiltonian walk A163357.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, -1, 0, 1, 0, -1, -1, 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0, 1, 0, 1, 0, 0, -1, 0, 1, 1, 1, 0, -1, 0, 0, 1, 0, 1, 0, 1, 0, 0, -1, 0, 1, 0, 0, -1, 0, -1, -1, 0, 1, 0, -1, 0, 1, 1, 0, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 1, 0, 1, 0, 0, -1, 0, 1, 1, 0, 1, 0, 1, 1, 0, -1, 0, 1, 0, -1, -1, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

These are the first differences of A059252. See also: A163538, A163541, A163543.

Formula

a(0)=0, a(n) = A059252(n) - A059252(n-1).
Showing 1-10 of 38 results. Next