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.

A228020 Composite numbers whose initial, all intermediate and final iterated digit sums are composite numbers.

This page as a plain text file.
%I A228020 #22 Mar 25 2016 16:56:50
%S A228020 4,6,8,9,15,18,22,24,26,27,33,35,36,40,42,44,45,51,54,60,62,63,69,72,
%T A228020 78,80,81,87,90,96,99,105,108,112,114,116,117,121,123,125,126,130,132,
%U A228020 134,135,141,143,144,150,152,153,159,161,162,168,170,171,177,180,186,189,195,198,202,204,206
%N A228020 Composite numbers whose initial, all intermediate and final iterated digit sums are composite numbers.
%C A228020 a(n) is congruent to 0, 4, 6 or 8 mod 9. - _Robert Israel_, Aug 12 2014
%H A228020 Derek Orr, <a href="/A228020/b228020.txt">Table of n, a(n) for n = 1..10000</a>
%e A228020 78 is a term because 78, 7+8 = 15, and 1+5 = 6 are composite.
%p A228020 filter:= proc(n) local x;
%p A228020 x:= n;
%p A228020 do
%p A228020    if isprime(x) then return false fi;
%p A228020    if x < 10 then return (x > 1) fi;
%p A228020    x:= convert(convert(x,base,10),`+`);
%p A228020 od:
%p A228020 end proc;
%p A228020 select(filter,[$4..1000]); # _Robert Israel_, Aug 12 2014
%t A228020 okQ[n_] := n > 1 && !PrimeQ[n] && (n < 10 || okQ@ Total@ IntegerDigits@ n); Select[Range@168, okQ] (* _Giovanni Resta_, Aug 05 2013 *)
%t A228020 cnQ[n_]:=AllTrue[NestWhileList[Total[IntegerDigits[#]]&,n,#>9&], CompositeQ]; Select[Range[210],cnQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Mar 25 2016 *)
%o A228020 (PARI)
%o A228020 forcomposite(n=1,500,s=sumdigits(n);while(s>9&&!isprime(s)&&s!=1,s=sumdigits(s));if(!isprime(s)&&s!=1,print1(n,", "))) \\ _Derek Orr_, Aug 12 2014
%Y A228020 A subset of A228019 and A104211.
%K A228020 nonn,easy,base
%O A228020 1,1
%A A228020 _Derek Orr_, Aug 02 2013