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.

A245823 Fixed points of A245821 and A245822.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 11, 17, 24, 31, 59, 89, 127, 184, 277, 461, 669, 709, 1097, 1787, 1995, 3259, 4999, 5381, 8807, 15299, 17351, 30133, 48593, 52711, 60810, 91081, 167449, 192263
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Comments

If n is a member, then the n-th prime, p_n (= A000040(n)) is also a member. If p_n is a member, then its index n is also a member. Thus the sequence is completely determined by its nonprime terms: 1, 4, 24, 184, 669, 1995, 60810, ..., and is obtained as a union of prime recurrences that start with those values: A007097 U A057450 U ..., etc.

Crossrefs

A007097 and A057450 are subsequences.

Programs

A245815 Permutation of natural numbers induced when A245821 is restricted to nonprime numbers: a(n) = A062298(A245821(A018252(n))).

Original entry on oeis.org

1, 2, 5, 3, 4, 7, 9, 59, 11, 6, 20, 125, 18, 25, 15, 10, 16, 26, 32, 31, 103, 8, 12, 35, 41, 50, 13, 39, 85, 64, 43, 164, 29, 38, 17, 66, 19, 24, 21, 45, 132, 37, 105, 139, 82, 33, 65, 27, 507, 52, 14, 180, 161, 96, 46, 22, 190, 141, 87, 1603, 80, 36, 143, 107, 54, 670, 34, 47, 23, 68, 177, 1337, 40
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Comments

This permutation is induced when A245821 is restricted to nonprimes, A018252, the first column of A114537, but equally, when it is restricted to column 2 (A007821), column 3 (A049078), etc. of that square array, or alternatively, to the successive rows of A236542.
The sequence of fixed points f(n) begins as 1, 2, 15, 142, 548, 1694, 54681. A018252(f(n)) gives the nonprime terms of A245823.

Crossrefs

Inverse: A245816.
Related permutations: A245813, A245819, A245821.

Programs

Formula

a(n) = A062298(A245821(A018252(n))).
As a composition of related permutations:
a(n) = A245813(A245819(n)).
Also following holds for all n >= 1:

