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.

A064150 Numbers divisible by the sum of their ternary digits.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32, 33, 35, 36, 39, 40, 45, 48, 54, 56, 57, 60, 63, 64, 65, 72, 75, 77, 78, 80, 81, 82, 84, 87, 88, 90, 92, 93, 95, 96, 99, 100, 105, 108, 111, 112, 115, 117, 120, 132, 133, 135, 136, 144, 145, 150, 152
Offset: 1

Views

Author

Len Smiley, Sep 11 2001

Keywords

Comments

a(n) mod A053735(a(n)) = 0. - Reinhard Zumkeller, Nov 25 2009

Crossrefs

Cf. A005349 (Decimal), A049445 (Binary).

Programs

  • Haskell
    a064150 n = a064150_list !! (n-1)
    a064150_list = filter (\x -> x `mod` a053735 x == 0) [1..]
    -- Reinhard Zumkeller, Oct 28 2012
    
  • Mathematica
    Select[Range[200], IntegerQ[#/(Plus@@IntegerDigits[#, 3])] &] (* Alonso del Arte, May 27 2011 *)
  • PARI
    isok(m)={m % sumdigits(m, 3) == 0} \\ Harry J. Smith, Sep 09 2009
    
  • Python
    import numpy as np
    def gen():
        for dec_num in range(1,153):
            tern_num = np.base_repr(dec_num, 3)
            sum_tern_digits = 0
            for i in tern_num:
                sum_tern_digits += int(i)
            if dec_num % sum_tern_digits == 0:
                yield dec_num
    print(list((gen()))) # Adrienne Leonardo, Dec 28 2024

Extensions

Corrected and extended by Vladeta Jovovic, Sep 22 2001
Offset corrected by Reinhard Zumkeller, Oct 28 2012