A356349 Primitive Niven numbers: terms of A005349 that are not ten times another term of A005349.
1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 18, 21, 24, 27, 36, 42, 45, 48, 54, 63, 72, 81, 84, 102, 108, 110, 111, 112, 114, 117, 126, 132, 133, 135, 140, 144, 150, 152, 153, 156, 162, 171, 190, 192, 195, 198, 201, 204, 207, 209, 216, 220, 222, 224, 225, 228, 230, 234
Offset: 1
Examples
190 is a term as 190 is a Niven number and 19 is not a Niven number. 192 is a term as 192 is a Niven number and 192 is not divisible by 10.
Programs
-
PARI
is(n, base=10) = my (s=sumdigits(n, base)); n%s==0 && (n%base || (n/base)%s)
-
Python
def ok(n): sd = sum(map(int, str(n))) return sd and not n%sd and (n%10 or (n//10)%sd) print([k for k in range(235) if ok(k)]) # Michael S. Branicky, Oct 16 2022
Comments