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.

A032841 Numbers whose base-3 representation Sum_{i=0..m} d(i)*3^i has d(m) < d(m-1) > d(m-2) < ...

This page as a plain text file.
%I A032841 #23 Jun 16 2024 01:38:13
%S A032841 1,2,5,15,16,46,47,50,138,141,142,150,151,415,416,424,425,428,451,452,
%T A032841 455,1245,1248,1249,1272,1275,1276,1284,1285,1353,1356,1357,1365,1366,
%U A032841 3736,3737,3745,3746,3749,3817,3818,3826,3827
%N A032841 Numbers whose base-3 representation Sum_{i=0..m} d(i)*3^i  has d(m) < d(m-1) > d(m-2) < ...
%C A032841 For any a(n) == 0 (mod 3), 3*a(n)+1 and 3*a(n)+2 are also in the sequence, but 3*a(n) is not. Likewise, for any a(n) == 2 (mod 3) -- except for a(2)=2 -- 3*a(n) and 3*a(n)+1 are in the sequence but 3*a(n)+2 is not. - _Christian N. K. Anderson_, May 21 2024
%H A032841 Christian N. K. Anderson, <a href="/A032841/b032841.txt">Table of n, a(n) for n = 1..10000</a>
%e A032841 The numbers {415, 416, 424, 425, 428, 451, 452, 455} are in the sequence because in base 3 they are {120101, 120102, 120201, 120202, 120212, 121201, 121202, 121212}; all the six-digit base-3 numbers that fit the pattern. - _Christian N. K. Anderson_, May 21 2024
%o A032841 (R)
%o A032841 updown.base<-function(base,ndig,curdig=1,diglist=rep(NA,ndig)) {
%o A032841 if(curdig>ndig) return(sum(base^(ndig:1-1)*diglist)); nextstep<-function(i) {diglist[curdig]=i; updown.base(base,ndig,curdig+1,diglist)}; if(curdig==1) return(sort(unlist(sapply(1:(base-2+(ndig==1)), nextstep)))); if(curdig%%2) return(sapply((diglist[curdig-1]-1):0, nextstep)); sapply((diglist[curdig-1]+1):(base-1), nextstep) }; sapply(1:10,function(nd) updown.base(3,nd)) # _Christian N. K. Anderson_, May 21 2024
%Y A032841 Cf. A032850 for digits <= or >= previous digit (also in base 3).
%Y A032841 Cf. A032842 for same sequence in base 4, A032843 base 5, A032844 base 6, A032845 base 7, A032846 base 8, A032847 base 9, A032848 base 10, and A032849 base 2.
%K A032841 nonn,base
%O A032841 1,2
%A A032841 _Clark Kimberling_