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.

Previous Showing 41-50 of 117 results. Next

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

Original entry on oeis.org

0, 1, 2, 9, 10, 11, 18, 19, 20, 81, 82, 83, 90, 91, 92, 99, 100, 101, 162, 163, 164, 171, 172, 173, 180, 181, 182, 729, 730, 731, 738, 739, 740, 747, 748, 749, 810, 811, 812, 819, 820, 821, 828, 829, 830, 891, 892, 893, 900, 901, 902, 909, 910, 911
Offset: 0

Views

Author

Keywords

Comments

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.
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
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

Crossrefs

Cf. A007089, A208665, A338086 (ternary digit duplication).

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 3)
            r += b * q
            b *= 9
        end
    r end
    [a(n) for n in 0:53] |> println # Peter Luschny, Jan 03 2021
  • Mathematica
    Table[FromDigits[RealDigits[n, 3], 9], {n, 1, 100}] (* Clark Kimberling, Aug 14 2012 *)
    Select[Range[0,1000],Total[IntegerDigits[#,3]]==Total[IntegerDigits[#,9]]&] (* Harvey P. Dale, Feb 17 2020 *)
  • PARI
    a(n) = {my(d = digits(n, 3)); subst(Pol(d), x, 9);} \\ Michel Marcus, Apr 09 2015
    

Formula

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

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jun 08 2007
Offset changed to 0 by Clark Kimberling, Aug 14 2012

A230641 a(n) = n + (sum of digits in base-3 representation of n).

Original entry on oeis.org

0, 2, 4, 4, 6, 8, 8, 10, 12, 10, 12, 14, 14, 16, 18, 18, 20, 22, 20, 22, 24, 24, 26, 28, 28, 30, 32, 28, 30, 32, 32, 34, 36, 36, 38, 40, 38, 40, 42, 42, 44, 46, 46, 48, 50, 48, 50, 52, 52, 54, 56, 56, 58, 60, 56, 58, 60, 60, 62, 64, 64, 66, 68, 66, 68, 70, 70, 72, 74, 74, 76, 78, 76, 78, 80, 80, 82, 84, 84, 86, 88, 82
Offset: 0

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Comments

The image of this sequence is the set of nonnegative even numbers (A005843). Joshi (1973) proved that the sequence of base-q self numbers (analogous to A003052) is the sequence of odd numbers (A005408) for all odd q. - Amiram Eldar, Nov 28 2020

References

  • V. S. Joshi, Ph.D. dissertation, Gujarat Univ., Ahmedabad (India), October, 1973.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)

Programs

  • Haskell
    a230641 n = a053735 n + n  -- Reinhard Zumkeller, May 19 2015
  • Mathematica
    Table[n + Plus @@ IntegerDigits[n, 3], {n, 0, 100}] (* Amiram Eldar, Nov 28 2020 *)

Formula

a(n) = n + A053735(n). - Amiram Eldar, Nov 28 2020

A065368 Alternating sum of ternary digits in n. Replace 3^k with (-1)^k in ternary expansion of n.

Original entry on oeis.org

0, 1, 2, -1, 0, 1, -2, -1, 0, 1, 2, 3, 0, 1, 2, -1, 0, 1, 2, 3, 4, 1, 2, 3, 0, 1, 2, -1, 0, 1, -2, -1, 0, -3, -2, -1, 0, 1, 2, -1, 0, 1, -2, -1, 0, 1, 2, 3, 0, 1, 2, -1, 0, 1, -2, -1, 0, -3, -2, -1, -4, -3, -2, -1, 0, 1, -2, -1, 0, -3, -2, -1, 0, 1, 2, -1, 0, 1, -2, -1, 0, 1, 2, 3, 0, 1, 2, -1, 0, 1, 2, 3, 4, 1, 2, 3, 0, 1, 2, 3, 4, 5, 2, 3
Offset: 0

Views

Author

Marc LeBrun, Oct 31 2001

Keywords

Comments

Notation: (3)[n](-1).
Fixed point of the morphism 0 -> 0,1,2; 1 -> -1,0,1; 2 -> -2,-1,0; ...; n -> -n,-n+1,-n+2. - Philippe Deléham, Oct 22 2011

Examples

			15 = +1(9)+2(3)+0(1) -> +1(+1)+2(-1)+0(+1) = -1 = a(15).
		

Crossrefs

Programs

  • Python
    from sympy.ntheory.digits import digits
    def a(n):
        return sum(bi*(-1)**k for k, bi in enumerate(digits(n, 3)[1:][::-1]))
    print([a(n) for n in range(104)]) # Michael S. Branicky, Jul 28 2021
    
  • Python
    from sympy.ntheory import digits
    def A065368(n): return sum((0, 1, 2, -1, 0, 1, -2, -1, 0)[i] for i in digits(n,9)[1:]) # Chai Wah Wu, Jul 19 2024

Formula

a(n) = Sum_{k>=0} A030341(n,k)*(-1)^k. - Philippe Deléham, Oct 22 2011.
G.f. A(x) satisfies: A(x) = x * (1 + 2*x) / (1 - x^3) - (1 + x + x^2) * A(x^3). - Ilya Gutkovskiy, Jul 28 2021

Extensions

Initial 0 added by Philippe Deléham, Oct 22 2011

A230643 Number of integers m such that m + (sum of digits in base-3 representation of m) = 2n.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 3, 2, 3, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 3, 2, 3, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 3, 2, 3, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 3, 2, 3, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 3, 2, 3, 1, 2, 2, 2
Offset: 0

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Comments

Number of times 2n appears in A230641.

Crossrefs

Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)

A010063 a(n+1) = a(n) + sum of digits in base 3 representation of a(n), with a(0) = 1.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 14, 18, 20, 24, 28, 30, 32, 36, 38, 42, 46, 50, 56, 60, 64, 68, 74, 80, 88, 92, 96, 100, 104, 110, 114, 118, 122, 128, 134, 142, 148, 154, 160, 168, 172, 176, 182, 188, 196, 202, 208, 214, 222, 228, 234, 240, 248, 252, 254, 258
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    NestList[#+Total[IntegerDigits[#,3]]&,1,60] (* Harvey P. Dale, Jun 14 2022 *)

Extensions

More terms from Neven Juric, Apr 11 2008

A230639 Let M(1)=0 and for n>1, B(n)=(M(ceiling(n/2))+M(floor(n/2))+2)/2, M(n)=3^B(n)+M(floor(n/2))+1. This sequence gives B(n).

Original entry on oeis.org

1, 3, 5, 17, 29, 139, 249, 64570209, 129140169, 34315253252541, 68630377364913, 1044297913696328396542704032390321722034449074468444246791788357605, 2088595827392656793085408064780643444068898148936888424953199350297
Offset: 2

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Comments

The largest power of 3 in M(n) = A230640(n).

Crossrefs

Cf. A230093, A230640 (for M(n)).
Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)

Programs

  • Maple
    f:=proc(n) option remember; local B, M;
    if n<=1 then RETURN([0, 0]);
    else
    B:=(f(ceil(n/2))[2] + f(floor(n/2))[2] + 2)/2;
    M:=3^B+f(floor(n/2))[2]+1; RETURN([B, M]); fi;
    end proc;
    [seq(f(n)[1], n=1..9)];

Extensions

Terms a(10) onward from Max Alekseyev, Nov 02 2013

A230642 Number of integers m such that m + (sum of digits in base-3 representation of m) = n.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 0, 3, 0, 2, 0, 3, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 0, 3, 0, 2, 0, 3, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 3, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2
Offset: 0

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Comments

The usual convention in the OEIS is to omit the zero terms when every second term is zero. An exception was made in this case in order to preserve the parallels with A228085 and A230632. See also A230663.
a(n) is the number of times n occurs in A230641.

Crossrefs

Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)

