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.

A295430 a(n) is the least nontrivial multiple of n that begins with 3.

Original entry on oeis.org

3, 30, 30, 32, 30, 30, 35, 32, 36, 30, 33, 36, 39, 308, 30, 32, 34, 36, 38, 300, 315, 308, 322, 312, 300, 312, 324, 308, 319, 300, 310, 320, 330, 306, 315, 324, 333, 304, 312, 320, 328, 336, 301, 308, 315, 322, 329, 336, 343, 300, 306, 312, 318, 324, 330, 336, 342, 348, 354, 300, 305, 310, 315
Offset: 1

Views

Author

Robert Israel, Feb 12 2018

Keywords

Crossrefs

Cf. A082792.

Programs

  • Maple
    f:= proc(n) local m,k;
      for m from 0 do
        k := max(2, ceil(3*10^m/n));
        if k*n < 4*10^m then return k*n end if
      end do
    end proc:
    seq(f(i),i=1..100);
  • PARI
    a(n) = {my(k=2); while(digits(k*n)[1] != 3, k++); k*n;} \\ Michel Marcus, Feb 13 2018
    
  • Python
    def A295430(n):
        m = 2*n
        while True:
            if str(m)[0] == '3':
                return m
            m += n # Chai Wah Wu, Feb 13 2018