login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A288054 Ordered prime numbers as encountered from the building set of positive integers. 0

%I #15 Aug 02 2017 13:01:31

%S 2,3,13,23,31,41,43,241,421,431,1423,2143,2341,4231,5,53,251,521,523,

%T 541,1453,1523,1543,2153,2351,2531,2543,3251,3541,4153,4253,4513,4523,

%U 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

%N Ordered prime numbers as encountered from the building set of positive integers.

%C A permutation of the prime numbers.

%e 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.

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

%o (Ruby)

%o require 'prime'

%o maxx=6

%o j5=1

%o myList=Array.new()

%o interm=Array.new()

%o final=Array.new()

%o myList[j5-1]=j5

%o while j5<maxx do

%o ...j5+=1

%o ...myList[j5-1]=j5

%o ...if Prime.prime?(j5)==true

%o ......ptr=final.length

%o ......final[ptr]=j5

%o ...end

%o ...for i5 in 2..myList.length

%o ......interm=myList.repeated_permutation(i5).to_a

%o ......for k5 in 0..interm.length-1

%o .........temp=''

%o .........for m5 in 0..i5-1

%o ............temp= [temp,interm[k5][m5].to_s].join

%o .........end

%o .........substr=j5.to_s

%o .........aok=1

%o .........for z in 0..temp.length-1

%o ............for w in 0..temp.length-1

%o ...............if z==w

%o ..................next

%o ...............elsif temp[z]==temp[w]

%o ..................aok=0

%o ..................break

%o ...............end

%o ............end

%o .........end

%o .........if aok>0 && Prime.prime?(temp.to_i)== true && temp.include?(substr)

%o ............ptr=final.length

%o ............final[ptr]=temp.to_i

%o .........end

%o ......end

%o ...end

%o end

%o p final

%Y Cf. A000040.

%K base,easy,nonn

%O 1,1

%A _Bill McEachen_, Jun 04 2017

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)