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.

A026178 a(n) is the position of n in A026177.

This page as a plain text file.
%I A026178 #27 Mar 12 2020 00:25:43
%S A026178 1,3,4,2,7,9,10,12,13,5,16,6,19,21,22,8,25,27,28,30,31,11,34,36,37,39,
%T A026178 40,14,43,15,46,48,49,17,52,18,55,57,58,20,61,63,64,66,67,23,70,24,73,
%U A026178 75,76,26,79,81,82,84,85,29,88,90,91,93,94
%N A026178 a(n) is the position of n in A026177.
%C A026178 Inverse of A026177.
%C A026178 From _Kevin Ryde_, Feb 06 2020: (Start)
%C A026178 The formulas below are seen by considering values taken in the inverse A026177.  Dekking's case II there is here a(2n) = n when lowest non-0 ternary digit LNZ(n) = A060236(n) = 2, which is LNZ(2n)=1.  Otherwise case III is here a(2n+1) = 3n+1 and case IV is here a(2n) = 3n.  These can be combined by a floor (the inverse of the ceiling in A026177).
%C A026178 For positive c with LNZ(c)=1, so c = (3j+1)*3^k = A026225, this sequence has a self-similarity in that taking the values which are multiples of c, and dividing them by c, gives the full sequence again.  Using the inverse A026177, a(n)=c*m here is located at n = A026177(c*m) = c*A026177(m) - (floor(c/3) if m==1 (mod 3)) since c*m goes to the same bigger or smaller case in A026177 as m does.  Then since floor(c/2) < c, values c*m are in the same order as all values m.
%C A026178 (End)
%H A026178 Michael De Vlieger, <a href="/A026178/b026178.txt">Table of n, a(n) for n = 1..10000</a>
%H A026178 F. M. Dekking, <a href="https://arxiv.org/abs/2001.08915">Permutations of N generated by left-right filling algorithms</a>, arXiv:2001.08915 [math.CO], 2020.
%F A026178 From _Kevin Ryde_, Feb 06 2020: (Start)
%F A026178 a(n) = n/2 if n even and A060236(n)=1, otherwise a(n) = floor(3n/2), where A060236(n) is the lowest non-0 ternary digit of n.
%F A026178 a(3n) = 3*a(n) + (1 if n odd).
%F A026178 (End)
%t A026178 Values[Take[#, LengthWhile[Differences@ Keys@ #, # == 1 &]]][[All, 1]] &@ KeySort@ PositionIndex@ Array[If[Mod[#/3^IntegerExponent[#, 3], 3] == 1, Ceiling[2 #/3], 2 #] &, 94] (* or *)
%t A026178 Block[{nn = 63, s}, s = Array[If[Mod[#/3^IntegerExponent[#, 3], 3] == 1, Ceiling[2 #/3], 2 #] &, Ceiling[3 nn/2]]; Array[FirstPosition[s, #][[1]] &, nn]] (* _Michael De Vlieger_, Feb 08 2020 *)
%o A026178 (PARI) a(n) = if(n%2 || (n/3^valuation(n,3))%3==2, floor(3*n/2), n/2);
%Y A026178 Cf. A026177 (inverse).
%K A026178 nonn
%O A026178 1,2
%A A026178 _Clark Kimberling_
%E A026178 Edited by _N. J. A. Sloane_, Feb 05 2020