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-4 of 4 results.

A043306 Sum of all digits in all base-b representations for n, for 2 <= b <= n.

Original entry on oeis.org

1, 3, 4, 8, 10, 16, 17, 21, 25, 35, 34, 46, 52, 60, 58, 74, 73, 91, 92, 104, 114, 136, 128, 144, 156, 168, 171, 199, 193, 223, 221, 241, 257, 281, 261, 297, 315, 339, 333, 373, 367, 409, 416, 430, 452, 498, 472, 508, 515, 547, 556, 608, 598, 638, 634, 670, 698, 756, 717, 777
Offset: 2

Views

Author

Keywords

Examples

			5 = 101_2 = 12_3 = 11_4 = 10_5. Thus a(5) = 2 + 3 + 2 + 1 = 8.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Total[First[RealDigits[n, i]]], {i, 2, n}], {n, 2, 80}] (* Carl Najafi, Aug 16 2011 *)
  • PARI
    a(n) = sum(i=2, n, vecsum(digits(n, i))); \\ Michel Marcus, Jan 03 2017
    
  • PARI
    a(n) = sum(b=2, n, sumdigits(n, b)); \\ Michel Marcus, Aug 18 2017
    
  • Python
    from sympy.ntheory.digits import digits
    def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n+1))
    print([a(n) for n in range(2, 62)]) # Michael S. Branicky, Apr 04 2022

Formula

From Vladimir Shevelev, Jun 03 2011: (Start)
a(n) = (n-1)*n - Sum_{i=2..n} (i-1)*Sum_{r>=1} floor(n/i^r).
a(n) <= (n-1)^2*log(n+1)/log(n).
Problem: find a better upper estimate. (End)
From Amiram Eldar, Apr 16 2021: (Start)
a(n) = A014837(n) + 1.
a(n) ~ (1-Pi^2/12)*n^2 + O(n^(3/2)) (Fissum, 2020). (End)

A255165 a(n) = Sum_{k=2..n} floor(log(n)/log(k)), n >= 1.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 7, 9, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72
Offset: 1

Views

Author

Richard R. Forberg, Feb 15 2015

Keywords

Comments

The sum jumps up by 2 or more where n is a power of one or more k < n, otherwise it gains 1 with each increase in n.
First differences = A089723.
This calculation is analogous to that used for the sum of the number of divisors for all integers <= n in A006218.
a(n)+n gives the number of digits in the representations of n from base 2 to base n+1. - Christina Steffan, Dec 06 2015
Without floor, Sum_{k=2..n} log(n)/log(k) ~ n * (1 + 1/log(n) + 2/log(n)^2 + 6/log(n)^3 + 24/log(n)^4 + 120/log(n)^5 + ...). - Vaclav Kotesovec, Apr 06 2021

Examples

			The first jump is at n = 4 where, in the summation, log(4)/log(2), as it reaches a new floor.
Note: Possible complications exist calculating the floor function on ratios of logs that produce exact integers (e.g., in Mathematica). Adding an infinitesimal amount to n solves it.
		

Crossrefs

Programs

  • Magma
    [0] cat [&+[Floor(Log(n)/Log(k)):k in [2..n]]:n in [2..70]]; // Marius A. Burtea, Nov 13 2019
  • Mathematica
    Table[Sum[Floor[Log[n]/Log[k]], {k, 2, n}], {n, 1, 100}]
  • PARI
    a(n)=sum(k=2,n,log(n)\log(k)) \\ Anders Hellström, Dec 06 2015
    

Formula

a(n) = Sum_{k=2..n} floor(log(n)/log(k)), n >= 1.
It appears that a(n) = A089361(n) + n - 1. - Michel Marcus, Feb 17 2015
From Ridouane Oudra, Nov 13 2019: (Start)
a(n) = Sum_{i=2..n} floor(n^(1/i)).
a(n) = Sum_{i=1..floor(log_2(n))} floor(n^(1/i) - 1).
a(n) = A043000(n) - n + 1. (End)
a(n) ~ n. - Vaclav Kotesovec, Apr 06 2021

A342871 a(n) = Sum_{k=1..n} floor(n^(1/k)), n >= 1.

Original entry on oeis.org

