OFFSET
1,2
COMMENTS
"Noncomposite" digits are 0, 1, 2, 3, 5 and 7.
LINKS
David Consiglio, Jr., Table of n, a(n) for n = 1..1000
EXAMPLE
Noncomposite digits are between parentheses:
Sequence: 1,2,3,5,7,4,10,8,11,12,...
Sequence: (1),(2),(3),(5),(7),4,(1)(0),8,(1)(1),(1)(2),...
Digit position: 1st, 2nd, 3rd, 4th, 5th, 7th, 8th, 10th, 11th, 12th, ... = a reordering of the sequence itself.
PROG
(Python)
noncomp = [0, 1, 2, 3, 5, 7]
terms = [1, 2, 3, 5, 7, 4, 10, 8]
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 noncomp:
return False
return True
while len(terms) < 100:
start = 1
while True:
terms.append(start)
if si(terms) and clear(terms):
break
else:
terms.pop()
start += 1
print(terms)
# David Consiglio, Jr., Oct 30 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Eric Angelini, Feb 05 2006
EXTENSIONS
Corrected by the author on Feb 24 2020 thanks to R. J. Mathar and Bernard Schott
STATUS
approved