

A243343


a(1)=1; thereafter, if n is kth squarefree number [i.e., n = A005117(k)], a(n) = 1 + (2*a(k1)); otherwise, when n is kth nonsquarefree number [i.e., n = A013929(k)], a(n) = 2*a(k).


15



1, 3, 7, 2, 15, 5, 31, 6, 14, 11, 63, 4, 13, 29, 23, 30, 127, 10, 9, 62, 27, 59, 47, 12, 28, 61, 22, 126, 255, 21, 19, 8, 125, 55, 119, 26, 95, 25, 57, 58, 123, 45, 253, 46, 60, 511, 43, 254, 20, 18, 39, 124, 17, 54, 251, 118, 111, 239, 53, 94, 191, 51, 24, 56
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

This is an instance of an "entanglement permutation", where two pairs of complementary subsets of natural numbers are interwoven with each other. In this case complementary pair A005117/A013929 (numbers which are squarefree/not squarefree) is entangled with complementary pair odd/even numbers (A005408/A005843).
Thus this shares with permutation A243352 the property that each term of A005117 is mapped bijectively to an unique odd number and likewise each term of A013929 is mapped (bijectively) to an unique even number. However, instead of placing terms into those positions in monotone order this sequence recursively permutes the order of both subsets with the emerging permutation itself.
Are there any other fixed points than 1, 13, 54, 120, 1389, 3183, ... ?


LINKS

Antti Karttunen, Table of n, a(n) for n = 1..10000
Index entries for sequences that are permutations of the natural numbers


FORMULA

a(1) = 1; thereafter, if A008966(n) = 0 [i.e., n is a term of A013929, not squarefree], a(n) = 2*a(A057627(n)); otherwise a(n) = 2*a(A013928(n+1)1)+1, [where A057627 and A013928(n+1) give the number of integers <= n divisible/not divisible by a square greater than one].
For all n, A000035(a(n)) = A008966(n) = A008683(n)^2, or equally, a(n) = mu(n) modulo 2. The same property holds for A243352.


PROG

(Scheme, with memoizing definecmacro from Antti Karttunen's IntSeqlibrary)
(definec (A243343 n) (cond ((<= n 1) n) ((zero? (A008966 n)) (* 2 (A243343 (A057627 n)))) (else (+ (* 2 (A243343 ( (A013928 (+ n 1)) 1))) 1))))


CROSSREFS

Inverse: A243344.
Cf. A005843, A005408, A008966, A005117, A013929, A013928, A057627.
Similar permutations: A243352 (simple variant), A243345A243346, A243347, A243287A243288, A135141A227413, A237126A237427, A193231.
Sequence in context: A163917 A266417 A260433 * A255565 A227351 A246377
Adjacent sequences: A243340 A243341 A243342 * A243344 A243345 A243346


KEYWORD

nonn


AUTHOR

Antti Karttunen, Jun 03 2014


STATUS

approved



