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.

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.

This page as a plain text file.
%I A161551 #13 May 26 2019 18:04:14
%S A161551 22,15,26,18,28,39,68,69,88,99,299,399,589,699,799,899,999,2899,3999,
%T A161551 5999,6999,7999,9899,9999,29999,39999,58999,69999,89999,99999,299899,
%U A161551 399999,499999,689999,699999,889999,999999,1999999,3899999,3999999
%N 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.
%C A161551 Variant of A073866, where the requirement that a(n) > A002808(n) is dropped.
%F A161551 min{c in A002808, c> A002808(n): A007953(c) = A002808(n)}. - _R. J. Mathar_, Dec 06 2011
%e A161551 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).
%p A161551 A161551 := proc(n)
%p A161551     for j from n+1 do
%p A161551         if digsum(A002808(j)) = A002808(n) then
%p A161551             return A002808(j) ;
%p A161551         end if;
%p A161551     end do:
%p A161551 end proc:
%p A161551 seq(A161551(n),n=1..30) ; # _R. J. Mathar_, Dec 06 2011
%o A161551 (UBASIC)
%o A161551 10 'compsdig, _Enoch Haga_, Jun 12 2009
%o A161551 20 N=1
%o A161551 30 Q=str(N)
%o A161551 40 L=len(Q)
%o A161551 50 for X=1 to L
%o A161551 60 M=str(mid(Q,X,1)): Z=Z+val(mid(Q,X,1))
%o A161551 70 next X
%o A161551 80 if Z=56 and Z<>prmdiv(Z) and N<>prmdiv(N) then print N: stop
%o A161551 90 Z=0: N=N+1: goto 30
%Y A161551 Cf. A075360, A054750.
%K A161551 base,easy,nonn
%O A161551 1,1
%A A161551 _Enoch Haga_, Jun 13 2009