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.

Showing 1-10 of 11 results. Next

A053735 Sum of digits of (n written in base 3).

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 5, 4, 5, 6, 1, 2, 3, 2, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 5, 4, 5, 6, 3, 4, 5, 4, 5, 6, 5, 6, 7, 2, 3, 4, 3, 4, 5, 4, 5, 6, 3, 4, 5, 4, 5, 6, 5, 6, 7, 4, 5, 6, 5, 6, 7, 6, 7, 8, 1, 2, 3, 2, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 5, 4, 5, 6, 3, 4, 5, 4, 5, 6
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

Also the fixed point of the morphism 0->{0,1,2}, 1->{1,2,3}, 2->{2,3,4}, etc. - Robert G. Wilson v, Jul 27 2006

Examples

			a(20) = 2 + 0 + 2 = 4 because 20 is written as 202 base 3.
From _Omar E. Pol_, Feb 20 2010: (Start)
This can be written as a triangle with row lengths A025192 (see the example in the entry A000120):
0,
1,2,
1,2,3,2,3,4,
1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6,
1,2,3,2,3,4,3,4,5,2,3,4,3,4,5,4,5,6,3,4,5,4,5,6,5,6,7,2,3,4,3,4,5,4,5,6,3,...
where the k-th row contains a(3^k+i) for 0<=i<2*3^k and converges to A173523 as k->infinity. (End) [Changed conjectures to statements in this entry. - _Franklin T. Adams-Watters_, Jul 02 2015]
G.f. = x + 2*x^2 + x^3 + 2*x^4 + 3*x^5 + 2*x^6 + 3*x^7 + 4*x^8 + x^9 + 2*x^10 + ...
		

Crossrefs

Cf. A065363, A007089, A173523. See A134451 for iterations.
Sum of digits of n written in bases 2-16: A000120, this sequence, A053737, A053824, A053827, A053828, A053829, A053830, A007953, A053831, A053832, A053833, A053834, A053835, A053836.
Related base-3 sequences: A006047, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1), A286585, A286632, A289813, A289814.

