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.

A023745 Plaindromes: numbers whose digits in base 3 are in nondecreasing order.

This page as a plain text file.
%I A023745 #38 Apr 08 2025 17:14:46
%S A023745 0,1,2,4,5,8,13,14,17,26,40,41,44,53,80,121,122,125,134,161,242,364,
%T A023745 365,368,377,404,485,728,1093,1094,1097,1106,1133,1214,1457,2186,3280,
%U A023745 3281,3284,3293,3320,3401,3644,4373,6560,9841,9842,9845,9854
%N A023745 Plaindromes: numbers whose digits in base 3 are in nondecreasing order.
%H A023745 Harvey P. Dale, <a href="/A023745/b023745.txt">Table of n, a(n) for n = 1..1000</a>
%H A023745 A. V. Kitaev, <a href="https://arxiv.org/abs/1809.00122">Meromorphic Solution of the Degenerate Third Painlevé Equation Vanishing at the Origin</a>, arXiv:1809.00122 [math.CA], 2018.
%F A023745 Numbers that in ternary are the concatenation of i 1's with j 2's, i, j>=0. Also a(n) = A073216(n+1) - 1. Proof: Write a(n) as 1{m}2{n}, then adding 1 gives 1{m-1}20{n} for m>0 and 10{n} for m=0. Doubling yields 10{m-1}10{n} or 20{n}, respectively. These two forms exactly describe the forms of sums of two powers of 3, the two powers being 3^n and 3^(m+n). - _Hugo van der Sanden_
%e A023745 In base 3 these numbers are 0, 1, 2, 11, 12, 22, 111, 112, 122, 222, 1111, 1112, ... [corrected by _Sean A. Irvine_, Jun 10 2019]
%t A023745 Select[Range[0,10000],!Negative[Min[Differences[IntegerDigits[ #,3]]]]&] (* or *) With[{nn=10},FromDigits[#,3]&/@Union[Flatten[Table[ PadRight[ PadLeft[{},n,1],x,2],{n,0,nn},{x,0,nn}],1]]] (* _Harvey P. Dale_, Oct 12 2011 *)
%t A023745 Select[Range[0,10000],LessEqual@@IntegerDigits[#,3]&] (* _Ray Chandler_, Jan 06 2014 *)
%o A023745 (Python)
%o A023745 from math import isqrt
%o A023745 def A023745(n): return (3**(a:=(k:=isqrt(m:=n<<1))+(m>k*(k+1))-1)+3**(n-1-(a*(a+1)>>1))>>1)-1 # _Chai Wah Wu_, Apr 08 2025
%Y A023745 Cf. A023746 onwards. In base 2 we get A000225.
%K A023745 nonn,base,easy
%O A023745 1,3
%A A023745 _Olivier Gérard_
%E A023745 Change offset to 1 by _Ray Chandler_, Jan 06 2014