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

A059972 a(n) is the least positive integer k such that all digits of k are 0 or 1 in exactly n different bases B, where 2 <= B <= k; i.e., such that A068953(k)=n.

Original entry on oeis.org

2, 3, 4, 9, 30, 81, 4096, 531441, 16777216
Offset: 1

Views

Author

Naohiro Nomoto, Mar 28 2002

Keywords

Comments

Is every term except 30 a power of either 2 or 3?

Examples

			For n=4: 9 written in bases 2 through 9 is 1001, 100, 21, 14, 13, 12, 11, 10. In 4 bases, namely 2, 3, 8 and 9, all digits are 0 or 1.
		

Crossrefs

Cf. A068953.

Programs

  • Mathematica
    f[1]=0; f[k_] := Length[Select[Rest[Union[Divisors[k], Divisors[k-1]]], Max@@IntegerDigits[k, # ]==1&]]; a[n_] := For[k=1, True, k++, If[f[k]==n, Return[k]]]

Extensions

Edited by Dean Hickerson, Mar 31 2002

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)

A043000 Number of digits in all base-b representations of n, for 2 <= b <= n.

Original entry on oeis.org

2, 4, 7, 9, 11, 13, 16, 19, 21, 23, 25, 27, 29, 31, 35, 37, 39, 41, 43, 45, 47, 49, 51, 54, 56, 59, 61, 63, 65, 67, 70, 72, 74, 76, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126
Offset: 2

Views

Author

Keywords

Comments

From A.H.M. Smeets, Dec 14 2019: (Start)
a(n)-a(n-1) >= 2 due to the fact that n = 10_n, so there is an increment of at least 2. If n can be written as a perfect power m^s, an additional +1 comes to it for the representation of n in each base m.
For instance, for n = 729 we have 729 = 3^6 = 9^3 = 27^2, so there is an additional increment of 3. For n = 1296 we have 1296 = 6^4 = 36^2, so there is an additional increment of 2. For n = 4096 we have 4096 = 2^12 = 4^6 = 8^4 = 16^3= 64^2, so there is an additional increment of 5. (End)

Examples

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

Crossrefs

Programs

  • Magma
    [&+[Floor(Log(i,i*n)):k in [2..n]]:n in [1..70]]; // Marius A. Burtea, Nov 13 2019
    
  • Maple
    A043000 := proc(n) add( nops(convert(n,base,b)),b=2..n) ; end proc: # R. J. Mathar, Jun 04 2011
  • Mathematica
    Table[Total[IntegerLength[n,Range[2,n]]],{n,2,60}] (* Harvey P. Dale, Apr 23 2019 *)
  • PARI
    a(n)=sum(b=2,n,#digits(n,b)) \\ Jeppe Stig Nielsen, Dec 14 2019
    
  • PARI
    a(n)= n-1 +sum(b=2,n,logint(n,b)) \\ Jeppe Stig Nielsen, Dec 14 2019
    
  • PARI
    a(n) = {2*n-2+sum(i=2, logint(n, 2), sqrtnint(n, i)-1)} \\ David A. Corneth, Dec 31 2019
    
  • PARI
    first(n) = my(res = vector(n)); res[1] = 2; for(i = 2, n, inc = numdiv(gcd(factor(i+1)[,2]))+1; res[i] = res[i-1]+inc); res \\ David A. Corneth, Dec 31 2019
  • Python
    def count(n,b):
        c = 0
        while n > 0:
            n, c = n//b, c+1
        return c
    n = 0
    while n < 50:
        n = n+1
        a, b = 0, 1
        while b < n:
            b = b+1
            a = a + count(n,b)
        print(n,a) # A.H.M. Smeets, Dec 14 2019
    

Formula

a(n) = Sum_{i=2..n} floor(log_i(i*n)); a(n) ~ 2*n. - Vladimir Shevelev, Jun 03 2011 [corrected by Vaclav Kotesovec, Apr 05 2021]
a(n) = A070939(n) + A081604(n) + A110591(n) + ... + 1. - R. J. Mathar, Jun 04 2011
From Ridouane Oudra, Nov 13 2019: (Start)
a(n) = Sum_{i=1..n-1} floor(n^(1/i));
a(n) = n - 1 + Sum_{i=1..floor(log_2(n))} floor(n^(1/i) - 1);
a(n) = n - 1 + A255165(n). (End)
If n is in A001597 then a(A001597(m)) - a(A001597(m)-1) = 2 + A253642(m), otherwise a(n) - a(n-1) = 2. - A.H.M. Smeets, Dec 14 2019

A088323 Number of numbers b>1 such that n is a repunit in base b representation.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 06 2003

Keywords

Comments

is a(n) < 4 ?;
n>2: a(n) > 0 as n = (n-1)^1 + (n-1)^0.
a(A119598(n)) > 3; a(A053696(n)) > 2; a(A085104(n)) > 2. - Reinhard Zumkeller, Jan 22 2014

Examples

			a(31)=3: 31 = 2^4+2^3+2^2+2^1+2^0 = 5^2+5^1+5^0 = 30^1+30^0.
		

Crossrefs

Programs

  • Haskell
    a088323 n = sum $ map (f n) [2 .. n-1] where
       f x b = if x == 0 then 1 else if d /= 1 then 0 else f x' b
                                     where (x',d) = divMod x b
    -- Reinhard Zumkeller, Jan 22 2014

Extensions

Example corrected by Reinhard Zumkeller, Jan 22 2014

A341434 a(n) is the number of bases 1 < b < n in which n is divisible by its product of digits.

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 2, 3, 2, 2, 1, 5, 2, 3, 4, 6, 1, 5, 1, 5, 4, 4, 1, 9, 2, 2, 4, 5, 1, 7, 3, 9, 4, 2, 3, 12, 1, 2, 3, 10, 1, 7, 2, 7, 7, 2, 1, 15, 2, 5, 3, 6, 1, 10, 3, 10, 4, 3, 1, 14, 1, 2, 7, 14, 3, 8, 1, 6, 3, 6, 1, 20, 2, 3, 8, 7, 3, 7, 1, 16, 7, 2, 1, 14
Offset: 1

Views

Author

Amiram Eldar, Feb 11 2021

Keywords

Examples

			a(3) = 1 since 3 is divisible by its product of digits only in base 2: 3 = 11_2 and 1*1 | 3.
a(6) = 2 since 6 is divisible by its product of digits in 2 bases: in base 4, 6 = 12_4 and 1*2 | 6, and in base 5, 6 = 11_5 and 1*1 | 6.
		

Crossrefs

Programs

  • Mathematica
    q[n_, b_] := (p = Times @@ IntegerDigits[n, b]) > 0 && Divisible[n, p]; a[n_] := Count[Range[2, n], _?(q[n, #] &)]; Array[a, 100]
  • PARI
    a(n) = sum(b=2, n-1, my(x=vecprod(digits(n, b))); x && !(n%x)); \\ Michel Marcus, Feb 12 2021

Formula

a(n) > 0 for all numbers n > 2 since n in base b = n-1 is 11.
a(n) > 1 for all even numbers > 4 since n in base b = n-2 is 12. Similarly, a(n) > 1 for all composite numbers > 4 since if n = k*m, then n is divisible by its product of digits in bases n-m and n-k.
a(p) > 1 for primes p in A085104.
a(p) > 2 for primes p in A119598 (i.e., 31, 8191, ...).
a(n) >= A088323(n), with equality if n = 4 or if n is a prime.
Showing 1-5 of 5 results.