login
A114316
Lexicographically earliest sequence of positive distinct terms such that the a(n)th digit of the sequence is nonprime (see the Comments section).
2
1, 3, 4, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 25, 27, 38, 40, 41, 37, 39, 45, 46, 48, 49, 50, 51, 52, 53, 55, 57, 66, 67, 68, 70, 71, 73, 75, 80, 81, 82, 83, 84, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 102, 104, 105, 106
OFFSET
1,2
COMMENTS
"Nonprime" digits are 0, 1, 4, 6, 8 and 9.
LINKS
David Consiglio, Jr., Table of n, a(n) for n = 1..1000
EXAMPLE
Nonprime digits are between brackets:
Sequence: (1),3,(4),(6),7,(8),(9),(1)(0),(1)(1),(1)2,(1)4, ...
Digit position in the sequence: 1st, 3rd, 4th, 6th, 7th, 8th, 9th, 10th, 11th, 12th, 14th, ... = a reordering of the sequence itself.
PROG
(Python)
nonprime = [0, 1, 4, 6, 8, 9]
terms = [1, 3, 4, 6, 7, 8, 9]
def si(test_list):#all terms greater than 0 and no repetitions
a = all(i > 0 for i in test_list)
b = len(test_list) == len(set(test_list))
return a & b
def clear(test_list):#sequence meets definitional criteria
full = (''.join(str(x) for x in test_list))
for a in test_list:
if int(a)-1 >= len(full):
return True
elif int(full[int(a)-1]) not in nonprime:
return False
return True
while len(terms) < 1000:
start = 1
while True:
terms.append(start)
if si(terms) and clear(terms):
break
else:
terms.pop()
start += 1
# David Consiglio, Jr., Oct 30 2023
CROSSREFS
Cf. A114319 (same idea but with the "noncomposite" digits 0, 1, 2, 3, 5 and 7).
Sequence in context: A092460 A092459 A039232 * A039176 A066533 A039130
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Feb 05 2006
EXTENSIONS
Corrected and extended by R. J. Mathar, Bernard Schott and Eric Angelini
a(63) and beyond from David Consiglio, Jr., Oct 30 2023
STATUS
approved