A245817 Difference in size between rooted trees which are encoded as Matula-Goebel numbers A245821(n) and n: a(n) = A061775(A245821(n)) - A061775(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1, 1, 4, 0, 0, 0, 1, 0, 4, 1, 1, -1, 0, -2, 1, -1, 1, 0, 1, 0, 4, -2, 0, 1, 0, 1, 2, -1, 1, 1, 2, 4, 1, 0, 3, 0, 0, 1, -2, 2, -1, 0, -1, -2, 1, 2, 0, 0, 1, 1, 3, 0, 0, 0, -1, 0, 5, 0, -2, 4, 2, 1, 3, 0, 0, -1, 3, 1, 1, 0, 5, -1, 1, -1, 2, 1, 1, 0, 4, -1, 0, -2, 0, 3, 5, -2, -1, 0
Offset: 1

Views

Author

Antti Karttunen, Aug 16 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A061775(A245821(n)) - A061775(n).
Other identities. For all n >= 1, the following holds:
a(A000040(n)) = a(n). [The result for the n-th prime is same as for n itself].
a(A245823(n)) = 0. [A245823 gives a (proper) subsequence of the positions of the zeros].

A078442 a(p) = a(n) + 1 if p is the n-th prime, prime(n); a(n)=0 if n is not prime.

Original entry on oeis.org

0, 1, 2, 0, 3, 0, 1, 0, 0, 0, 4, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0
Offset: 1

Views

Author

Henry Bottomley, Dec 31 2002

Keywords

Comments

Fernandez calls this the order of primeness of n.
a(A007097(n))=n, for any n >= 0. - Paul Tek, Nov 12 2013
When a nonoriented rooted tree is encoded as a Matula-Goebel number n, a(n) tells how many edges needs to be climbed up from the root of the tree until the first branching vertex (or the top of the tree, if n is one of the terms of A007097) is encountered. Please see illustrations at A061773. - Antti Karttunen, Jan 27 2014
Zero-based column index of n in the Kimberling-style dispersion table of the primes (see A114537). - Allan C. Wechsler, Jan 09 2024

Examples

			a(1) = 0 since 1 is not prime;
a(2) = a(prime(1)) = a(1) + 1 = 1 + 0 = 1;
a(3) = a(prime(2)) = a(2) + 1 = 1 + 1 = 2;
a(4) = 0 since 4 is not prime;
a(5) = a(prime(3)) = a(3) + 1 = 2 + 1 = 3;
a(6) = 0 since 6 is not prime;
a(7) = a(prime(4)) = a(4) + 1 = 0 + 1 = 1.
		

Crossrefs

A left inverse of A007097.
One less than A049076.
a(A000040(n)) = A049076(n).
Cf. A373338 (mod 2), A018252 (positions of zeros).
Cf. permutations A235489, A250247/A250248, A250249/A250250, A245821/A245822 that all preserve a(n).
Cf. also array A114537 (A138947) and permutations A135141/A227413, A246681.

Programs

  • Haskell
    a078442 n = fst $ until ((== 0) . snd)
                            (\(i, p) -> (i + 1, a049084 p)) (-2, a000040 n)
    -- Reinhard Zumkeller, Jul 14 2013
  • Maple
    A078442 := proc(n)
        if not isprime(n) then
            0 ;
        else
            1+procname(numtheory[pi](n)) ;
        end if;
    end proc: # R. J. Mathar, Jul 07 2012
  • Mathematica
    a[n_] := a[n] = If[!PrimeQ[n], 0, 1+a[PrimePi[n]]]; Array[a, 105] (* Jean-François Alcover, Jan 26 2018 *)
  • PARI
    A078442(n)=for(i=0,n, isprime(n) || return(i); n=primepi(n)) \\ M. F. Hasler, Mar 09 2010
    

Formula

a(n) = A049076(n)-1.
a(n) = if A049084(n) = 0 then 0 else a(A049084(n)) + 1. - Reinhard Zumkeller, Jul 14 2013
For all n, a(n) = A007814(A135141(n)) and a(A227413(n)) = A007814(n). Also a(A235489(n)) = a(n). - Antti Karttunen, Jan 27 2014

A091205 Factorization and index-recursion 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, 23, 10, 27, 16, 81, 30, 13, 36, 25, 14, 69, 24, 11, 46, 45, 20, 21, 54, 19, 32, 57, 162, 115, 60, 47, 26, 63, 72, 61, 50, 33, 28, 135, 138, 17, 48, 35, 22, 243, 92, 39, 90, 37, 40, 207, 42, 83, 108, 29, 38, 75, 64, 225, 114, 103
Offset: 0

Views

Author

Antti Karttunen, Jan 03 2004

Keywords

Comments

This "deeply multiplicative" bijection is one of the deep variants of A091203 which satisfy most of the same identities as the latter, but it additionally preserves also the structures where we recurse on irreducible polynomial's A014580-index. E.g., we have: A091238(n) = A061775(a(n)). The reason this holds is that when the permutation is restricted to the binary codes for irreducible polynomials over GF(2) (A014580), it induces itself: a(n) = A049084(a(A014580(n))).
On the other hand, when this permutation is restricted to the union of {1} and reducible polynomials over GF(2) (A091242), permutation A245813 is induced.

Crossrefs

Programs

  • PARI
    allocatemem(123456789);
    v091226 = vector(2^22);
    isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from Charles R Greathouse IV
    n=2; while((n < 2^22), if(isA014580(n), v091226[n] = v091226[n-1]+1, v091226[n] = v091226[n-1]); n++)
    A091226(n) = v091226[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)}));
    for(n=0, 8192, write("b091205.txt", n, " ", A091205(n)));
    \\ Antti Karttunen, Aug 16 2014

Formula

a(0)=0, a(1)=1. For n that is coding an irreducible polynomial, that is if n = A014580(i), we have a(n) = A000040(a(i)) and for reducible polynomials a(ir_i X ir_j X ...) = a(ir_i) * a(ir_j) * ..., where ir_i = A014580(i), X stands for carryless multiplication of polynomials over GF(2) (A048720) and * for the ordinary multiplication of integers (A004247).
As a composition of related permutations:
a(n) = A245821(A245704(n)).
Other identities.
For all n >= 0, the following holds:
a(A091230(n)) = A007097(n). [Maps iterates of A014580 to the iterates of primes. Permutation A245704 has the same property.]
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, bijectively to primes and the binary representations of corresponding reducible polynomials, A091242, to composite numbers, in some order. The permutations A091203, A106443, A106445, A106447, A235042 and A245704 have the same property.]

Extensions

Name changed by Antti Karttunen, Aug 16 2014

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

Original entry on oeis.org

1, 2, 3, 4, 7, 5, 11, 6, 8, 12, 25, 9, 13, 17, 10, 14, 47, 18, 19, 34, 15, 20, 31, 24, 16, 21, 62, 26, 55, 27, 137, 45, 22, 28, 42, 33, 37, 23, 29, 79, 59, 35, 87, 71, 36, 166, 41, 58, 30, 38, 54, 44, 61, 49, 32, 39, 99, 76, 319, 46, 91, 108, 89, 48, 200, 53, 97, 75, 40, 50, 203, 70, 67, 57, 78, 64, 43, 51
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Comments

All the permutations A091202, A091204, A106442, A106444, A106446, A235041 share the same property that primes (A000040) are mapped bijectively to the binary representations of irreducible GF(2) polynomials (A014580) but while they determine the mapping of composites (A002808) to the corresponding binary codes of reducible polynomials (A091242) by a simple multiplicative rule, this permutation employs index-recursion also in that case.

Crossrefs

Programs

  • PARI
    allocatemem(123456789);
    a014580 = vector(2^18);
    a091242 = 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++; a014580[i] = n, j++; a091242[j] = n); n++)
    A245703(n) = if(1==n, 1, if(isprime(n), a014580[A245703(primepi(n))], a091242[A245703(n-primepi(n)-1)]));
    for(n=1, 10001, write("b245703.txt", n, " ", A245703(n)));
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A245703 n) (cond ((= 1 n) n) ((= 1 (A010051 n)) (A014580 (A245703 (A000720 n)))) (else (A091242 (A245703 (A065855 n))))))

Formula

a(1) = 1, a(p_n) = A014580(a(n)) and a(c_n) = A091242(a(n)), where p_n is the n-th prime, A000040(n) and c_n is the n-th composite, A002808(n).
a(1) = 1, after which, if A010051(n) is 1 [i.e. n is prime], then a(n) = A014580(a(A000720(n))), otherwise a(n) = A091242(a(A065855(n))).
As a composition of related permutations:
a(n) = A245702(A135141(n)).
a(n) = A091204(A245821(n)).
Other identities. For all n >= 1, the following holds:
a(A007097(n)) = A091230(n). [Maps iterates of primes to the iterates of A014580. Permutation A091204 has the same property]
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 A091202, A091204, A106442, A106444, A106446 and A235041 have the same property.]

A250250 Permutation of natural numbers: a(1) = 1, a(n) = A246278(a(A055396(n)),a(A078898(n))).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 27, 22, 23, 24, 25, 26, 21, 28, 29, 30, 31, 32, 45, 34, 35, 36, 37, 38, 33, 40, 41, 54, 43, 44, 81, 46, 47, 48, 49, 50, 75, 52, 53, 42, 125, 56, 63, 58, 59, 60, 61, 62, 39, 64, 55, 90, 67, 68, 135, 70, 71, 72, 103, 74, 51, 76, 77, 66, 79, 80, 99, 82, 83
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2014

Keywords

Comments

This is a "doubly-recursed" version of A249818.

Crossrefs

Inverse: A250249.
Fixed points: A250251, their complement: A249729.
See also other (somewhat) similar permutations: A245821, A057505.
Differs from the "vanilla version" A249818 for the first time at n=42, where a(42) = 54, while A249818(42) = 42.

Formula

