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.

A034837 Numbers that are divisible by the first, i.e., the leftmost, digit.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 33, 36, 39, 40, 44, 48, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122
Offset: 1

Views

Author

Keywords

Comments

A 10-automatic sequence. - Charles R Greathouse IV, Jun 13 2017

Crossrefs

Cf. A034709 (divisible by last digit).

Programs

  • Haskell
    import Data.Char (digitToInt)
    a034837 n = a034837_list !! (n-1)
    a034837_list = filter (\i -> i `mod` (a000030 i) == 0) [1..]
    -- Reinhard Zumkeller, Jun 19 2011
    
  • Mathematica
    Select[Range[150],Divisible[#,IntegerDigits[#][[1]]]&] (* Harvey P. Dale, Jul 11 2017 *)
  • PARI
    for(n=1,1000,n%(Vecsmall(Str(n))[1]-48) || print1(n",")) \\ M. F. Hasler, Jun 19 2011
    
  • PARI
    a(n)=for(k=1,1e9,k%(Vecsmall(Str(k))[1]-48) || n-- || return(k)) \\  M. F. Hasler, Jun 19 2011
    
  • Python
    def ok(n): return n and n%int(str(n)[0]) == 0
    print([k for k in range(123) if ok(k)]) # Michael S. Branicky, Jan 15 2023
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        yield from (i for e in count(0) for f in range(1, 10) for i in range(f*10**e, (f+1)*10**e, f))
    print(list(islice(agen(), 64))) # Michael S. Branicky, Jan 15 2023

Formula

a(n) mod A000030(a(n)) = 0. - Reinhard Zumkeller, Sep 20 2003

Extensions

Definition clarified by Harvey P. Dale, May 01 2023