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-6 of 6 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

A239691 Base 5 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 1, 3, 3, 5, 5, 7, 7, 5, 3, 5, 5, 7, 7, 5, 7, 5, 7, 7, 9, 7, 7, 9, 9, 5, 7, 7, 9, 9, 3, 3, 5, 7, 9, 3, 5, 7, 7, 9, 7, 5, 7, 9, 9, 11, 7, 11, 7, 9, 9, 11, 9, 3, 5, 7, 9, 7, 5, 5, 7, 9, 7, 7, 9, 9, 7, 9, 11, 13, 9, 11, 11, 13, 7, 7, 9, 9, 5, 9, 11, 9, 7, 9
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-5 dominance order on the natural numbers.

Examples

			The fifth prime is 11, 11 in base 5 is (2,1) so a(5)=2+1=3.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),5): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 5], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 5); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=5)) for i in primes_first_n(200)]
    

Formula

a(n) = A053824(A000040(n)).

A239692 Base 6 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 5, 2, 6, 3, 7, 4, 8, 9, 6, 2, 6, 3, 7, 8, 9, 6, 7, 11, 3, 4, 8, 9, 7, 11, 8, 12, 4, 8, 7, 11, 12, 9, 9, 6, 7, 8, 12, 13, 14, 6, 11, 8, 12, 9, 11, 3, 7, 4, 8, 9, 6, 11, 7, 8, 9, 6, 7, 11, 8, 8, 7, 11, 8, 12, 6, 7, 12, 9, 13, 14, 7, 8, 9, 13, 14, 7, 11, 9
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-6 dominance order on the natural numbers.

Examples

			The sixth prime is 13, 13 in base 6 is (2,1) so a(6)=2+1=3.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),6): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 6], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 6); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=6)) for i in primes_first_n(200)]
    

Formula

a(n) = A053827(A000040(n)).

A239693 Base 7 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 5, 1, 5, 7, 5, 7, 5, 5, 7, 7, 11, 7, 11, 5, 5, 7, 7, 5, 7, 7, 11, 11, 13, 5, 7, 5, 7, 5, 7, 11, 11, 13, 5, 7, 7, 7, 11, 11, 11, 13, 11, 13, 5, 7, 7, 13, 11, 13, 11, 11, 13, 11, 11, 11, 11, 13, 13, 11, 13, 17, 13, 11, 13, 11, 13, 13, 5, 7, 5, 5, 7, 7
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-7 dominance order on the natural numbers.

Examples

			The fifth prime is 11, 11 in base 7 is (1,4) so a(5)=1+4=5.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),7): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 7], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 7); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=7)) for i in primes_first_n(200)]
    

Formula

a(n) = A053828(A000040(n)).

A239694 Base 8 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 5, 7, 4, 6, 3, 5, 9, 8, 10, 9, 6, 8, 12, 11, 10, 12, 4, 8, 3, 9, 6, 5, 6, 10, 12, 9, 11, 8, 15, 5, 4, 6, 9, 11, 10, 9, 13, 12, 11, 13, 16, 4, 8, 10, 8, 13, 10, 12, 9, 15, 10, 13, 5, 11, 10, 12, 11, 8, 10, 13, 13, 17, 12, 16, 9, 8, 11, 13, 10, 16, 17, 16
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-8 dominance order on the natural numbers.

Examples

			The sixth prime is 13, 13 in base 8 is (1,5) so a(6)=1+5=6.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),8): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 8], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 8); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=8)) for i in primes_first_n(200)]
    

Formula

a(n) = A053829(A000040(n)).

A239695 Base 9 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 5, 7, 3, 5, 9, 3, 7, 5, 7, 5, 9, 11, 7, 13, 11, 13, 11, 15, 9, 15, 3, 9, 9, 5, 7, 11, 5, 9, 7, 11, 9, 11, 13, 15, 13, 3, 7, 5, 11, 5, 7, 9, 13, 7, 11, 15, 11, 13, 17, 15, 17, 11, 9, 7, 13, 7, 13, 9, 11, 13, 11, 15, 17, 13, 11, 9, 11, 13, 9, 15, 15, 13, 11
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-9 dominance order on the natural numbers.

Examples

			The fifth prime is 11, 11 in base 9 is (1,2) so a(5)=1+2=3.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),9): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 9], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 9); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=9)) for i in primes_first_n(200)]
    

Formula

a(n) = A053830(A000040(n)).
Showing 1-6 of 6 results.