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.

A226320 a(n) is the smallest k > 6 such that k is a Niven number at least in all the bases from 1 to n.

Original entry on oeis.org

7, 8, 8, 8, 8, 12, 12, 24, 24, 24, 24, 24, 24, 432, 720, 720, 720, 720, 720, 840, 840, 840, 3360, 13860, 13860, 13860, 13860, 13860, 40320, 100800, 100800, 2106720, 7698600, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800
Offset: 1

Views

Author

Giovanni Resta, Jun 03 2013

Keywords

Comments

The bound a(i) > 6 is motivated by the fact that 1, 2, 4 and 6 are Niven numbers in every base.

Examples

			a(8) = 24 because 24 is the smallest k > 6 which is Niven in bases 1 (trivial), 2,..., 8. For example, 24 = (33)_7 = (44)_5 = (220)_3.
		

Crossrefs

Cf. A005349, A226169, A226319, A225427 (Niven in bases 1,...,n but not in base n+1).

Programs

  • Mathematica
    a[n_] := Block[{k=7}, n > 1 && While[ Max@ Mod[k, Total /@ IntegerDigits[k, Range[2, n]]] > 0, k++]; k]; Array[a, 20]

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

A226319 a(n) is the smallest odd k > 1 such that k is a Niven number at least in all the bases from 1 to n.

Original entry on oeis.org

3, 21, 21, 21, 675, 4725, 4725, 98175, 140175, 543375, 543375, 23186625, 35026425, 139264125, 139264125, 608679225, 11553990525, 87662479905, 87662479905, 343947649815, 2383529269275, 4005262262925, 4005262262925
Offset: 1

Views

Author

Giovanni Resta, Jun 03 2013

Keywords

Examples

			a(4) = 21 because 21 is the smallest odd k > 1 which is Niven in bases 1 (trivial), 2, 3, and 4, being equal to (10101)_2, (210)_3 and (111)_4.
		

Crossrefs

Cf. A005349, A226169, A226320, A225427 (Niven in bases 1,...,n but not in base n+1).

Programs

  • Mathematica
    a[n_] := Block[{k=3}, n > 1 &&  While[Max@ Mod[k, Total /@ IntegerDigits[k, Range[2, n]]] > 0, k += 2]; k]; Array[a,9]

A330812 Least number >= n that is a Niven number in all bases 1 <= b <= n.

Original entry on oeis.org

1, 2, 4, 4, 6, 6, 12, 24, 24, 24, 24, 24, 24, 432, 720, 720, 720, 720, 720, 840, 840, 840, 3360, 13860, 13860, 13860, 13860, 13860, 40320, 100800, 100800, 2106720, 7698600, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800, 9028800
Offset: 1

Views

Author

Amiram Eldar, Jan 01 2020

Keywords

Examples

			a(4) = 4 since the representations of 4 in bases 1 to 4 are 1111, 100, 11, 10, the corresponding sums of digits are 4, 1, 2, and 1, and all are divisors of 4. Thus 4 is a Niven number in bases 1, 2, 3, and 4, and it is the least number with this property.
		

Crossrefs

Programs

  • Maple
    A[1]:= 1: m:= 1:
    for n from 2 while m < 30 do
       kk:= n;
       for k from 2 to n-1 do
         if n mod convert(convert(n,base,k),`+`) <> 0 then kk:= k-1; break fi;
         od;
       if kk > m then
         for k from m+1 to kk do A[k]:= n od;
         m:= kk;
       fi
    od:
    seq(A[k],k=1..m); # Robert Israel, Jan 01 2020
  • Mathematica
    nivenQ[n_, b_] := Divisible[n, Total @ IntegerDigits[n,b]]; a[n_] := Module[{k = n}, While[!AllTrue[Range[2, n], nivenQ[k, #] &], k++]; k]; Array[a,30]
Showing 1-4 of 4 results.