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

A053737 Sum of digits of (n written in base 4).

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

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

Examples

			a(20) = 1+1+0 = 2 because 20 is written as 110 base 4.
From _Omar E. Pol_, Feb 21 2010: (Start)
This can be written as a triangle (cf. A000120):
  0,
  1,2,3,
  1,2,3,4,2,3,4,5,3,4,5,6,
  1,2,3,4,2,3,4,5,3,4,5,6,4,5,6,7,2,3,4,5,3,4,5,6,4,5,6,7,5,6,7,8,3,4,5,6,4,5,6,7,5,6,7,8,6,7,8,9,
  1,2,3,4,2,3,4,5,3,4,5,6,4,5,6,7,2,3,4,5,3,4,5,6,4,5,6,7,5,6,7,8,3,4,5,6,4,...
where the rows converge to A173524.
(End)
		

Crossrefs

Cf. A173524. - Omar E. Pol, Feb 21 2010
Sum of digits of n written in bases 2-16: A000120, A053735, this sequence, A053824, A053827, A053828, A053829, A053830, A007953, A053831, A053832, A053833, A053834, A053835, A053836.
Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1).

Programs

  • Haskell
    a053737 n = if n == 0 then 0 else a053737 m + r where (m, r) = divMod n 4
    -- Reinhard Zumkeller, Mar 19 2015
    
  • MATLAB
    for u=0:104; sol(u+1)=sum(dec2base(u,4)-'0');end
    sol % Marius A. Burtea, Jan 17 2019
  • Magma
    [&+Intseq(n,4):n in [0..104]]; // Marius A. Burtea, Jan 17 2019
    
  • Maple
    A053737 := proc(n)
        add(d,d=convert(n,base,4)) ;
    end proc: # R. J. Mathar, Oct 31 2012
  • Mathematica
    Table[Plus @@ IntegerDigits[n, 4], {n, 0, 100}] (* or *)
    Nest[ Flatten[ #1 /. a_Integer -> {a, a+1, a+2, a+3}] &, {0}, 4] (* Robert G. Wilson v, Jul 27 2006 *)
    DigitSum[Range[0, 100], 4] (* Paolo Xausa, Aug 01 2024 *)
  • PARI
    a(n)=if(n<1,0,if(n%4,a(n-1)+1,a(n/4)))
    
  • PARI
    a(n) = sumdigits(n, 4); \\ Michel Marcus, Aug 24 2019
    

Formula

From Benoit Cloitre, Dec 19 2002: (Start)
a(0) = 0, a(4n+i) = a(n)+i for 0 <= i <= 3.
a(n) = n - 3*Sum_{k>0} floor(n/4^k) = n - 3*A054893(n). (End)
G.f.: (Sum_{k>=0} (x^(4^k) + 2*x^(2*4^k) + 3*x^(3*4^k))/(1 + x^(4^k) + x^(2*4^k) + x^(3*4^k)))/(1-x). - Franklin T. Adams-Watters, Nov 03 2005
a(n) = A138530(n,4) for n > 3. - Reinhard Zumkeller, Mar 26 2008
a(n) = Sum_{k>=0} A030386(n,k). - Philippe Deléham, Oct 21 2011
a(n) = A007953(A007090(n)). - Reinhard Zumkeller, Mar 19 2015
a(0) = 0; a(n) = a(n - 4^floor(log_4(n))) + 1. - Ilya Gutkovskiy, Aug 23 2019
Sum_{n>=1} a(n)/(n*(n+1)) = 4*log(4)/3 (Shallit, 1984). - Amiram Eldar, Jun 03 2021

A010064 Base 4 self or Colombian numbers (not of form k + sum of base 4 digits of k).

Original entry on oeis.org

1, 3, 8, 13, 18, 20, 25, 30, 35, 37, 42, 47, 52, 54, 59, 64, 73, 78, 83, 85, 90, 95, 100, 102, 107, 112, 117, 119, 124, 129, 138, 143, 148, 150, 155, 160, 165, 167, 172, 177, 182, 184, 189, 194, 203, 208, 213, 215, 220, 225, 230, 232, 237, 242, 247, 249, 254
Offset: 1

Views

Author

Keywords

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, Section 2.24, pp. 179-180.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, pp. 384-386.

Crossrefs

Programs

  • Mathematica
    s[n_] := n + Plus @@ IntegerDigits[n, 4]; m = 250; Complement[Range[m], Array[s, m]] (* Amiram Eldar, Nov 28 2020 *)

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

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

Original entry on oeis.org

1, 2, 4, 5, 7, 11, 16, 17, 19, 23, 28, 32, 34, 38, 43, 50, 55, 62, 70, 74, 79, 86, 91, 98, 103, 110, 118, 125, 133, 137, 142, 149, 154, 161, 166, 173, 181, 188, 196, 200, 205, 212, 217, 224, 229, 236, 244, 251, 262, 266, 271, 278, 283, 290, 295
Offset: 0

Views

Author

Keywords

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 2.24.

Crossrefs

Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1)

Programs

  • Haskell
    a010065 n = a010065_list !! n
    a010065_list = iterate a230631 1  -- Reinhard Zumkeller, Mar 20 2015

Formula

a(n+1) = A230631(a(n)). - Reinhard Zumkeller, Mar 20 2015

Extensions

More terms from Neven Juric, Apr 11 2008

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 30 2013

Keywords

Comments

Number of occurrences of n in A230631.

Crossrefs

Cf. A230631, A010064 (positions of 0's), A230633-A230635.
Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634,A230635, A230636, A230637, A230638, A010065 (trajectory of 1)

A230631 a(n) = n + (sum of digits in base-4 representation of n).

Original entry on oeis.org

0, 2, 4, 6, 5, 7, 9, 11, 10, 12, 14, 16, 15, 17, 19, 21, 17, 19, 21, 23, 22, 24, 26, 28, 27, 29, 31, 33, 32, 34, 36, 38, 34, 36, 38, 40, 39, 41, 43, 45, 44, 46, 48, 50, 49, 51, 53, 55, 51, 53, 55, 57, 56, 58, 60, 62, 61, 63, 65, 67, 66, 68, 70, 72, 65, 67, 69, 71, 70, 72, 74, 76, 75, 77, 79, 81, 80, 82, 84, 86, 82
Offset: 0

Views

Author

N. J. A. Sloane, Oct 30 2013

Keywords

Crossrefs

Cf. A010064 (missing numbers), A230632 (number of inverses), A230633-A230635.
Related base-4 sequences: A053737, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1)

Programs

Formula

a(n) = A053737(n) + n. - Reinhard Zumkeller, Mar 20 2015

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

Original entry on oeis.org

17, 19, 21, 34, 36, 38, 51, 53, 55, 65, 67, 70, 72, 82, 84, 86, 99, 101, 103, 116, 118, 120, 130, 132, 135, 137, 147, 149, 151, 164, 166, 168, 181, 183, 185, 195, 197, 200, 202, 212, 214, 216, 229, 231, 233, 246, 248, 250, 257, 261, 262, 263, 267, 274, 276, 278, 291, 293, 295, 308, 310, 312, 322, 324, 327, 329, 339
Offset: 1

Views

Author

N. J. A. Sloane, Oct 30 2013

Keywords

Crossrefs

Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1)

