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

A006064 Smallest junction number with n generators.

Original entry on oeis.org

0, 101, 10000000000001, 1000000000000000000000102
Offset: 1

Views

Author

Keywords

Comments

Strictly speaking, a junction number is a number n with more than one solution to x+digitsum(x) = n. However, it seems best to start this sequence with n=0, for which there is just one solution, x=0. - N. J. A. Sloane, Oct 31 2013.
a(3) = 10^13 + 1 was found by Narasinga Rao, who reports that Kaprekar verified that it is the smallest term. No details of Kaprekar's proof were given.
a(4) = 10^24 + 102 was conjectured by Narasinga Rao.
a(5) = 10^1111111111124 + 102. - Conjectured by Narasinga Rao, confirmed by Max Alekseyev and N. J. A. Sloane.
a(6) = 10^2222222222224 + 10000000000002. - Max Alekseyev
a(7) = 10^( (10^24 + 10^13 + 115) / 9 ) + 10^13 + 2. - Max Alekseyev
a(8) = 10^( (2*10^24 + 214)/9 ) + 10^24 + 103. - Max Alekseyev

Examples

			a(2) = 101 since 101 is the smallest number with two generators: 101 = A062028(91) = A062028(100).
a(4) = 10^24 + 102 = 1000000000000000000000102 has exactly four inverses w.r.t. A062028, namely 999999999999999999999893, 999999999999999999999902, 1000000000000000000000091 and 1000000000000000000000100.
		

References

  • M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 116.
  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately printed, 311 Devlali Camp, Devlali, India, 1963.
  • Narasinga Rao, A. On a technique for obtaining numbers with a multiplicity of generators. Math. Student 34 1966 79--84 (1967). MR0229573 (37 #5147)
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A003052, A230093, A230100, A230303, A230857 (highest power of 10).
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.

Formula

a(n) = the smallest m such that there are exactly n solutions to A062028(x)=m.

Extensions

Edited, a(5)-a(6) added by Max Alekseyev, Jun 01 2011
a(1) added, a(5) corrected, a(7)-a(8) added by Max Alekseyev, Oct 26 2013

A230638 Smallest number m such that u + (sum of base-4 digits of u) = m has exactly n solutions.

Original entry on oeis.org

0, 17, 16385, 16777234
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Comments

Indices of records in A230632: a(n) is the index of the first n in A230632.
The terms are a(1)=0, a(2)=4^2+1, a(3)=4^7+1, a(4)=4^12+17+1, a(5)=4^5368+17+1, a(6)=4^10924+16385+1, a(7)=4^5597880+16385+20. Note that a(7) breaks the pattern of the first six terms.
a(8) = 4^16777229 + 4^12 + 19.
For the leading power of 4 see A230637.

Examples

			n=2: the two solutions to u+(base-4 digit-sum of u) = 17 are 13 and 16.
n=3: the three solutions to u+(base-4 digit-sum of u) = 4^7+1 are 4^7, 4^7-15, 4^7-18.
n=4: the four solutions to u+(base-4 digit-sum of u) = 4^12+17+1 are 4^12+{16, 13, -14, -17}.
		

Crossrefs

Cf. A230637.
Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (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.

Extensions

a(8) from Max Alekseyev, Oct 31 2013

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

A230303 Let M(1)=0 and for n >= 2, let B(n)=M(ceiling(n/2))+M(floor(n/2))+2, M(n)=2^B(n)+M(floor(n/2))+1; sequence gives M(n).

Original entry on oeis.org

0, 5, 129, 4102, 87112285931760246646623899502532662132742, 1852673427797059126777135760139006525652319754650249024631321344126610074239106
Offset: 1

Views

Author

N. J. A. Sloane, Oct 24 2013; Mar 26 2014

Keywords

Comments

M(n) is the smallest value of k such that A228085(k) = n. For example, 129 is the first time a 3 appears in A228085 (and is therefore the first term in A230092). M(4) = 4102 is the first time a 4 appears in A228085 (and is therefore the first term in A227915).

Examples

			The terms are a(1) = 0, a(2) = 2^2+0+1, a(3) = 2^7+0+1, a(4) = 2^12+5+1, a(5) = 2^136+5+1, a(6) = 2^160+129+1, a(7) = 2^4233+129+1, a(8) = 2^8206+4102+1, a(9) = 2^k+4102+1 with k=2^136+4110, ... .
The length (in bits) of the n-th term is A230302(n)+1.
		

Crossrefs

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
    if (n mod 2) = 0 then B:=2*f(n/2)[2]+2;
    else B:=f((n+1)/2)[2]+f((n-1)/2)[2]+2; fi;
    M:=2^B+f(floor(n/2))[2]+1; RETURN([B,M]); fi;
    end proc;
    [seq(f(n)[2],n=1..6)];

Formula

Define i by 2^(i-1) < n <= 2^i. Then it appears that
a(n) = 2^2^2^...^2^x
a tower of height i+3, containing i+2 2's, where x is in the range 0 < x <= 1.
For example, if n=7, i=3, and
a(7) = 2^4233+130 = 2^2^2^2^2^.88303276...
Note also that i+2 = A230864(a(n)).

Extensions

a(1)-a(8) were found by Donovan Johnson, Oct 22 2013.

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