login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A330812 Least number >= n that is a Niven number in all bases 1 <= b <= n. 0
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
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.
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]
CROSSREFS
Sequence in context: A352749 A205404 A322372 * A368200 A316945 A307370
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Jan 01 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 12:33 EDT 2024. Contains 371969 sequences. (Running on oeis4.)