(50g) OEIS A028842: Product of Digits is a Prime
09-05-2017, 02:43 PM (This post was last modified: 09-10-2017 11:34 AM by Gerald H.)
Post: #1
 Gerald H Senior Member Posts: 1,452 Joined: May 2014
(50g) OEIS A028842: Product of Digits is a Prime
For integer input N the programme returns the Nth element of the series

https://oeis.org/A028842

where the elements are all numbers in naturally ascending order whose product of digits is a prime.

I am particularly unhappy with this

4. OVER
WHILE DUP2 <
REPEAT OVER -
SWAP 4. + SWAP
END

section of code & would welcome a speedier method of calculating the 2 numbers deposited on the stack.

SIZE 173.

CKSUM # 502Fh

Code:
« 4. OVER   WHILE DUP2 <   REPEAT OVER - SWAP 4. + SWAP   END "" 1. 4. ROLL 4. /   START "1" +   NEXT OBJ→ SWAP 4. IDIV2 DUP   IF   THEN DUP 3. ==     IF     THEN DROP 4     END   ELSE DROP 1. - 6   END 10 ROT R→I ^ * + SWAP DROP »
 « Next Oldest | Next Newest »

 Messages In This Thread (50g) OEIS A028842: Product of Digits is a Prime - Gerald H - 09-05-2017 02:43 PM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - Joe Horn - 09-05-2017, 09:21 PM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - Gerald H - 09-06-2017, 05:43 AM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - Joe Horn - 09-06-2017, 06:27 AM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - Gerald H - 09-06-2017, 11:57 AM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - Gerald H - 09-06-2017, 03:44 PM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - Gerald H - 09-06-2017, 06:43 PM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - Gerald H - 09-07-2017, 10:00 AM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - pier4r - 09-07-2017, 12:08 PM RE: (50g) OEIS A028842: Product of Digits is a Prime Sequence - Gerald H - 09-07-2017, 12:14 PM

User(s) browsing this thread: 1 Guest(s)