a(1) = 1, a(n) = A246278(a(A055396(n)), a(A078898(n))).
Other identities. For all n >= 1:
a(2n) = 2*a(n), or equally, a(n) = a(2n)/2. [The even bisection halved gives the sequence back].
a(p_n) = p_{a(n)}, or equally, a(n) = A049084(a(A000040(n))). [Restriction to primes induces the same sequence].
A078442(a(n)) = A078442(n), A049076(a(n)) = A049076(n). [Preserves the "order of primeness of n"].
A000035(n) = A000035(a(n)). [Preserves the parity].

A245822 Permutation of natural numbers: a(n) = A245704(A091204(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 9, 6, 16, 11, 10, 19, 33, 12, 25, 17, 15, 23, 34, 39, 70, 13, 24, 26, 50, 21, 52, 53, 18, 31, 55, 77, 93, 54, 22, 29, 27, 66, 105, 67, 48, 137, 156, 30, 28, 37, 64, 91, 35, 85, 58, 97, 49, 40, 98, 36, 135, 59, 45, 47, 261, 56, 76, 92, 122, 83, 374, 38, 102, 139, 69, 167, 130, 88, 203, 351, 212, 349, 235, 14
Offset: 1

Views

Author

Antti Karttunen, Aug 02 2014

Keywords

Crossrefs

Inverse: A245821.
Other related permutations: A091204, A245704, A245816.
Fixed points: A245823.

Programs

Formula

a(n) = A245704(A091204(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].
A245816(n) = A062298(a(A018252(n))). [While restriction to nonprimes induces another permutation].

A246681 Permutation of natural numbers: a(0) = 1, a(1) = 2, a(p_n) = A003961(a(n)), a(c_n) = 2*a(n), where p_n = n-th prime = A000040(n), c_n = n-th composite number = A002808(n), and A003961(n) shifts the prime factorization of n one step towards larger primes.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 6, 9, 10, 8, 14, 11, 12, 15, 18, 20, 16, 25, 28, 21, 22, 24, 30, 27, 36, 40, 32, 50, 56, 33, 42, 13, 44, 48, 60, 54, 72, 45, 80, 64, 100, 35, 112, 75, 66, 84, 26, 63, 88, 96, 120, 108, 144, 81, 90, 160, 128, 200, 70, 49, 224, 99, 150, 132, 168, 52, 126, 55, 176, 192, 240, 39
Offset: 0

Views

Author

Antti Karttunen, Sep 01 2014

Keywords

Comments

Note the indexing: the domain starts from 0, while the range excludes zero.
Iterating a(n) from n=0 gives the sequence: 1, 2, 3, 5, 7, 9, 8, 10, 14, 18, 28, 56, 128, 156, 1344, 16524, 2706412500, ..., which is the only one-way cycle of this permutation.
Because 2 is the only even prime, it implies that, apart from a(0)=1 and a(2)=3, odd numbers occur in odd positions only (along with many even numbers that also occur in odd positions). This in turn implies that there exists an infinite number of infinite cycles like (... 648391 31 13 15 20 22 30 42 112 196 1350 ...) which contain just one odd composite (A071904). Apart from 9 which is in that one-way cycle, each odd composite occurs in a separate infinite two-way cycle, like 15 in the example above.

Crossrefs

Inverse: A246682.
Similar or related permutations: A163511, A246377, A246379, A246367, A245821.

Formula

a(0) = 1, a(1) = 2, and for n > 1, if A010051(n) = 1 [i.e. when n is a prime], a(n) = A003961(a(A000720(n))), otherwise a(n) = 2*a(A065855(n)).
Other identities.
For all n >= 0, the following holds:
a(A007097(n)) = A000040(n+1). [Maps the iterates of primes to primes].
A078442(a(n)) > 0 if and only if n is in A007097. [Follows from above].
For all n >= 1, the following holds:
a(n) = A163511(A246377(n)).
A000035(a(n)) = A010051(n). [Maps primes to odd numbers > 1, and composites to even numbers, in some order. Permutations A246377 & A246379 have the same property].
A055396(a(n)) = A049076(n). [An "order of primeness" is mapped to the index of the smallest prime dividing n].
Showing 1-9 of 9 results.