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.

A226171 Smallest base in which n is not Niven (or zero if n is Niven in every base).

Original entry on oeis.org

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

Views

Author

Sergio Pimentel, May 29 2013

Keywords

Comments

Niven numbers (in base b) are divisible by the sum of their digits (in base b).
Questions: are 1, 2, 4 and 6 the only zeros in this sequence? Where are the records or high water marks?
From Bert Dobbelaere, Oct 08 2018: (Start)
1,2,4,6 are the only numbers that are Niven in every base.
Proof: Suppose n is Niven in every base, then consider the base-b representations of n for (n/2) < b <= n. These are all 2-digit numbers with 1 as 1st digit and (n-b) as last digit. Then 1+n-b is a divisor of n for all b, meaning that all numbers between 1 up to n/2 are divisors of n. Clearly there are no such numbers larger than 6.
a(n) < 60 for n < 10^13.
(End)

Examples

			The sum of digits of 24 in bases 1 through 14 are:  24, 2, 4, 3, 8, 4, 6, 3, 8, 6, 4, 2, 12, 11.  24 is divisible by all these numbers except the last one; therefore a(24) = 14.
		

Crossrefs

Cf. A225427 (least Niven number for all bases from 1 to n).

Programs

  • Mathematica
    Table[b = 2; While[s = Total[IntegerDigits[n, b]]; s < n && Mod[n, s] == 0, b++]; If[s == n, b = 0]; b, {n, 100}] (* T. D. Noe, May 30 2013 *)
  • PARI
    a(n) = {for (b=2, n-1, if (frac(n/sumdigits(n,b)), return(b));); 0;} \\ Michel Marcus, Oct 23 2018