cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A064438 Numbers which are divisible by the sum of their quaternary digits.

Original entry on oeis.org

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, 60, 63, 64, 66, 68, 69, 72, 76, 78, 80, 81, 84, 88, 90, 91, 96, 100, 102, 108, 112, 114, 120, 126, 128, 129, 132, 136, 138, 140, 144, 148, 150, 154, 156, 160, 162, 168, 171, 180
Offset: 1

Views

Author

Len Smiley, Oct 01 2001

Keywords

Comments

A good "puzzle" sequence -- guess the rule given the first twenty or so terms.

Examples

			Quaternary representation of 28 is 130, 1 + 3 + 0 = 4 divides 28.
		

Crossrefs

Cf. A005349 (decimal), A049445 (binary), A064150 (ternary).

Programs

  • 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;
    
  • Mathematica
    Select[Range[200],Divisible[#,Total[IntegerDigits[#,4]]]&] (* Harvey P. Dale, Jun 09 2011 *)
  • 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

Extensions

More terms from Matthew Conroy, Oct 02 2001
Offset changed from 0 to 1 by Harry J. Smith, Sep 14 2009