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.

A257797 Permutation of natural numbers: a(1) = 1, a(triangular(n)) = 1+(2*a(n-1)), a(nontriangular(n)) = 2*n, where triangular = A000217, nontriangular = A014132.

This page as a plain text file.
%I A257797 #12 May 24 2015 13:38:03
%S A257797 1,2,3,4,6,5,8,12,10,7,16,24,20,14,9,32,48,40,28,18,13,64,96,80,56,36,
%T A257797 26,11,128,192,160,112,72,52,22,17,256,384,320,224,144,104,44,34,25,
%U A257797 512,768,640,448,288,208,88,68,50,21,1024,1536,1280,896,576,416,176,136,100,42,15
%N A257797 Permutation of natural numbers: a(1) = 1, a(triangular(n)) = 1+(2*a(n-1)), a(nontriangular(n)) = 2*n, where triangular = A000217, nontriangular = A014132.
%H A257797 Antti Karttunen, <a href="/A257797/b257797.txt">Table of n, a(n) for n = 1..10440</a>
%H A257797 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A257797 a(1) = 1; for n > 1: if A010054(n) = 1 [when n is triangular], then a(n) = 1+(2*a(A002024(n)-1)), otherwise a(n) = 2*a(A083920(n)).
%o A257797 (Scheme, with memoizing definec-macro)
%o A257797 (definec (A257797 n) (cond ((<= n 1) n) ((zero? (A010054 n)) (* 2 (A257797 (A083920 n)))) (else (+ 1 (* 2 (A257797 (+ -1 (A002024 n))))))))
%Y A257797 Inverse: A257798.
%Y A257797 Cf. A000217, A002024, A010054, A083920.
%Y A257797 Cf. also a similar permutation A220347 from which this differs for the first time at n=15, where a(15) = 9, while A220347(15) = 11.
%Y A257797 a(n) differs from A054582(n-1) for the first time at n=21, where a(21) = 13, while A054582(20) = 11.
%K A257797 nonn
%O A257797 1,2
%A A257797 _Antti Karttunen_, May 18 2015