login
A245815
Permutation of natural numbers induced when A245821 is restricted to nonprime numbers: a(n) = A062298(A245821(A018252(n))).
5
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,2
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.
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:
PROG
(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++);
A002808(n)={my(k); for(k=0, primepi(n), isprime(n++)&&k--); n}; \\ This function from M. F. Hasler
A062298(n) = n-primepi(n);
A018252(n) = if(1==n, 1, A002808(n-1));
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))));
for(n=1, 10001, write("b245815.txt", n, " ", A245815(n)));
(Scheme) (define (A245815 n) (A062298 (A245821 (A018252 n))))
CROSSREFS
Inverse: A245816.
Related permutations: A245813, A245819, A245821.
Sequence in context: A357047 A105530 A370932 * A105108 A118460 A064788
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 02 2014
STATUS
approved