cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A250246 Permutation of natural numbers: a(1) = 1, a(n) = A246278(A055396(n), a(A078898(n))).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 27, 22, 23, 24, 25, 26, 21, 28, 29, 30, 31, 32, 45, 34, 35, 36, 37, 38, 33, 40, 41, 54, 43, 44, 81, 46, 47, 48, 49, 50, 75, 52, 53, 42, 125, 56, 63, 58, 59, 60, 61, 62, 39, 64, 55, 90, 67, 68, 135, 70, 71, 72, 73, 74, 51, 76, 77, 66, 79, 80, 99, 82, 83
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2014

Keywords

Crossrefs

Inverse: A250245.
Other similar permutations: A250243, A250248, A250250, A163511, A252756.
Differs from the "vanilla version" A249818 for the first time at n=42, where a(42) = 54, while A249818(42) = 42.
Differs from A250250 for the first time at n=73, where a(73) = 73, while A250250(73) = 103.

Programs

  • 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; };
    A020639(n) = if(n>1, if(n>n=factor(n, 0)[1, 1], n, factor(n)[1, 1]), 1); \\ From A020639
    A055396(n) = if(1==n,0,primepi(A020639(n)));
    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
    (definec (A250246 n) (cond ((<= n 1) n) ((even? n) (* 2 (A250246 (/ n 2)))) (else (A003961 (A250246 (A250470 n))))))
    (define (A250246 n) (A163511 (A252756 n)))

Formula

a(1) = 1, a(n) = A246278(A055396(n), a(A078898(n))).
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:
a(n) = A163511(A252756(n)).
Other identities. For all n >= 1:
a(n) = a(2n)/2. [The even bisection halved gives the sequence back.]
A020639(a(n)) = A020639(n) and A055396(a(n)) = A055396(n). [Preserves the smallest prime factor of n].
A001221(a(n)) = A302041(n).
A001222(a(n)) = A253557(n).
A008683(a(n)) = A302050(n).
A000005(a(n)) = A302051(n)
A010052(a(n)) = A302052(n), for n >= 1.
A056239(a(n)) = A302039(n).