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.

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

This page as a plain text file.
%I A327737 #24 Sep 23 2019 21:11:52
%S A327737 1,4,7,11,14,17,20,24,28,31,34,37,40,43,46,51,54,57,60,63,66,69,72,75,
%T A327737 79,82,86,89,92,95,98,102,105,108,111,115,118,121,124,127,130,133,136,
%U A327737 139,142,145,148,151,155,158,161,164,167,170,173,176,179,182,185
%N A327737 a(n) is the sum of the lengths of the base-b expansions of n for all b with 1 <= b <= n.
%F A327737 a(n) = A043000(n) + n. - _A.H.M. Smeets_, Sep 23 2019
%e A327737 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.
%e A327737 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
%o A327737 (Go)
%o A327737 package main
%o A327737 import (
%o A327737     "fmt"
%o A327737     "strconv"
%o A327737 )
%o A327737 func main() {
%o A327737     // Due to limitations in strconv, this will only work for the first 36 terms
%o A327737     for i := 1; i <= 36; i++ {
%o A327737         count := i
%o A327737         for base := 2; base <= i; base++ {
%o A327737             count += len(strconv.FormatInt(int64(i), base))
%o A327737         }
%o A327737         fmt.Printf("%d, ", count)
%o A327737     }
%o A327737 }
%o A327737 (PARI) a(n) = my(i=n); for(b=2, n, i+=#digits(n, b)); i \\ _Felix Fröhlich_, Sep 23 2019
%o A327737 (Python)
%o A327737 def count(n,b):
%o A327737     c = 0
%o A327737     while n > 0:
%o A327737         n, c = n//b, c+1
%o A327737     return c
%o A327737 n = 0
%o A327737 while n < 60:
%o A327737     n = n+1
%o A327737     a, b = n, 1
%o A327737     while b < n:
%o A327737         b = b+1
%o A327737         a = a + count(n,b)
%o A327737     print(n,a) # _A.H.M. Smeets_, Sep 23 2019
%Y A327737 Cf. A043000.
%K A327737 nonn,base
%O A327737 1,2
%A A327737 _Steve Engledow_, Sep 23 2019
%E A327737 More terms from _Felix Fröhlich_, Sep 23 2019