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.

A353653 Unique monotonic sequence of positive integers satisfying a(a(n)) = k*(n-1) + 3, where k = 6.

This page as a plain text file.
%I A353653 #27 Sep 22 2023 08:19:13
%S A353653 2,3,9,10,11,12,13,14,15,21,27,33,39,45,51,52,53,54,55,56,57,58,59,60,
%T A353653 61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,
%U A353653 84,85,86,87,93,99,105,111,117,123,129,135,141,147,153,159,165
%N A353653 Unique monotonic sequence of positive integers satisfying a(a(n)) = k*(n-1) + 3, where k = 6.
%C A353653 Numbers m such that the base-6 representation of (5*m-3) starts with 11 or 12 or 13 or 14 or 15 or ends with 0.
%C A353653 First differences give a run of 6^i 1's followed by a run of 6^i 6's, for i >= 0.
%H A353653 Yifan Xie, <a href="/A353653/b353653.txt">Table of n, a(n) for n = 1..10000</a>
%H A353653 <a href="/index/Aa#aan">Index entries for sequences of the a(a(n)) = 2n family</a>
%F A353653 For n in the range (2*6^i + 3)/5 <= n < (7*6^i + 3)/5, for i >= 0:
%F A353653   a(n) = n + 6^i.
%F A353653   a(n+1) = 1 + a(n).
%F A353653 Otherwise, for n in the range (7*6^i + 3)/5 <= n < (12*6^i + 3)/5, for i >= 0:
%F A353653   a(n) = 6*(n - 6^i) - 3.
%F A353653   a(n+1) = 6 + a(n).
%e A353653 a(5) = 11 because (2*6^1 + 3)/3 <= 5 < (7*6^1 + 3)/5, hence a(5) = 5 + 6^1 = 11;
%e A353653 a(10) = 21 because (7*6^1 + 3)/5 <= 10 < (12*6^1 + 3)/5, hence a(10) = 6*(10 - 6^1) - 3 = 21.
%t A353653 okQ[m_] := With[{id = IntegerDigits[5 m - 3, 6] }, MatchQ[id[[1 ;; 2]], {1, 1}|{1, 2}|{1, 3}|{1, 4}|{1, 5}] || id[[-1]] == 0];
%t A353653 Join[{2}, Select[Range[3, 1000], okQ]] (* _Jean-François Alcover_, Sep 22 2023 *)
%o A353653 (C++)
%o A353653 /* program used to generate the b-file */
%o A353653 #include<iostream>
%o A353653 using namespace std;
%o A353653 int main(){
%o A353653     int cnt1=1, flag=0, cnt2=1, a=2;
%o A353653     for(int n=1; n<=10000; n++) {
%o A353653         cout<<n<<" "<<a<<endl;
%o A353653         if(cnt2==cnt1) {
%o A353653             flag=1-flag;
%o A353653             cnt1=1;
%o A353653             if(flag) a+=1;
%o A353653             else {
%o A353653                 a+=6;
%o A353653                 cnt2*=6;
%o A353653             }
%o A353653         }
%o A353653         else {
%o A353653             cnt1++;
%o A353653             a+=(flag?6:1);
%o A353653         }
%o A353653     }
%o A353653     return 0;
%o A353653 }
%Y A353653 For other values of k: A080637 (k=2), A003605 (k=3), A353651 (k=4), A353652 (k=5), this sequence (k=6).
%K A353653 nonn,easy
%O A353653 1,1
%A A353653 _Yifan Xie_, Jul 15 2022