Programs

  • Haskell
    a053735 = sum . a030341_row
    -- Reinhard Zumkeller, Feb 21 2013, Feb 19 2012
    
  • MATLAB
    m=1; for u=0:104; sol(m)=sum(dec2base(u,3)-'0'); m=m+1;end
    sol; % Marius A. Burtea, Jan 17 2019
  • Magma
    [&+Intseq(n,3):n in [0..104]]; // Marius A. Burtea, Jan 17 2019
    
  • Maple
    seq(convert(convert(n,base,3),`+`),n=0..100); # Robert Israel, Jul 02 2015
  • Mathematica
    Table[Plus @@ IntegerDigits[n, 3], {n, 0, 100}] (* or *)
    Nest[Join[#, # + 1, # + 2] &, {0}, 6] (* Robert G. Wilson v, Jul 27 2006 and modified Jul 27 2014 *)
  • PARI
    {a(n) = if( n<1, 0, a(n\3) + n%3)}; /* Michael Somos, Mar 06 2004 */
    
  • PARI
    A053735(n)=sumdigits(n,3) \\ Requires version >= 2.7. Use sum(i=1,#n=digits(n,3),n[i]) in older versions. - M. F. Hasler, Mar 15 2016
    
  • Scheme
    (define (A053735 n) (let loop ((n n) (s 0)) (if (zero? n) s (let ((d (mod n 3))) (loop (/ (- n d) 3) (+ s d)))))) ;; For R6RS standard. Use modulo instead of mod in older Schemes like MIT/GNU Scheme. - Antti Karttunen, Jun 03 2017
    

Formula

From Benoit Cloitre, Dec 19 2002: (Start)
a(0) = 0, a(3n) = a(n), a(3n + 1) = a(n) + 1, a(3n + 2) = a(n) + 2.
a(n) = n - 2*Sum_{k>0} floor(n/3^k) = n - 2*A054861(n). (End)
a(n) = A062756(n) + 2*A081603(n). - Reinhard Zumkeller, Mar 23 2003
G.f.: (Sum_{k >= 0} (x^(3^k) + 2*x^(2*3^k))/(1 + x^(3^k) + x^(2*3^k)))/(1 - x). - Michael Somos, Mar 06 2004, corrected by Franklin T. Adams-Watters, Nov 03 2005
In general, the sum of digits of (n written in base b) has generating function (Sum_{k>=0} (Sum_{0 <= i < b} i*x^(i*b^k))/(Sum_{i=0..b-1} x^(i*b^k)))/(1-x). - Franklin T. Adams-Watters, Nov 03 2005
First differences of A094345. - Vladeta Jovovic, Nov 08 2005
a(A062318(n)) = n and a(m) < n for m < A062318(n). - Reinhard Zumkeller, Feb 26 2008
a(n) = A138530(n,3) for n > 2. - Reinhard Zumkeller, Mar 26 2008
a(n) <= 2*log_3(n+1). - Vladimir Shevelev, Jun 01 2011
a(n) = Sum_{k>=0} A030341(n, k). - Philippe Deléham, Oct 21 2011
G.f. satisfies G(x) = (x+2*x^2)/(1-x^3) + (1+x+x^2)*G(x^3), and has a natural boundary at |x|=1. - Robert Israel, Jul 02 2015
a(n) = A056239(A006047(n)). - Antti Karttunen, Jun 03 2017
a(n) = A000120(A289813(n)) + 2*A000120(A289814(n)). - Antti Karttunen, Jul 20 2017
a(0) = 0; a(n) = a(n - 3^floor(log_3(n))) + 1. - Ilya Gutkovskiy, Aug 23 2019
Sum_{n>=1} a(n)/(n*(n+1)) = 3*log(3)/2 (Shallit, 1984). - Amiram Eldar, Jun 03 2021

A134451 Ternary digital root of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 27 2007

Keywords

Comments

Continued fraction expansion of sqrt(3) - 1. - N. J. A. Sloane, Dec 17 2007. Cf. A040001, A048878/A002530.
Minimum number of terms required to express n as a sum of odd numbers.
Shadow transform of even numbers A005843. - Michel Marcus, Jun 06 2013
From Jianing Song, Nov 01 2022: (Start)
For n > 0, a(n) is the minimal gap of distinct numbers coprime to n. Proof: denote the minimal gap by b(n). For odd n we have A058026(n) > 0, hence b(n) = 1. For even n, since 1 and -1 are both coprime to n we have b(n) <= 2, and that b(n) >= 2 is obvious.
The maximal gap is given by A048669. (End)

Examples

			n=42: A007089(42) = '1120', A053735(42) = 1+1+2+0 = 4,
A007089(4)='11', A053735(4)=1+1=2: therefore a(42) = 2.
0.732050807568877293527446341... = 0 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + ...)))). - _Harry J. Smith_, May 31 2009
		

Crossrefs

Cf. A000010, A055034, A134452, A160390 (decimal expansion).
Apart from a(0) the same as A040001.
Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1).

Programs

Formula

a(n) = n if n <= 2, otherwise a(A053735(n)).
a(A005408(n)) = 1; a(A005843(n)) = 2 for n>0;
a(n) = 0 if n=0, otherwise A000034(n-1).
a(n) = ((n+1) mod 2) + 2*sign(n) - 1. - Wesley Ivan Hurt, Dec 06 2013
Multiplicative with a(2^e) = 2, a(p^e) = 1 for odd prime p. - Andrew Howroyd, Aug 06 2018
a(0) = A055034(1) / A000010(1), a(n) = A000010(n+1) / A055034(n+1), n>1. - Torlach Rush, Oct 29 2019
Dirichlet g.f.: zeta(s)*(1+1/2^s). - Amiram Eldar, Jan 01 2023

A230640 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 M(n).

Original entry on oeis.org

0, 4, 28, 248, 129140168, 68630377364912, 2088595827392656793085408064780643444068898148936888424953199350296
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Crossrefs

Cf. A230639.
Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)
Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

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)[2], n=1..7)];

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

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)

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)
Showing 1-10 of 11 results. Next