login
A245816
Permutation of natural numbers induced when A245822 is restricted to nonprime numbers: a(n) = A062298(A245822(A018252(n))).
5
1, 2, 4, 5, 3, 10, 6, 22, 7, 16, 9, 23, 27, 51, 15, 17, 35, 13, 37, 11, 39, 56, 69, 38, 14, 18, 48, 78, 33, 120, 20, 19, 46, 67, 24, 62, 42, 34, 28, 73, 25, 103, 31, 206, 40, 55, 68, 92, 300, 26, 76, 50, 99, 65, 157, 281, 165, 184, 8, 121, 134, 277, 423, 30, 47, 36, 223, 70, 514, 75, 101, 116, 236, 139, 74
OFFSET
1,2
COMMENTS
This permutation is induced when A245822 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.
FORMULA
a(n) = A062298(A245822(A018252(n))).
As a composition of related permutations:
a(n) = A245820(A245814(n)).
Also following holds for all n >= 1:
etc.
PROG
(PARI)
allocatemem(123456789);
default(primelimit, 2^22)
A014580 = vector(2^18);
A091226 = vector(2^22);
A002808(n)={my(k); for(k=0, primepi(n), isprime(n++)&&k--); n}; \\ This function from M. F. Hasler, Oct 31 2008
A062298(n) = n-primepi(n);
A018252(n) = if(1==n, 1, A002808(n-1));
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; A091226[n] = A091226[n-1]+1, A091226[n] = A091226[n-1]); 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))}));
A091245(n) = ((n-A091226[n])-1);
A245704(n) = if(1==n, 1, if(isA014580(n), prime(A245704(A091226[n])), A002808(A245704(A091245(n)))));
for(n=1, 10001, write("b245816.txt", n, " ", A245816(n)));
(Scheme) (define (A245816 n) (A062298 (A245822 (A018252 n))))
CROSSREFS
Inverse: A245815.
Related permutations: A245814, A245820, A245822.
Sequence in context: A269780 A038776 A210863 * A118461 A332667 A266408
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 02 2014
STATUS
approved