OFFSET
1,2
COMMENTS
A good "puzzle" sequence -- guess the rule given the first twenty or so terms.
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
Paul Dalenberg and Tom Edgar, Consecutive factorial base Niven numbers, Fibonacci Quart. (2018) Vol. 56, No. 2, 163-166.
EXAMPLE
Quaternary representation of 28 is 130, 1 + 3 + 0 = 4 divides 28.
MATHEMATICA
Select[Range[200], Divisible[#, Total[IntegerDigits[#, 4]]]&] (* Harvey P. Dale, Jun 09 2011 *)
PROG
(ARIBAS): maxarg := 190; for n := 1 to maxarg do if n mod sum(quaternarray(n)) = 0 then write(n, " "); end; end; function quaternarray(n: integer): array; var k: integer; stk: stack; begin while n > 0 do k := n mod 4; stack_push(stk, k); n := (n - k) div 4; end; return stack2array(stk); end; .
(PARI)
SumD(x)= { local(s); s=0; while (x>9, s+=x-10*(x\10); x\=10); return(s + x) }
baseE(x, b)= { local(d, e, f); e=0; f=1; while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); return(e) }
{ n=0; for (m=1, 10^9, if (m%(SumD(baseE(m, 4)))==0, write("b064438.txt", n++, " ", m); if (n==1000, break)) ) } \\ Harry J. Smith, Sep 14 2009
(PARI) isok(n) = !(n % sumdigits(n, 4)); \\ Michel Marcus, Jun 24 2018
(Python)
from sympy.ntheory.factor_ import digits
print([n for n in range(1, 201) if n%sum(digits(n, 4)[1:]) == 0]) # Indranil Ghosh, Apr 24 2017
CROSSREFS
KEYWORD
base,easy,nice,nonn
AUTHOR
Len Smiley, Oct 01 2001
EXTENSIONS
More terms from Matthew Conroy, Oct 02 2001
Offset changed from 0 to 1 by Harry J. Smith, Sep 14 2009
STATUS
approved