OFFSET
1,2
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
EXAMPLE
Base-5 representation of 28 is 103; 1 + 0 + 3 = 4 divides 28.
PROG
(ARIBAS): maxarg := 160; for n := 1 to maxarg do if n mod sum(basearray(n, 5)) = 0 then write(n, " "); end; end; function basearray(n, b: integer): array; var k: integer; stk: stack; begin while n > 0 do k := n mod b; stack_push(stk, k); n := (n - k) div b; end; return stack2array(stk); end; .
(PARI) SumD(x)= { my(s); s=0; while (x>9, s+=x-10*(x\10); x\=10); return(s + x) }
baseE(x, b)= { my(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, 5)))==0, write("b064481.txt", n++, " ", m); if (n==1000, break)) ) } \\ Harry J. Smith, Sep 15 2009
(PARI) isok(n) = !(n % sumdigits(n, 5)); \\ Michel Marcus, Jun 24 2018
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Klaus Brockhaus, Oct 03 2001
EXTENSIONS
Offset changed from 0 to 1 by Harry J. Smith, Sep 15 2009
STATUS
approved