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 19 results. Next

A245821 Permutation of natural numbers: a(n) = A091205(A245703(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 7, 6, 8, 12, 11, 15, 23, 81, 18, 10, 17, 30, 13, 162, 27, 36, 19, 24, 16, 25, 38, 46, 37, 45, 31, 135, 14, 20, 50, 57, 47, 69, 21, 55, 83, 115, 419, 87, 60, 210, 61, 42, 54, 26, 90, 28, 29, 35, 32, 63, 171, 52, 59, 138, 113, 180, 111, 48, 88, 39, 41, 621, 72, 22, 953, 230, 103, 207, 126, 64, 33, 243
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Crossrefs

Inverse: A245822.
Other related permutations: A091205, A245703, A245815.
Fixed points: A245823.

Programs

  • PARI
    allocatemem(234567890);
    v014580 = vector(2^18);
    v091226 = vector(2^22);
    v091242 = vector(2^22);
    isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from Charles R Greathouse IV
    i=0; j=0; n=2; while((n < 2^22), if(isA014580(n), i++; v014580[i] = n; v091226[n] = v091226[n-1]+1, j++; v091242[j] = n; v091226[n] = v091226[n-1]); n++);
    A014580(n) = v014580[n];
    A091226(n) = v091226[n];
    A091242(n) = v091242[n];
    A091205(n) = if(n<=1, n, if(isA014580(n), prime(A091205(A091226(n))), {my(irfs, t); irfs=subst(lift(factor(Mod(1, 2)*Pol(binary(n)))), x, 2); irfs[,1]=apply(t->A091205(t), irfs[,1]); factorback(irfs)}));
    A245703(n) = if(1==n, 1, if(isprime(n), A014580(A245703(primepi(n))), A091242(A245703(n-primepi(n)-1))));
    A245821(n) = A091205(A245703(n));
    for(n=1, 10001, write("b245821.txt", n, " ", A245821(n)));
    
  • Scheme
    (define (A245821 n) (A091205 (A245703 n)))

Formula

a(n) = A091205(A245703(n)).
Other identities. For all n >= 1, the following holds:
A078442(a(n)) = A078442(n), A049076(a(n)) = A049076(n). [Preserves "the order of primeness of n"].
a(p_n) = p_{a(n)} where p_n is the n-th prime, A000040(n).
a(n) = A049084(a(A000040(n))). [Thus the same permutation is induced also when it is restricted to primes].
A245815(n) = A062298(a(A018252(n))). [While restriction to nonprimes induces another permutation].

A245450 Self-inverse permutation of natural numbers, A245703-conjugate of balanced bit-reverse: a(n) = A245704(A057889(A245703(n))).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 13, 8, 9, 10, 19, 12, 7, 14, 15, 16, 53, 18, 11, 20, 21, 22, 23, 24, 25, 26, 27, 33, 41, 30, 113, 32, 28, 34, 35, 36, 47, 39, 38, 92, 29, 54, 163, 85, 45, 462, 37, 60, 49, 70, 51, 94, 17, 42, 55, 74, 57, 156, 193, 48, 101, 62, 115, 64, 259, 77, 73, 132, 69, 50, 181, 102, 67, 56, 169, 76, 66, 78, 137, 87, 180, 398, 139, 84, 44
Offset: 1

Views

Author

Antti Karttunen, Aug 07 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A245704(A057889(A245703(n))).
Other identities. For all n >= 1, the following holds:
A010051(a(n)) = A010051(n). [Maps primes to primes and composites to composites].

A244987 Self-inverse permutation of natural numbers, A245703-conjugate of Blue code: a(n) = A245704(A193231(A245703(n))).

Original entry on oeis.org

1, 3, 2, 6, 5, 4, 13, 8, 21, 15, 23, 16, 7, 25, 10, 12, 41, 18, 19, 64, 9, 22, 11, 49, 14, 26, 77, 39, 37, 34, 263, 105, 38, 30, 88, 70, 29, 33, 28, 133, 17, 54, 73, 126, 51, 462, 53, 60, 24, 66, 45, 74, 47, 42, 78, 94, 156, 81, 239, 48, 97, 62, 100, 20, 155, 50, 79, 98, 84, 36, 167, 141, 43, 52, 129, 164, 27, 55
Offset: 1

Views

Author

Antti Karttunen, Aug 07 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A245704(A193231(A245703(n))).
Other identities. For all n >= 1, the following holds:
A010051(a(n)) = A010051(n). [Maps primes to primes and composites to composites].

A245819 Permutation of natural numbers induced when A245703 is restricted to nonprime numbers: a(n) = 1+A091245(A245703(A018252(n))).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 6, 12, 7, 9, 13, 26, 10, 14, 18, 11, 15, 48, 19, 20, 35, 16, 21, 32, 25, 17, 22, 63, 27, 56, 28, 138, 46, 23, 29, 43, 34, 38, 24, 30, 80, 60, 36, 88, 72, 37, 167, 42, 59, 31, 39, 55, 45, 62, 50, 33, 40, 100, 77, 320, 47, 92, 109, 90, 49, 201, 54, 98, 76, 41, 51
Offset: 1

Views

Author

Antti Karttunen, Aug 16 2014

Keywords

Crossrefs

Inverse: A245820.
Related permutations: A245703, A245814, A245815.

Programs

Formula

a(1) = 1, and for n > 1, a(n) = 1 + A245703(n-1).
a(n) = 1+A091245(A245703(A018252(n))). [Induced when A245703 is restricted to nonprime numbers].
a(n) = 1+A091226(A245703(A008578(n))). [Induced also when A245703 is restricted to noncomposite numbers].
As a composition of related permutations:
a(n) = A245814(A245815(n)).

A135141 a(1)=1, a(p_n)=2*a(n), a(c_n)=2*a(n)+1, where p_n = n-th prime, c_n = n-th composite number.

Original entry on oeis.org

1, 2, 4, 3, 8, 5, 6, 9, 7, 17, 16, 11, 10, 13, 19, 15, 12, 35, 18, 33, 23, 21, 14, 27, 39, 31, 25, 71, 34, 37, 32, 67, 47, 43, 29, 55, 22, 79, 63, 51, 20, 143, 26, 69, 75, 65, 38, 135, 95, 87, 59, 111, 30, 45, 159, 127, 103, 41, 24, 287, 70, 53, 139, 151, 131, 77, 36, 271, 191
Offset: 1

Views

Author

Katarzyna Matylla, Feb 13 2008

Keywords

Comments

A permutation of the positive integers, related to A078442.
a(p) is even when p is prime and is divisible by 2^(prime order of p).
From Robert G. Wilson v, Feb 16 2008: (Start)
What is the length of the cycle containing 10? Is it infinite? The cycle begins 10, 17, 12, 11, 16, 15, 19, 18, 35, 29, 34, 43, 26, 31, 32, 67, 36, 55, 159, 1055, 441, 563, 100, 447, 7935, 274726911, 1013992070762272391167, ... Implementation in Mmca: NestList[a(AT)# &, 10, 26] Furthermore, it appears that any non-single-digit number has an infinite cycle.
Records: 1, 2, 4, 8, 9, 17, 19, 35, 39, 71, 79, 143, 159, 287, 319, 575, 639, 1151, 1279, 2303, 2559, 4607, 5119, 9215, 10239, 18431, 20479, 36863, 40959, 73727, 81919, 147455, 163839, 294911, 327679, 589823, 655359, ..., . (End)

Examples

			a(20) = 33 = 2*16 + 1 because 20 is 11th composite and a(11)=16. Or, a(20)=33=100001(bin). In other words it is a composite number, its index is a prime number, whose index is a prime....
		

Crossrefs

Cf. A246346, A246347 (record positions and values).
Cf. A227413 (inverse).
Cf. A071574, A245701, A245702, A245703, A245704, A246377, A236854, A237427 for related and similar permutations.

Programs

  • Haskell
    import Data.List (genericIndex)
    a135141 n = genericIndex a135141_list (n-1)
    a135141_list = 1 : map f [2..] where
       f x | iprime == 0 = 2 * (a135141 $ a066246 x) + 1
           | otherwise   = 2 * (a135141 iprime)
           where iprime = a049084 x
    -- Reinhard Zumkeller, Jan 29 2014
    
  • Mathematica
    a[1] = 1; a[n_] := If[PrimeQ@n, 2*a[PrimePi[n]], 2*a[n - 1 - PrimePi@n] + 1]; Array[a, 69] (* Robert G. Wilson v, Feb 16 2008 *)
  • Maxima
    /* Let pc = prime count (which prime it is), cc = composite count: */
    pc[1]:0;
    cc[1]:0;
    pc[2]:1;
    cc[4]:1;
    pc[n]:=if primep(n) then 1+pc[prev_prime(n)] else 0;
    cc[n]:=if primep(n) then 0 else if primep(n-1) then 1+cc[n-2] else 1+cc[n-1];
    a[1]:1;
    a[n]:=if primep(n) then 2*a[pc[n]] else 1+2*a[cc[n]];
    
  • PARI
    A135141(n) = if(1==n, 1, if(isprime(n), 2*A135141(primepi(n)), 1+(2*A135141(n-primepi(n)-1)))); \\ Antti Karttunen, Dec 09 2019
  • Python
    from sympy import isprime, primepi
    def a(n): return 1 if n==1 else 2*a(primepi(n)) if isprime(n) else 2*a(n - 1 - primepi(n)) + 1 # Indranil Ghosh, Jun 11 2017, after Mathematica code
    

Formula

a(n) = 2*A135141((A049084(n))*chip + A066246(n)*(1-chip)) + 1 - chip, where chip = A010051(n). - Reinhard Zumkeller, Jan 29 2014
From Antti Karttunen, Dec 09 2019: (Start)
A007814(a(n)) = A078442(n).
A070939(a(n)) = A246348(n).
A080791(a(n)) = A246370(n).
A054429(a(n)) = A246377(n).
A245702(a(n)) = A245703(n).
a(A245704(n)) = A245701(n). (End)

A091202 Factorization-preserving isomorphism from nonnegative integers to binary codes for polynomials over GF(2).

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 11, 8, 5, 14, 13, 12, 19, 22, 9, 16, 25, 10, 31, 28, 29, 26, 37, 24, 21, 38, 15, 44, 41, 18, 47, 32, 23, 50, 49, 20, 55, 62, 53, 56, 59, 58, 61, 52, 27, 74, 67, 48, 69, 42, 43, 76, 73, 30, 35, 88, 33, 82, 87, 36, 91, 94, 39, 64, 121, 46, 97, 100, 111, 98
Offset: 0

Views

Author

Antti Karttunen, Jan 03 2004

Keywords

Comments

E.g. we have the following identities: A000005(n) = A091220(a(n)), A001221(n) = A091221(a(n)), A001222(n) = A091222(a(n)), A008683(n) = A091219(a(n)), A014580(n) = a(A000040(n)), A049084(n) = A091227(a(n)).

Crossrefs

Inverse: A091203.
Several variants exist: A235041, A091204, A106442, A106444, A106446.
Cf. also A302023, A302025, A305417, A305427 for other similar permutations.

Programs

  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A091225(n) = polisirreducible(Pol(binary(n))*Mod(1, 2));
    A305420(n) = { my(k=1+n); while(!A091225(k),k++); (k); };
    A305421(n) = { my(f = subst(lift(factor(Pol(binary(n))*Mod(1, 2))),x,2)); for(i=1,#f~,f[i,1] = Pol(binary(A305420(f[i,1])))); fromdigits(Vec(factorback(f))%2,2); };
    A091202(n) = if(n<=1,n,if(!(n%2),2*A091202(n/2),A305421(A091202(A064989(n))))); \\ Antti Karttunen, Jun 10 2018

Formula

a(0)=0, a(1)=1, a(p_i) = A014580(i) for primes p_i with index i and for composites a(p_i * p_j * ...) = a(p_i) X a(p_j) X ..., where X stands for carryless multiplication of GF(2)[X] polynomials (A048720).
Other identities. For all n >= 1, the following holds:
A091225(a(n)) = A010051(n). [Maps primes to binary representations of irreducible GF(2) polynomials, A014580, and nonprimes to union of {1} and the binary representations of corresponding reducible polynomials, A091242. The permutations A091204, A106442, A106444, A106446, A235041 and A245703 have the same property.]
From Antti Karttunen, Jun 10 2018: (Start)
For n <= 1, a(n) = n, for n > 1, a(n) = 2*a(n/2) if n is even, and if n is odd, then a(n) = A305421(a(A064989(n))).
a(n) = A305417(A156552(n)) = A305427(A243071(n)).
(End)

A091203 Factorization-preserving isomorphism from binary codes of GF(2) polynomials to integers.

Original entry on oeis.org

0, 1, 2, 3, 4, 9, 6, 5, 8, 15, 18, 7, 12, 11, 10, 27, 16, 81, 30, 13, 36, 25, 14, 33, 24, 17, 22, 45, 20, 21, 54, 19, 32, 57, 162, 55, 60, 23, 26, 63, 72, 29, 50, 51, 28, 135, 66, 31, 48, 35, 34, 243, 44, 39, 90, 37, 40, 99, 42, 41, 108, 43, 38, 75, 64, 225, 114, 47, 324
Offset: 0

Views

Author

Antti Karttunen, Jan 03 2004

Keywords

Comments

E.g. we have the following identities: A000040(n) = a(A014580(n)), A091219(n) = A008683(a(n)), A091220(n) = A000005(a(n)), A091221(n) = A001221(a(n)), A091222(n) = A001222(a(n)), A091225(n) = A010051(a(n)), A091227(n) = A049084(a(n)), A091247(n) = A066247(a(n)).

Crossrefs

Programs

  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A091225(n) = polisirreducible(Pol(binary(n))*Mod(1, 2));
    A305419(n) = if(n<3,1, my(k=n-1); while(k>1 && !A091225(k),k--); (k));
    A305422(n) = { my(f = subst(lift(factor(Pol(binary(n))*Mod(1, 2))),x,2)); for(i=1,#f~,f[i,1] = Pol(binary(A305419(f[i,1])))); fromdigits(Vec(factorback(f))%2,2); };
    A091203(n) = if(n<=1,n,if(!(n%2),2*A091203(n/2),A003961(A091203(A305422(n))))); \\ Antti Karttunen, Jun 10 2018

Formula

a(0)=0, a(1)=1. For n's coding an irreducible polynomial ir_i, that is if n=A014580(i), we have a(n) = A000040(i) and for composite polynomials a(ir_i X ir_j X ...) = p_i * p_j * ..., where p_i = A000040(i) and X stands for carryless multiplication of GF(2)[X] polynomials (A048720) and * for the ordinary multiplication of integers (A004247).
Other identities. For all n >= 1, the following holds:
A010051(a(n)) = A091225(n). [After a(1)=1, maps binary representations of irreducible GF(2) polynomials, A014580, to primes and the binary representations of corresponding reducible polynomials, A091242, to composite numbers. The permutations A091205, A106443, A106445, A106447, A235042 and A245704 have the same property.]
From Antti Karttunen, Jun 10 2018: (Start)
For n <= 1, a(n) = n, for n > 1, a(n) = 2*a(n/2) if n is even, and if n is odd, then a(n) = A003961(a(A305422(n))).
a(n) = A005940(1+A305418(n)) = A163511(A305428(n)).
A046523(a(n)) = A278233(n).
(End)

A246377 Permutation of natural numbers: a(1) = 1, a(p_n) = 2*a(n)+1, a(c_n) = 2*a(n), where p_n = n-th prime = A000040(n), c_n = n-th composite number = A002808(n).

Original entry on oeis.org

1, 3, 7, 2, 15, 6, 5, 14, 4, 30, 31, 12, 13, 10, 28, 8, 11, 60, 29, 62, 24, 26, 9, 20, 56, 16, 22, 120, 61, 58, 63, 124, 48, 52, 18, 40, 25, 112, 32, 44, 27, 240, 21, 122, 116, 126, 57, 248, 96, 104, 36, 80, 17, 50, 224, 64, 88, 54, 23, 480, 121, 42, 244, 232, 252, 114, 59, 496, 192, 208, 125, 72, 49, 160, 34, 100
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2014

Keywords

Comments

This permutation is otherwise like Katarzyna Matylla's A135141, except that the role of even and odd numbers (or alternatively: primes and composites) has been swapped.
Because 2 is the only even prime, it implies that, apart from a(2)=3, odd numbers occur in odd positions only (along with many even numbers that also occur in odd positions).
This also implies that for each odd composite (A071904) there exists a separate infinite cycle in this permutation, apart from 9 and 15 which are in the same infinite cycle: (..., 23, 9, 4, 2, 3, 7, 5, 15, 28, 120, 82, 46, ...).

Crossrefs

Inverse: A246378.
Other related or similar permutations: A135141, A054429, A246201, A245703, A246376, A246379, A243071, A246681, A236854.
Differs from A237427 for the first time at n=19, where a(19) = 29, while A237427(19) = 62.

Formula

a(1) = 1, and for n > 1, if A010051(n) = 1 [i.e. when n is a prime], a(n) = 1+(2*a(A000720(n))), otherwise a(n) = 2*a(A065855(n)).
As a composition of related permutations:
a(n) = A054429(A135141(n)).
a(n) = A135141(A236854(n)).
a(n) = A246376(A246379(n)).
a(n) = A246201(A245703(n)).
a(n) = A243071(A246681(n)). [For n >= 1].
Other identities.
For all n > 1 the following holds:
A000035(a(n)) = A010051(n). [Maps primes to odd numbers > 1, and composites to even numbers, in some order. Permutations A246379 & A246681 have the same property].

A245704 Permutation of natural numbers: a(1) = 1, a(A014580(n)) = A000040(a(n)), a(A091242(n)) = A002808(a(n)), where A000040(n) = n-th prime, A002808(n) = n-th composite number, and A014580(n) and A091242(n) are binary codes for n-th irreducible and n-th reducible polynomial over GF(2), respectively.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 5, 9, 12, 15, 7, 10, 13, 16, 21, 25, 14, 18, 19, 22, 26, 33, 38, 24, 11, 28, 30, 34, 39, 49, 23, 55, 36, 20, 42, 45, 37, 50, 56, 69, 47, 35, 77, 52, 32, 60, 17, 64, 54, 70, 78, 94, 66, 51, 29, 105, 74, 48, 41, 84, 53, 27, 88, 76, 95, 106, 73, 125, 91, 72, 44, 140, 97, 100, 68, 58, 115, 75, 40
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Comments

All the permutations A091203, A091205, A106443, A106445, A106447, A235042 share the same property that the binary representations of irreducible GF(2) polynomials (A014580) are mapped bijectively to the primes (A000040) but while they determine the mapping of corresponding reducible polynomials (A091242) to the composite numbers (A002808) by a simple multiplicative rule, this permutation employs index-recursion also in that case.

Crossrefs

Programs

Formula

a(1) = 1, after which, if A091225(n) is 1 [i.e. n is in A014580], then a(n) = A000040(a(A091226(n))), otherwise a(n) = A002808(a(A091245(n))).
As a composition of related permutations:
a(n) = A227413(A245701(n)).
a(n) = A245822(A091205(n)).
Other identities. For all n >= 1, the following holds:
a(A091230(n)) = A007097(n). [Maps iterates of A014580 to the iterates of primes. Permutation A091205 has the same property].
A010051(a(n)) = A091225(n). [After a(1)=1, maps binary representations of irreducible GF(2) polynomials (= A014580) to primes and the corresponding representations of reducible polynomials to composites].

A091204 Factorization and index-recursion preserving isomorphism from nonnegative integers to polynomials over GF(2).

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 11, 8, 5, 14, 25, 12, 19, 22, 9, 16, 47, 10, 31, 28, 29, 50, 13, 24, 21, 38, 15, 44, 61, 18, 137, 32, 43, 94, 49, 20, 55, 62, 53, 56, 97, 58, 115, 100, 27, 26, 37, 48, 69, 42, 113, 76, 73, 30, 79, 88, 33, 122, 319, 36, 41, 274, 39, 64, 121, 86, 185
Offset: 0

Views

Author

Antti Karttunen, Jan 03 2004. Name changed Aug 16 2014

Keywords

Comments

This "deeply multiplicative" isomorphism is one of the deep variants of A091202 which satisfies most of the same identities as the latter, but it additionally preserves also the structures where we recurse on prime's index. E.g. we have: A091230(n) = a(A007097(n)) and A061775(n) = A091238(a(n)). This is because the permutation induces itself when it is restricted to the primes: a(n) = A091227(a(A000040(n))).
On the other hand, when this permutation is restricted to the nonprime numbers (A018252), permutation A245814 is induced.

Crossrefs

Programs

  • PARI
    v014580 = vector(2^18); A014580(n) = v014580[n];
    isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from Charles R Greathouse IV
    i=0; n=2; while((n < 2^22), if(isA014580(n), i++; v014580[i] = n); n++)
    A091204(n) = if(n<=1, n, if(isprime(n), A014580(A091204(primepi(n))), {my(pfs, t, bits, i); pfs=factor(n); pfs[,1]=apply(t->Pol(binary(A091204(t))), pfs[,1]); sum(i=1, #bits=Vec(factorback(pfs))%2, bits[i]<<(#bits-i))}));
    for(n=0, 8192, write("b091204.txt", n, " ", A091204(n)));
    \\ Antti Karttunen, Aug 16 2014

Formula

a(0)=0, a(1)=1, a(p_i) = A014580(a(i)) for primes with index i and for composites a(p_i * p_j * ...) = a(p_i) X a(p_j) X ..., where X stands for carryless multiplication of GF(2)[X] polynomials (A048720).
As a composition of related permutations:
a(n) = A245703(A245822(n)).
Other identities.
For all n >= 0, the following holds:
a(A007097(n)) = A091230(n). [Maps iterates of primes to the iterates of A014580. Permutation A245703 has the same property]
For all n >= 1, the following holds:
A091225(a(n)) = A010051(n). [Maps primes bijectively to binary representations of irreducible GF(2) polynomials, A014580, and nonprimes to union of {1} and the binary representations of corresponding reducible polynomials, A091242, in some order. The permutations A091202, A106442, A106444, A106446, A235041 and A245703 have the same property.]
Showing 1-10 of 19 results. Next