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!)
A337819 a(n) is the smallest number k for which k*d is a Niven number, for any divisor d of n, n >= 1. 0

%I #18 Sep 08 2022 08:46:25

%S 1,1,1,1,1,1,1,1,1,1,10,1,9,3,2,3,6,1,6,1,1,10,9,1,2,9,1,3,9,2,12,9,

%T 10,6,6,1,3,6,9,1,10,3,12,10,2,9,9,3,9,2,6,9,18,1,10,9,6,9,9,2,12,18,

%U 1,9,12,10,3,6,9,6,18,1,7,3,2,9,10,9,9,9,1,10

%N a(n) is the smallest number k for which k*d is a Niven number, for any divisor d of n, n >= 1.

%C a(n) = 1 if and only if n is in A337741.

%e The numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 are in A337741, so a(1) = a(2) = ... = a(9) = a(10) = 1.

%e For n = 11 the divisors are 1, 11 and 10 * 1 = 10 = A005349(10) and 10 * 11 = 110 = A005349(36), so a(11) = 10.

%e For n = 14 the divisors are 1, 2, 7, 14 and 3 * 1 = 3 = A005349(3), 3 * 2 = 6 = A005349(6), 3 * 7 = 21 = A005349(14), 3 * 14 = 42 = A005349(20), so a(14) = 3.

%e For n = 40 , A337741(18) = 40, so a(40) = 1.

%t nivenQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; a[n_] := Module[{k = 1}, While[!AllTrue[k * Divisors[n], nivenQ], k++]; k]; Array[a, 100] (* _Amiram Eldar_, Sep 23 2020 *)

%o (Magma) niven:=func<n| n mod &+Intseq(n) eq 0>; a:=[]; for n in [1..90] do k:=1; while not forall{d: d in Divisors(n)| niven(k*d)} do k:=k+1; end while; Append(~a,k); end for; a;

%o (PARI) is(n) = n%sumdigits(n)==0; \\ A005349

%o isok(n, k) = fordiv(n, d, if (!is(k*d), return(0))); return(1);

%o a(n) = {my(k=1); while (! isok(n,k), k++); k;} \\ _Michel Marcus_, Sep 24 2020

%Y Cf. A005349, A144261, A337741.

%K nonn,base

%O 1,11

%A _Marius A. Burtea_, Sep 23 2020

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 May 5 15:44 EDT 2024. Contains 372275 sequences. (Running on oeis4.)