A230853 Numbers n such that m + (sum of digits in base-3 representation of m) = n has exactly one solution.

Original entry on oeis.org

0, 2, 6, 16, 26, 34, 44, 54, 62, 72, 98, 108, 116, 126, 136, 144, 154, 180, 190, 198, 208, 218, 226, 236, 260, 270, 278, 288, 298, 306, 316, 342, 352, 360, 370, 380, 388, 398, 424, 434, 442, 452, 462, 470, 480, 504, 514, 522, 532, 542, 550, 560, 586, 596, 604, 614, 624, 632, 642, 668, 678, 686
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Crossrefs

Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)

Programs

  • Mathematica
    Select[Tally[Table[m+Total[IntegerDigits[m,3]],{m,0,700}]],#[[2]]==1&][[;;,1]] (* Harvey P. Dale, Feb 13 2023 *)

A230854 Numbers n such that m + (sum of digits in base-3 representation of m) = n has exactly two solutions.

Original entry on oeis.org

4, 8, 10, 12, 14, 18, 20, 22, 24, 30, 36, 38, 40, 42, 46, 48, 50, 52, 58, 64, 66, 68, 70, 74, 76, 78, 80, 82, 88, 90, 92, 94, 96, 100, 102, 104, 106, 112, 118, 120, 122, 124, 128, 130, 132, 134, 140, 146, 148, 150, 152, 156, 158, 160, 162, 164, 170, 172, 174, 176, 178, 182, 184, 186, 188
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Crossrefs

Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)

Programs

  • Mathematica
    Select[Tally[Table[m+Total[IntegerDigits[m,3]],{m,200}]],#[[2]]==2&][[All,1]] (* Harvey P. Dale, Aug 17 2019 *)

A230855 Numbers n such that m + (sum of digits in base-3 representation of m) = n has exactly three solutions.

Original entry on oeis.org

28, 32, 56, 60, 84, 86, 110, 114, 138, 142, 166, 168, 192, 196, 220, 224, 244, 252, 272, 276, 300, 304, 328, 330, 354, 358, 382, 386, 410, 412, 436, 440, 464, 468, 488, 496, 516, 520, 544, 548, 572, 574, 598, 602, 626, 630, 654, 656, 680, 684, 708, 712, 730, 732, 734, 736, 738, 740, 758, 762
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Crossrefs

Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)
Previous Showing 41-50 of 117 results. Next