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

A207901 Let S_k denote the first 2^k terms of this sequence and let b_k be the smallest positive integer that is not in S_k, also let R_k equal S_k read in reverse order; then the numbers b_k*R_k are the next 2^k terms.

Original entry on oeis.org

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

Views

Author

Paul D. Hanna, Feb 21 2012

Keywords

Comments

A permutation of the positive integers (but please note the starting offset: 0-indexed).
This sequence is a variant of A052330.
Shares with A064736, A302350, etc. the property that a(n) is either a divisor or a multiple of a(n+1). - Peter Munn, Apr 11 2018 on SeqFan-list. Note: A302781 is another such "divisor-or-multiple permutation" satisfying the same property. - Antti Karttunen, Apr 14 2018
The offset is 0 since S_0 = {1} denotes the first 2^0 = 1 terms. - Daniel Forgues, Apr 13 2018
This is "Fermi-Dirac piano played with Gray code", as indicated by Peter Munn's Apr 11 2018 formula. Compare also to A303771 and A302783. - Antti Karttunen, May 16 2018

Examples

			Start with [1]; appending 2*[1] results in [1,2];
appending 3*[2,1] results in [1,2, 6,3];
appending 4*[3,6,2,1] results in [1,2,6,3, 12,24,8,4];
appending 5*[4,8,24,12,3,6,2,1]
results in [1,2,6,3,12,24,8,4, 20,40,120,60,15,30,10,5];
next append 7*[5,10,30,15,60,120,40,20,4,8,24,12,3,6,2,1],
multiplying by 7 since 6 is already found in the previous terms.
Each new factor is in A050376: [2,3,4,5,7,9,11,13,16,17,19,23,25,29,...].
Continue in this way to generate all the terms of this sequence.
		

Crossrefs

Cf. A064736, A281978, A282291, A302350, A302781, A302783, A303751, A303771, A304085, A304531, A304755 for other divisor-or-multiple permutations or conjectured permutations.
Cf. A302033 (a squarefree analog), A304745.

Programs

  • Mathematica
    a = {1}; Do[a = Join[a, Reverse[a]*Min[Complement[Range[Max[a] + 1], a]]], {n, 1, 6}]; a (* Ivan Neretin, May 09 2015 *)
  • PARI
    {A050376(n)= local(m, c, k, p); n--; if(n<=0, 2*(n==0), c=0; m=2; while( cA050376(n-1)*Vec(Polrev(A))));A[n]}
    for(n=0,63,print1(a(n),",")) \\ edited for offsets by Michel Marcus, Apr 04 2019
    
  • PARI
    up_to_e = 13;
    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); };
    A003188(n) = bitxor(n, n>>1);
    A207901(n) = A052330(A003188(n)); \\ Antti Karttunen, Apr 13 2018

Formula

a(n) = A052330(A003188(n)). - Peter Munn, Apr 11 2018
a(n) = A302781(A302843(n)) = A302783(A064706(n)). - Antti Karttunen, Apr 16 2018
a(n+1) = A059897(a(n), A050376(A001511(n+1))). - Peter Munn, Apr 01 2019

Extensions

Offset changed from 1 to 0 by Antti Karttunen, Apr 13 2018

A302846 Interleave the Gray-coded X and Y-coordinates of 2-dimensional Hilbert's curve in alternate bit-positions: a(n) = A000695(A003188(A059253(n))) + 2*A000695(A003188(A059252(n))).

Original entry on oeis.org

0, 1, 3, 2, 10, 8, 9, 11, 15, 13, 12, 14, 6, 7, 5, 4, 20, 22, 23, 21, 17, 16, 18, 19, 27, 26, 24, 25, 29, 31, 30, 28, 60, 62, 63, 61, 57, 56, 58, 59, 51, 50, 48, 49, 53, 55, 54, 52, 36, 37, 39, 38, 46, 44, 45, 47, 43, 41, 40, 42, 34, 35, 33, 32, 160, 162, 163, 161, 165, 164, 166, 167, 175, 174, 172, 173, 169, 171, 170, 168, 136
Offset: 0

Views

Author

Antti Karttunen, Apr 14 2018

Keywords

Comments

Like in binary Gray code A003188, also in this permutation the binary expansions of a(n) and a(n+1) differ always by just a single bit-position, that is, A000120(A003987(a(n),a(n+1))) = 1 for all n >= 0. Here A003987 computes bitwise-XOR of its two arguments.
When composed with A052330 this gives A302781.

