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.

A037314 Numbers whose base-3 and base-9 expansions have the same digit sum.

This page as a plain text file.
%I A037314 #67 May 03 2024 15:17:48
%S A037314 0,1,2,9,10,11,18,19,20,81,82,83,90,91,92,99,100,101,162,163,164,171,
%T A037314 172,173,180,181,182,729,730,731,738,739,740,747,748,749,810,811,812,
%U A037314 819,820,821,828,829,830,891,892,893,900,901,902,909,910,911
%N A037314 Numbers whose base-3 and base-9 expansions have the same digit sum.
%C A037314 a(n) = Sum_{i=0..m} d(i)*9^i, where Sum_{i=0..m} d(i)*3^i is the base-3 representation of n.
%C A037314 Numbers that can be written using only digits 0, 1 and 2 in base 9. Also, write n in base 3, read as base 9: (3) [n] (9) in base change notation. a(3n+k) = 9a(n)+k for k in {0,1,2}. - _Franklin T. Adams-Watters_, Jul 24 2006
%C A037314 Also, every term k corresponds to a unique pair i,j with k = a(i) + 3*a(j) (similarly to the Moser-de Bruijn sequence). - _Luis Rato_, May 02 2024
%F A037314 G.f. f(x) = Sum_{j>=0} 9^j*x^(3^j)*(1+x^(3^j)-2*x^(2*3^j))/((1-x)*(1-x^(3^(j+1)))) satisfies f(x) = 9*(x^2+x+1)*f(x^3) + x*(1+2*x)/(1-x^3). - _Robert Israel_, Apr 13 2015
%t A037314 Table[FromDigits[RealDigits[n, 3], 9], {n, 1, 100}] (* _Clark Kimberling_, Aug 14 2012 *)
%t A037314 Select[Range[0,1000],Total[IntegerDigits[#,3]]==Total[IntegerDigits[#,9]]&] (* _Harvey P. Dale_, Feb 17 2020 *)
%o A037314 (PARI) a(n) = {my(d = digits(n, 3)); subst(Pol(d), x, 9);} \\ _Michel Marcus_, Apr 09 2015
%o A037314 (Julia)
%o A037314 function a(n)
%o A037314     m, r, b = n, 0, 1
%o A037314     while m > 0
%o A037314         m, q = divrem(m, 3)
%o A037314         r += b * q
%o A037314         b *= 9
%o A037314     end
%o A037314 r end
%o A037314 [a(n) for n in 0:53] |> println # _Peter Luschny_, Jan 03 2021
%Y A037314 Cf. A007089, A208665, A338086 (ternary digit duplication).
%Y A037314 Cf. A053735, A053830.
%K A037314 nonn,base
%O A037314 0,3
%A A037314 _Clark Kimberling_
%E A037314 Edited by _N. J. A. Sloane_ at the suggestion of _Andrew S. Plewe_, Jun 08 2007
%E A037314 Offset changed to 0 by _Clark Kimberling_, Aug 14 2012