A036343
Prime concatenated analog clock numbers read counterclockwise.
Original entry on oeis.org
2, 3, 5, 7, 11, 43, 109, 10987, 76543, 6543211211, 4321121110987, 3211211109876543211211, 43211211109876543211211109876543, 9876543211211109876543211211109876543211211109876543211211
Offset: 1
-
import heapq
from sympy import isprime
from itertools import islice
def A036343_gen(): # generator of terms
h = [(i, i) for i in range(1, 13)]
while True:
v, last = heapq.heappop(h)
if isprime(v):
yield v
nxt = 12 if last == 1 else last-1
shift = 10 if nxt < 10 else 100
heapq.heappush(h, (v*shift+nxt, nxt))
print(list(islice(A036343_gen(), 16))) # Michael S. Branicky, May 20 2024
A036344
Prime concatenated analog clock numbers (clockwise and counterclockwise).
Original entry on oeis.org
2, 3, 5, 7, 11, 23, 43, 67, 89, 109, 4567, 10987, 76543, 23456789, 6543211211, 4321121110987, 23456789101112123, 891011121234567891011, 3211211109876543211211, 23456789101112123456789101112123, 43211211109876543211211109876543, 567891011121234567891011121234567891011
Offset: 1
A373044
Prime concatenated analog clock numbers read clockwise. Version 2: hours > 9 are split in 2 digits.
Original entry on oeis.org
2, 3, 5, 7, 11, 23, 67, 89, 101, 4567, 10111, 67891, 89101, 789101, 4567891, 23456789, 56789101, 1234567891, 45678910111, 12345678910111, 1112123456789101, 23456789101112123, 112123456789101112123, 891011121234567891011, 4567891011121234567891
Offset: 1
101 is a term here using the digits 1 and 0 from 10 and the first 1 of 11.
-
A373044_row(r)={my(d=concat([digits(i)|i<-[1..12]]), p); Set([p| s<-[1..#d], d[s]&& isprime(p=fromdigits([d[i%#d+1]| i<-[s-1..s+r-2]]))])}\\ r-digit-terms
A373044_upto_length(L)=concat([A373044_row(r)|r<-[1..L]]) \\ M. F. Hasler, May 21 2024
-
import heapq
from sympy import isprime
from itertools import islice
def agen(): # generator of terms
digits = [1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 2]
h = [(digits[i], i) for i in range(len(digits))]
found = set()
while True:
v, last = heapq.heappop(h)
if v not in found and isprime(v):
found.add(v)
yield v
nxt = (last+1)%len(digits)
heapq.heappush(h, (v*10+digits[nxt], nxt))
print(list(islice(agen(), 25)))
Showing 1-3 of 3 results.
Comments