OFFSET
1,2
LINKS
FORMULA
a(1) = 1, a(2n) = 2*a(n), a(2n+1) = A003961(a(A250470(2n+1))). - Antti Karttunen, Jan 18 2015 - Instead of A250470, one may use A268674 in above formula. - Antti Karttunen, Apr 01 2018
As a composition of related permutations:
Other identities. For all n >= 1:
a(n) = a(2n)/2. [The even bisection halved gives the sequence back.]
PROG
(PARI)
up_to = 16384;
ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om, invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om, invec[i], (1+pt))); outvec; };
v078898 = ordinal_transform(vector(up_to, n, A020639(n)));
A078898(n) = v078898[n];
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
A250246(n) = if(1==n, n, my(k = 2*A250246(A078898(n)), r = A055396(n)); if(1==r, k, while(r>1, k = A003961(k); r--); (k))); \\ Antti Karttunen, Apr 01 2018
(Scheme, with memoizing-macro definec from Antti Karttunen's IntSeq-library, three alternative definitions)
(definec (A250246 n) (cond ((<= n 1) n) (else (A246278bi (A055396 n) (A250246 (A078898 n)))))) ;; Code for A246278bi given in A246278
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 17 2014
STATUS
approved