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.

A253887 Row index of n in A191450: a(3n) = 2n, a(3n+1) = 2n+1, a(3n+2) = a(n+1).

This page as a plain text file.
%I A253887 #32 Mar 16 2021 10:22:56
%S A253887 1,1,2,3,1,4,5,2,6,7,3,8,9,1,10,11,4,12,13,5,14,15,2,16,17,6,18,19,7,
%T A253887 20,21,3,22,23,8,24,25,9,26,27,1,28,29,10,30,31,11,32,33,4,34,35,12,
%U A253887 36,37,13,38,39,5,40,41,14,42,43,15,44,45,2,46,47,16,48,49,17,50,51,6,52,53,18,54,55,19,56,57,7
%N A253887 Row index of n in A191450: a(3n) = 2n, a(3n+1) = 2n+1, a(3n+2) = a(n+1).
%C A253887 a(n) gives the row index of n in square array A191450, or equally, the column index of n in A254051.
%H A253887 Antti Karttunen, <a href="/A253887/b253887.txt">Table of n, a(n) for n = 1..10000</a>
%F A253887 a(3n) = 2n, a(3n+1) = 2n+1, a(3n+2) = a(n+1).
%F A253887 a(n) = A126760(2n-1).
%F A253887 a(n) = A249746(A003602(A064216(n))). - _Antti Karttunen_, Feb 04 2015
%o A253887 (Scheme, with memoization-macro definec)
%o A253887 (definec (A253887 n) (if (= 2 (modulo n 3)) (A253887 (/ (+ 1 n) 3)) (inv_for_A032766 n)))
%o A253887 (define (inv_for_A032766 n) (+ (* 2 (floor->exact (/ n 3))) (modulo n 3)))
%o A253887 (Python)
%o A253887 def a(n):
%o A253887     if n%3==0: return 2*n//3
%o A253887     elif n%3==1: return 2*(n - 1)//3 + 1
%o A253887     else: return a((n - 2)//3 + 1)
%o A253887 print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Jun 06 2017
%Y A253887 Odd bisection of A126760.
%Y A253887 Cf. A254046 (the corresponding column index).
%Y A253887 Cf. A003602, A032766, A064216, A253786, A253893, A249746.
%Y A253887 Cf. A191450, A254051, A254047, A254052, A254104.
%K A253887 nonn
%O A253887 1,3
%A A253887 _Antti Karttunen_, Jan 22 2015