Programs

  • Mathematica
    etsQ[n_]:=Count[#+Total[IntegerDigits[#,4]]&/@Range[n-1],n]==2; Select[ Range[ 350],etsQ] (* Harvey P. Dale, May 25 2016 *)

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

Original entry on oeis.org

16385, 16387, 16402, 16404, 32770, 32772, 32787, 32789, 49155, 49157, 49172, 49174, 65542, 65554, 81922, 81924, 81939, 81941, 98307, 98309, 98324, 98326, 114692, 114694, 114709, 114711, 131079, 131091, 147459, 147461, 147476, 147478, 163844, 163846, 163861
Offset: 1

Views

Author

N. J. A. Sloane, Oct 30 2013

Keywords

Crossrefs

Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1)

A230636 Numbers n such that m + (sum of digits in base-4 representation of m) = n has exactly four solutions.

Original entry on oeis.org

16777234, 33554451, 50331668, 83886099, 100663316, 117440533, 150994964, 167772181, 184549398, 218103829, 234881046, 251658263, 268435476, 268435478, 285212691, 301989908, 318767125, 352321556, 369098773, 385875990, 419430421, 436207638, 452984855, 486539286
Offset: 1

Views

Author

Donovan Johnson and N. J. A. Sloane, Oct 31 2013

Keywords

Crossrefs

Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1)

A230637 Leading power of 4 in A230638.

Original entry on oeis.org

2, 7, 12, 5468, 10924, 5597880, 16777229
Offset: 2

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Comments

a(9) = ( 4^5468 + 2*4^12 + 39 ) / 3.
a(10) = 4^5468 + 13.
a(11) = ( 4^10924 + 2*4^5468 + 16407 ) / 3.
a(12) = 4^10924 + 10925
a(13) = ( 4^5597880 + 3*4^10924 + 32793 ) / 3.
a(14) = ( 2*4^5597880 + 32812 ) / 3.
a(15) = ( 4^16777229 + 4^5597880 + 2*4^12 + 16427 ) / 3.
a(16) = ( 2*4^16777229 + 4^13 + 42 ) / 3.

Crossrefs

Cf. A230638.
Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1)

Extensions

Terms a(8) onward from Max Alekseyev, Oct 31 2013
Showing 1-10 of 10 results.