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.

A069525 Smallest multiple of n with digit sum = 6, or 0 if no such number exists, e.g. a(9k)= 0.

Original entry on oeis.org

6, 6, 6, 24, 15, 6, 42, 24, 0, 60, 33, 24, 312, 42, 15, 240, 51, 0, 114, 60, 42, 132, 1104, 24, 150, 312, 0, 420, 1131, 60, 1023, 2112, 33, 204, 105, 0, 222, 114, 312, 240, 123, 42, 1032, 132, 0, 1104, 141, 240, 12201, 150, 51, 312, 1113, 0, 330, 4200, 114, 4002, 2301
Offset: 1

Views

Author

Amarnath Murthy, Apr 01 2002

Keywords

Comments

In addition to those divisible by 9, all numbers n divisible by 239, 271 or 803 have a(n)=0. - Robert Israel, Sep 04 2019

Crossrefs

Programs

  • Maple
    N:= 1000: # to get a(1)..a(N)
    nextL:= proc(L)
    local m,q,Lp;
    for m from 1 do
       if L[m] > 0 then
        if m = LinearAlgebra:-Dimension(L) then return <5,0$(m-1),1>
        else Lp:= L;
           Lp[1]:= L[m]-1;
           Lp[2..m]:= 0;
           Lp[m+1]:= L[m+1]+1;
           return Lp;
        fi
       fi
    od;
    end proc:
    nogo:= proc(n) local m,a2,a5,S,S2,S3,i,j;
      a2:= padic:-ordp(n,2);
      a5:= padic:-ordp(n,5);
      m:= numtheory:-order(10,n/(2^a2*5^a5))+max(a2,a5);
      S:= {seq(10^i mod n, i=0..m-1)};
      S2:= {seq(seq(S[i]+S[j] mod n,j=1..i),i=1..nops(S))};
      S3:= {seq(seq(S[i]+ S2[j] mod n, j=1..nops(S2)),i=1..nops(S))};
      evalb(S3 intersect map(t -> -t mod n, S3) = {});
    end proc:
    Agenda:= remove(t -> (t mod 9=0 or t mod 239=0 or t mod 271=0 or t mod 803=0, {$1..N}):
    L:= <6>: x:= 6:
    A:= Vector(N):
    while Agenda <> {} and x < 10^20 do
      x:= add(L[i]*10^(i-1),i=1..LinearAlgebra:-Dimension(L));
      found,Agenda:= selectremove(t -> x mod t = 0, Agenda);
      if found <> {} then
        A[convert(found,list)]:= x;
      fi;
      L:= nextL(L);
    od:
    Agenda:= remove(nogo,Agenda);
    if Agenda <> {} then printf("Values not found for %a\n",Agenda) fi;
    convert(A,list); # Robert Israel, Sep 04 2019
  • Mathematica
    Array[If[AnyTrue[Mod[#, {9, 239, 271, 803}], # == 0 &], 0, Block[{k = 1}, While[Total@ IntegerDigits[k #] != 6, k++]; k #]] &, 59] (* Michael De Vlieger, Sep 04 2019 *)

Formula

a(n) = n*A088395(n). - R. J. Mathar, Aug 06 2019

Extensions

More terms from Ray Chandler, Jul 30 2003