OFFSET
1,1
COMMENTS
A permutation of the prime numbers.
EXAMPLE
The initial considered set is {1} which yields no primes. The next considered set is {1,2} which yields the prime 2. The next evaluation from {1,2,3} yields 3,13,23,31. Note that no considered integer is used more than once, so 11 is not added from {1,2,3}. Primes are ordered within each considered set. Thus we know the next sequence member after considering {1,2,3,4,5,6} will be 7. Note also that digits are not pulled from any subset element. Treating {1,2,...10} the 10 is not parsed or broken up, just considered in its entirety.
MATHEMATICA
a = {}; Do[s = Select[ FromDigits /@ Flatten[ Permutations /@ Subsets[ Flatten[ IntegerDigits /@ Range[n]]], 1], PrimeQ]; a = Join[a, Union@ Complement[s, a]], {n, 6}]; a (* Giovanni Resta, Jun 05 2017 *)
PROG
(Ruby)
require 'prime'
maxx=6
j5=1
myList=Array.new()
interm=Array.new()
final=Array.new()
myList[j5-1]=j5
while j5<maxx do
...j5+=1
...myList[j5-1]=j5
...if Prime.prime?(j5)==true
......ptr=final.length
......final[ptr]=j5
...end
...for i5 in 2..myList.length
......interm=myList.repeated_permutation(i5).to_a
......for k5 in 0..interm.length-1
.........temp=''
.........for m5 in 0..i5-1
............temp= [temp, interm[k5][m5].to_s].join
.........end
.........substr=j5.to_s
.........aok=1
.........for z in 0..temp.length-1
............for w in 0..temp.length-1
...............if z==w
..................next
...............elsif temp[z]==temp[w]
..................aok=0
..................break
...............end
............end
.........end
.........if aok>0 && Prime.prime?(temp.to_i)== true && temp.include?(substr)
............ptr=final.length
............final[ptr]=temp.to_i
.........end
......end
...end
end
p final
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Bill McEachen, Jun 04 2017
STATUS
approved