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.
%I A264974 #17 May 25 2017 03:16:44 %S A264974 0,1,2,3,4,5,6,7,16,9,10,19,12,13,14,15,8,17,18,11,20,21,34,43,48,25, %T A264974 52,27,28,55,30,37,46,57,22,49,36,31,58,39,40,41,42,23,50,45,32,59,24, %U A264974 35,44,51,26,53,54,29,56,33,38,47,60,61,142,63,88,169,102,115,124,129,70,151,144,97,178,75,106,133,156,79,160,81 %N A264974 Self-inverse permutation of natural numbers: a(n) = A263273(4*n) / 4. %H A264974 Antti Karttunen, <a href="/A264974/b264974.txt">Table of n, a(n) for n = 0..4921</a> %H A264974 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A264974 a(n) = A263273(4*n) / 4. %F A264974 a(n) = A264986(n) / 2 = A263272(2*n) / 2. %F A264974 As a composition of related permutations: %F A264974 a(n) = A264975(A263272(n)) = A263272(A264976(n)). %F A264974 Other identities. For all n >= 0: %F A264974 a(3*n) = 3*a(n). %F A264974 A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.] %F A264974 A264978(n) = a(2n)/2. [Thus the restriction onto even numbers induces yet another permutation.] %o A264974 (Scheme, three variants) %o A264974 (define (A264974 n) (/ (A263273 (* 4 n)) 4)) %o A264974 (define (A264974 n) (/ (A264986 n) 2)) %o A264974 (define (A264974 n) (/ (A263272 (* 2 n)) 2)) %o A264974 (Python) %o A264974 from sympy import factorint %o A264974 from sympy.ntheory.factor_ import digits %o A264974 from operator import mul %o A264974 def a030102(n): return 0 if n==0 else int(''.join(map(str, digits(n, 3)[1:][::-1])), 3) %o A264974 def a038502(n): %o A264974 f=factorint(n) %o A264974 return 1 if n==1 else reduce(mul, [1 if i==3 else i**f[i] for i in f]) %o A264974 def a038500(n): return n/a038502(n) %o A264974 def a263273(n): return 0 if n==0 else a030102(a038502(n))*a038500(n) %o A264974 def a(n): return a263273(4*n)/4 # _Indranil Ghosh_, May 25 2017 %Y A264974 Terms of A264986 halved. %Y A264974 Cf. A263272, A263273, A264978. %Y A264974 Cf. also A264975, A264976. %K A264974 nonn,base %O A264974 0,3 %A A264974 _Antti Karttunen_, Dec 05 2015