(Translated by https://www.hiragana.jp/)
# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/
Search: id:a064438
Showing 1-1 of 1
%I A064438 #42 Jul 27 2021 15:49:41
%S A064438 1,2,3,4,6,8,9,12,16,18,20,21,24,28,30,32,33,35,36,40,42,48,50,52,54,
%T A064438 60,63,64,66,68,69,72,76,78,80,81,84,88,90,91,96,100,102,108,112,114,
%U A064438 120,126,128,129,132,136,138,140,144,148,150,154,156,160,162,168,171,180
%N A064438 Numbers which are divisible by the sum of their quaternary digits.
%C A064438 A good "puzzle" sequence -- guess the rule given the first twenty or so terms.
%H A064438 Harry J. Smith, Table of n, a(n) for n = 1..1000
%H A064438 Paul Dalenberg and Tom Edgar, Consecutive factorial base Niven numbers, Fibonacci Quart. (2018) Vol. 56, No. 2, 163-166.
%e A064438 Quaternary representation of 28 is 130, 1 + 3 + 0 = 4 divides 28.
%t A064438 Select[Range[200],Divisible[#,Total[IntegerDigits[#,4]]]&] (* _Harvey P. Dale_, Jun 09 2011 *)
%o A064438 (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;.
%o A064438 (PARI)
%o A064438 SumD(x)= { local(s); s=0; while (x>9, s+=x-10*(x\10); x\=10); return(s + x) }
%o A064438 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) }
%o A064438 { 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
%o A064438 (PARI) isok(n) = !(n % sumdigits(n, 4)); \\ _Michel Marcus_, Jun 24 2018
%o A064438 (Python)
%o A064438 from sympy.ntheory.factor_ import digits
%o A064438 print([n for n in range(1, 201) if n%sum(digits(n, 4)[1:]) == 0]) # _Indranil Ghosh_, Apr 24 2017
%Y A064438 Cf. A005349 (decimal), A049445 (binary), A064150 (ternary).
%K A064438 base,easy,nice,nonn
%O A064438 1,2
%A A064438 _Len Smiley_, Oct 01 2001
%E A064438 More terms from _Matthew Conroy_, Oct 02 2001
%E A064438 Offset changed from 0 to 1 by _Harry J. Smith_, Sep 14 2009
# Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE