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.

Showing 1-3 of 3 results.

A073866 a(n) is the smallest composite number with the sum of digits = the n-th composite number.

Original entry on oeis.org

4, 6, 8, 9, 28, 39, 68, 69, 88, 99, 299, 399, 589, 699, 799, 899, 999, 2899, 3999, 5999, 6999, 7999, 9899, 9999, 29999, 39999, 58999, 69999, 89999, 99999, 299899, 399999, 499999, 689999, 699999, 889999, 999999, 1999999, 3899999, 3999999, 5899999, 6999999, 8999999, 9999999
Offset: 1

Views

Author

Amarnath Murthy, Aug 15 2002

Keywords

Examples

			a(5) = 28, because 10 is the 5th composite, and 28 is the first composite with sum of digits equal to 10. - _Michel Marcus_, May 19 2014
		

Crossrefs

Programs

  • PARI
    lista(nn) = {vn = vector(nn, i, i); vc = select(x->iscomp(x), vn); vsd = vector(#vc, i, sumdigits(vc[i])); for (i=1, #vc, print1(vc[select(x->(x==vc[i]), vsd, 1)[1]], ", "););} \\ Michel Marcus, May 19 2014

Extensions

More terms from Michel Marcus, May 19 2014

A161551 The smallest composite number larger than the n-th composite number, which has a sum of digits equal to the n-th composite number.

Original entry on oeis.org

22, 15, 26, 18, 28, 39, 68, 69, 88, 99, 299, 399, 589, 699, 799, 899, 999, 2899, 3999, 5999, 6999, 7999, 9899, 9999, 29999, 39999, 58999, 69999, 89999, 99999, 299899, 399999, 499999, 689999, 699999, 889999, 999999, 1999999, 3899999, 3999999
Offset: 1

Views

Author

Enoch Haga, Jun 13 2009

Keywords

Comments

Variant of A073866, where the requirement that a(n) > A002808(n) is dropped.

Examples

			The first composite is 4, and the first sum of digits is 13, but since that is prime, we go to the next, 22, which being composite is a(1).
		

Crossrefs

Programs

  • Maple
    A161551 := proc(n)
        for j from n+1 do
            if digsum(A002808(j)) = A002808(n) then
                return A002808(j) ;
            end if;
        end do:
    end proc:
    seq(A161551(n),n=1..30) ; # R. J. Mathar, Dec 06 2011
  • UBASIC
    10 'compsdig, Enoch Haga, Jun 12 2009
    20 N=1
    30 Q=str(N)
    40 L=len(Q)
    50 for X=1 to L
    60 M=str(mid(Q,X,1)): Z=Z+val(mid(Q,X,1))
    70 next X
    80 if Z=56 and Z<>prmdiv(Z) and N<>prmdiv(N) then print N: stop
    90 Z=0: N=N+1: goto 30

Formula

min{c in A002808, c> A002808(n): A007953(c) = A002808(n)}. - R. J. Mathar, Dec 06 2011

A161561 The smallest number larger than n with digital sum equal to n.

Original entry on oeis.org

10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999
Offset: 1

Views

Author

Enoch Haga, Jun 13 2009

Keywords

Examples

			a(4)=13 because the sums of digits of the candidates 5 to 12 are all different from n=4, and 13 is the first candidate with sum 1+3 = n = 4.
		

Crossrefs

Programs

  • Mathematica
    dsn[n_]:=Module[{k=n+1},While[Total[IntegerDigits[k]]!=n,k++];k]; Array[ dsn,50] (* Harvey P. Dale, Oct 24 2020 *)
  • PARI
    a(n) = my(m = n+1); while(sumdigits(m) != n, m++); m; \\ Michel Marcus, Jun 08 2014

Formula

a(n) = min{k>n: A007953(k) = n}.

Extensions

More precise definition from R. J. Mathar, Aug 30 2010
Showing 1-3 of 3 results.