Crossrefs

Cf. A302845 (inverse permutation).
Cf. also A003188, A163252, A300838 for other permutations satisfying the same condition.

Programs

  • PARI
    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))));
    A302846(n) = A064706(A163356(n));

Formula

a(n) = A064706(A163356(n)) = A003188(A302844(n)).

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

A302033 a(n) = A019565(A003188(n)).

Original entry on oeis.org

1, 2, 6, 3, 15, 30, 10, 5, 35, 70, 210, 105, 21, 42, 14, 7, 77, 154, 462, 231, 1155, 2310, 770, 385, 55, 110, 330, 165, 33, 66, 22, 11, 143, 286, 858, 429, 2145, 4290, 1430, 715, 5005, 10010, 30030, 15015, 3003, 6006, 2002, 1001, 91, 182, 546, 273, 1365, 2730, 910, 455, 65, 130, 390, 195, 39, 78, 26, 13, 221, 442, 1326, 663, 3315, 6630, 2210, 1105
Offset: 0

Views

Author

Antti Karttunen & Peter Munn, Apr 16 2018

Keywords

Comments

A squarefree analog of A207901 (and the subsequence consisting of its squarefree terms): Each term is either a divisor or a multiple of the next one, and the terms differ by a single prime factor. Compare also to A284003.
For all n >= 0, max(a(n + 1), a(n)) / min(a(n + 1), a(n)) = A094290(n + 1) = prime(valuation(n + 1, 2) + 1) = A000040(A001511(n + 1)). [See Russ Cox's Dec 04 2010 comment in A007814.] - David A. Corneth & Antti Karttunen, Apr 16 2018

Crossrefs

A permutation of A005117. Subsequence of A207901.
Cf. A302054 (gives the sum of prime divisors).
Cf. also A277811, A283475, A284003.

Programs

  • Mathematica
    Array[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[BitXor[#, Floor[#/2]], 2] &, 72, 0] (* Michael De Vlieger, Apr 27 2018 *)
  • PARI
    A003188(n) = bitxor(n, n>>1);
    A019565(n) = {my(j); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ From A019565
    A302033(n) = A019565(A003188(n));
    
  • PARI
    first(n) = {my(pr = primes(1 + logint(n, 2)), ex = vector(#pr, i, 1), res = vector(n)); res[1] = 1; for(i = 1, n-1, v = valuation(i, 2); res[i + 1] = res[i] * pr[v++] ^ ex[v]; ex[v]*=-1); res}

Formula

a(n) = A019565(A003188(n)).
a(n) = A284003(A064706(n)).
a(n+1) = A059897(a(n), A094290(n+1)). - Peter Munn, Apr 01 2019

A064707 Inverse square of permutation defined by A003188.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 13 2001

Keywords

Comments

Not the same as A100281: a(n)=A100281(n)=A099896(A099896(n)) only for n<64. - Reinhard Zumkeller, Nov 11 2004

Crossrefs

Inverse of permutation defined by A064706. Cf. A003188.

Programs

  • MATLAB
    A = 1; for i = 1:7 B = A(end:-1:1); A = [A (B + length(A))]; end C = A(A); for i = 1:128 A(C(i)) = i - 1; end A

Formula

a(n) = A180200(A233279(n)), n > 0. - Yosu Yurramendi, Apr 05 2017

Extensions

More terms from David Wasserman, Aug 02 2002

A165211 Period 8: repeat [0,1,0,1,1,0,1,0].

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Sep 07 2009

Keywords

Comments

Parity of A064706.
Parity of the generalized pentagonal numbers A001318. - Omar E. Pol, Feb 04 2012
More generally, parity of the generalized k-gonal numbers, for odd k >= 5. - Omar E. Pol, Feb 05 2012

Crossrefs

Cf. A130198 (essentially the same).

Programs

Formula

a(n) = A002817(n) mod 2. - Wesley Ivan Hurt, Apr 23 2014
a(n) = 1/2 - (-1)^(n*(n+1)*(n^2 + n + 2)/8)/2. - Vaclav Kotesovec, Apr 28 2014
From Colin Barker, Dec 20 2017: (Start)
G.f.: x*(1 - x + x^2) / ((1 - x)*(1 + x^4)).
a(n) = a(n-1) - a(n-4) + a(n-5) for n>4.
(End)

A100282 a(n) = A100280(A100280(n)).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 11 2004

Keywords

Comments

Permutation of the natural numbers with inverse A100281;
A064706(n) = a(n) for n<64.

A195467 Consecutive powers of the Gray code permutation.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 0, 1, 3, 2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 9, 8, 0, 1, 2, 3, 5, 4, 7, 6, 10, 11, 8, 9, 15, 14, 13, 12, 0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13, 8, 9, 11, 10
Offset: 0

Views

Author

Tilman Piesk, Sep 23 2011

Keywords

Comments

The powers of the Gray code permutation (GCP, A003188) form an infinite array, where row n is the n-th power of the GCP. Row 0 is the identity permutation (i.e., the sequence of nonnegative integers), and row 1 is the GCP itself.
The different powers of the n-bit GCP form a matrix of size (A062383(n-1)) X (2^n).
This sequence represents the infinite array in a somewhat redundant way: It shows the rows of all the (2^n) X (2^2^n) matrices of powers of (2^n)-bit GCP. So this sequence forms a triangle, and these 3 matrices are its first 7 rows:
The 1-bit GCP is the identity permutation:
0: 0 1
The 2 different powers of the 2-bit GCP:
0: 0 1 2 3
1: 0 1 3 2
The 4 different powers of the 4-bit GCP:
0: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1: 0 1 3 2 6 7 5 4 12 13 15 14 10 11 9 8
2: 0 1 2 3 5 4 7 6 10 11 8 9 15 14 13 12
3: 0 1 3 2 7 6 4 5 15 14 12 13 8 9 11 10
.
This array A can be defined using the binary array B = A197819 by
A = B + 2 * 2stretched(B) + 4 * 4stretched(B) + 8 * 8stretched(B) + ...
where nstretched has the following meaning:
2stretched(1,2,3,4,...) = 1,1,2,2,3,3,4,4,...
4stretched(1,2,3,4,...) = 1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,...
etc.

Crossrefs

Cf. A003188 (Gray code permutation).
Cf. A006068 (inverse of the Gray code permutation).
Cf. A064706 (square of the Gray code permutation).
Cf. A197819 (this array mod 2).

Extensions

Huge edit by Tilman Piesk, Aug 25 2013

A276273 Replacing every "mixed pair" of integers (as defined in the comments) with the smaller integer of the pair rebuilds the sequence.

Original entry on oeis.org

1, 2, 2, 3, 3, 2, 4, 3, 3, 4, 2, 3, 5, 4, 4, 3, 3, 4, 4, 5, 3, 2, 4, 3, 5, 6, 4, 5, 5, 4, 4, 3, 3, 4, 4, 5, 5, 4, 6, 5, 3, 4, 2, 3, 5, 4, 4, 3, 5, 6, 6, 7, 5, 4, 6, 5, 5, 6, 4, 5, 5, 4, 4, 3, 3, 4, 4, 5, 5, 4, 6, 5, 5, 6, 4, 5, 7, 6, 6, 5, 3, 4, 4, 5, 3, 2, 4, 3, 5, 6, 4, 5, 5, 4, 4, 3, 5, 6, 6, 7, 7, 6, 8, 7, 5, 6, 4, 5, 7, 6, 6, 5, 5, 6, 6, 7, 5, 4, 6, 5, 5, 6, 4, 5, 5, 4, 4, 3, 3, 4, 4
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Aug 26 2016

Keywords

Comments

A "mixed pair" is a pair of successive integers that add to an odd number.
By definition, the sequence has the repeated pattern oeeo (odd-even-even-odd integers) and starts with a(1) = 1. It is always extended with the smallest integer not leading to a contradiction.
Every natural number will appear in the sequence - but very slowly: the biggest integer after 200000 terms is still 18!

Examples

			The "mixed pairs" in the sequence are between parentheses:
(1,2),(2,3),(3,2),(4,3),(3,4),(2,3),(5,4),(4,3),...
Replacing the content of the parentheses by their smallest term gives (1),(2),(2),(3),(3),(2),(4),(3),...
which is indeed the starting sequence.
		

Crossrefs

Formula

It seems a(n) = A000120(A064706(n-1)) + 1. - Peter Munn, Aug 12 2023

Extensions

Name edited by Peter Munn, Aug 12 2023
Showing 1-9 of 9 results.