login
A260423
a(1) = 1, a(prime(n)) = A206074(a(n)), a(composite(n)) = A205783(1+a(n)), where A206074 and A205783 give binary codes for polynomials with coefficients 0 or 1 that are irreducible [resp. reducible] over Q.
4
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 30, 25, 32, 29, 33, 34, 35, 36, 38, 31, 40, 42, 44, 37, 46, 41, 39, 49, 45, 43, 50, 51, 52, 54, 57, 47, 48, 60, 63, 65, 56, 53, 68, 55, 62, 58, 74, 66, 64, 59, 75, 76, 78, 61, 82, 67, 86, 70, 72, 92, 95, 69, 98, 85, 80, 71, 102, 84, 94, 88, 111
OFFSET
1,2
FORMULA
a(1) = 1; for n > 1, if A010051(n) = 1 [when n is a prime], then a(n) = A206074(a(A000720(n))), otherwise [when n is a composite], a(n) = A205783(1+a(A065855(n))).
As a composition of related permutations:
a(n) = A260422(A246377(n)).
a(n) = A260425(A245703(n)).
PROG
(PARI)
allocatemem(123456789);
default(primelimit, 4294965247);
uplim = 2^23;
v206074 = vector(uplim); A206074 = n -> v206074[n];
v205783 = vector(uplim); A205783 = n -> v205783[n];
isA206074(n) = polisirreducible(Pol(binary(n)));
v205783[1] = 1; i=0; j=1; n=2; while((n < uplim), if(!(n%65536), print1(n, ", ")); if(isA206074(n), i++; v206074[i] = n, j++; v205783[j] = n); n++); print(n);
A260423(n) = if(1==n, 1, if(isprime(n), A206074(A260423(primepi(n))), A205783(1+A260423(n-primepi(n)-1))));
for(n=1, 10001, write("b260423.txt", n, " ", A260423(n)));
(Scheme) (definec (A260423 n) (cond ((<= n 1) n) ((= 1 (A010051 n)) (A206074 (A260423 (A000720 n)))) (else (A205783 (+ 1 (A260423 (A065855 n)))))))
CROSSREFS
Inverse: A260424.
Related permutations: A245703, A246377, A260422, A260425.
Sequence in context: A236850 A263028 A044921 * A193989 A321293 A246091
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, Jul 25 2015
STATUS
approved