OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
MATHEMATICA
SequencePosition[Table[If[SequenceCount[IntegerDigits[n, 8], {1, 3}]>0 || SequenceCount[ IntegerDigits[n, 8], {3, 1}]>0, 1, 0], {n, 1600}], {0, 1}][[All, 2]] (* Harvey P. Dale, Nov 11 2022 *)
PROG
(Python)
def has13or31(n): o = oct(n); return "13" in o or "31" in o
def ok(n): return has13or31(n) and not has13or31(n-1)
print([k for k in range(1600) if ok(k)]) # Michael S. Branicky, Nov 25 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved