|
|
A288054
|
|
Ordered prime numbers as encountered from the building set of positive integers.
|
|
0
|
|
|
2, 3, 13, 23, 31, 41, 43, 241, 421, 431, 1423, 2143, 2341, 4231, 5, 53, 251, 521, 523, 541, 1453, 1523, 1543, 2153, 2351, 2531, 2543, 3251, 3541, 4153, 4253, 4513, 4523, 5231, 5413, 5431, 61, 163, 263, 461, 463, 563, 613, 631, 641, 643, 653, 3461, 4261, 4561, 4621, 4651, 5261, 5623, 5641, 6143, 6421, 6451
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
A permutation of the prime numbers.
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|