login
This site is supported by donations to The OEIS Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A228020 Composite numbers whose initial, all intermediate and final iterated digit sums are composite numbers. 1
4, 6, 8, 9, 15, 18, 22, 24, 26, 27, 33, 35, 36, 40, 42, 44, 45, 51, 54, 60, 62, 63, 69, 72, 78, 80, 81, 87, 90, 96, 99, 105, 108, 112, 114, 116, 117, 121, 123, 125, 126, 130, 132, 134, 135, 141, 143, 144, 150, 152, 153, 159, 161, 162, 168, 170, 171, 177, 180, 186, 189, 195, 198, 202, 204, 206 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

a(n) is congruent to 0, 4, 6 or 8 mod 9. - Robert Israel, Aug 12 2014

LINKS

Derek Orr, Table of n, a(n) for n = 1..10000

EXAMPLE

78 is a term because 78, 7+8 = 15, and 1+5 = 6 are composite.

MAPLE

filter:= proc(n) local x;

x:= n;

do

   if isprime(x) then return false fi;

   if x < 10 then return (x > 1) fi;

   x:= convert(convert(x, base, 10), `+`);

od:

end proc;

select(filter, [$4..1000]); # Robert Israel, Aug 12 2014

MATHEMATICA

okQ[n_] := n > 1 && !PrimeQ[n] && (n < 10 || okQ@ Total@ IntegerDigits@ n); Select[Range@168, okQ] (* Giovanni Resta, Aug 05 2013 *)

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 *)

PROG

(PARI)

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

CROSSREFS

A subset of A228019 and A104211.

Sequence in context: A254755 A275624 A228019 * A163282 A095404 A073540

Adjacent sequences:  A228017 A228018 A228019 * A228021 A228022 A228023

KEYWORD

nonn,easy,base

AUTHOR

Derek Orr, Aug 02 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 18 11:14 EST 2019. Contains 319271 sequences. (Running on oeis4.)