1, 3, 5, 8, 10, 12, 14, 17, 20, 22, 24, 26, 28, 30, 32, 36, 38, 40, 42, 44, 46, 48, 50, 52, 55, 57, 60, 62, 64, 66, 68, 71, 73, 75, 77, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133
Offset: 1

Views

Author

Avid Rajai, Mar 28 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Floor[n^(1/k)],{k,n}],{n,100}] (* Giorgos Kalogeropoulos, Mar 31 2021 *)
  • PARI
    a(n)=sum(k=1, n, sqrtnint(n,k)) \\ Andrew Howroyd, Mar 28 2021
    
  • PARI
    a(n) = if(n < 2, return(n)); my(c = logint(n, 2)); 2*n + sum(i = 2, c, sqrtnint(n, i)) - c \\ David A. Corneth, Mar 28 2021
    
  • Python
    from sympy import integer_nthroot
    def A342871(n):
        c = 0
        for k in range(1,n+1):
            m = integer_nthroot(n,k)[0]
            if m == 1:
                return c+n-k+1
            else:
                c += m
        return c # Chai Wah Wu, Apr 06 2021

Formula

Lim_{n->infinity} a(n)/n = 2.
a(n) = 2*n + sqrt(n) + O(n^(1/3)).
Lim_{n->infinity} (a(n)/n - 2)*sqrt(n) = 1.
a(n) = A043000(n) + 1 for n >= 2.
a(n) = A255165(n) + n for n >= 2.
a(n) = A089361(n) + 2*n - 1 for n >= 2.
a(n) = n + Sum_{i=1..floor(log_2(n))} floor(n^(1/i) - 1).
If n is in A001597 then a(A001597(m)) - a(A001597(m)-1) = 2 + A253642(m), otherwise a(n) - a(n-1) = 2.
2 <= a(n)/n <= 9/4 iff n >= 4.
1 <= (a(n)/n - 2)*sqrt(n) <= 27/16 iff n >= 27.
2*n + sqrt(n) < a(n) <= 2*n + (27/16)*sqrt(n) iff n >= 27.

A327737 a(n) is the sum of the lengths of the base-b expansions of n for all b with 1 <= b <= n.

Original entry on oeis.org

1, 4, 7, 11, 14, 17, 20, 24, 28, 31, 34, 37, 40, 43, 46, 51, 54, 57, 60, 63, 66, 69, 72, 75, 79, 82, 86, 89, 92, 95, 98, 102, 105, 108, 111, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 155, 158, 161, 164, 167, 170, 173, 176, 179, 182, 185
Offset: 1

Views

Author

Steve Engledow, Sep 23 2019

Keywords

Examples

			a(5) = 14 because 5 has the following representations in bases 1 to 5: 11111, 101, 12, 11, 10 giving a total length of 5+3+2+2+2 = 14.
a(12) = 37 because 12 in bases 1 through 12 is 1...1 (12 1's), 1100, 110, and for bases 4 through 12 we get a 2-digit number, for a total length of 12+4+3+9*2 = 37. - _N. J. A. Sloane_, Sep 23 2019
		

Crossrefs

Cf. A043000.

Programs

  • Go
    package main
    import (
        "fmt"
        "strconv"
    )
    func main() {
        // Due to limitations in strconv, this will only work for the first 36 terms
        for i := 1; i <= 36; i++ {
            count := i
            for base := 2; base <= i; base++ {
                count += len(strconv.FormatInt(int64(i), base))
            }
            fmt.Printf("%d, ", count)
        }
    }
    
  • PARI
    a(n) = my(i=n); for(b=2, n, i+=#digits(n, b)); i \\ Felix Fröhlich, Sep 23 2019
    
  • Python
    def count(n,b):
        c = 0
        while n > 0:
            n, c = n//b, c+1
        return c
    n = 0
    while n < 60:
        n = n+1
        a, b = n, 1
        while b < n:
            b = b+1
            a = a + count(n,b)
        print(n,a) # A.H.M. Smeets, Sep 23 2019

Formula

a(n) = A043000(n) + n. - A.H.M. Smeets, Sep 23 2019

Extensions

More terms from Felix Fröhlich, Sep 23 2019
Showing 1-4 of 4 results.