login
Prime concatenated analog clock numbers read counterclockwise. Version 2: hours > 9 may be split into individual digits.
2

%I #17 May 21 2024 11:13:43

%S 2,3,5,7,11,19,43,101,211,1019,1987,2111,21211,76543,101987,432121,

%T 4321211,12111019,6543212111,9876543212111,1019876543212111019,

%U 654321211101987654321211,4321211101987654321211101,6543212111019876543212111,76543212111019876543212111019

%N Prime concatenated analog clock numbers read counterclockwise. Version 2: hours > 9 may be split into individual digits.

%C In this version, the digits of 10, 11, and 12 may be split, in contrast to A036343.

%C a(47) has 1499 digits.

%H Michael S. Branicky, <a href="/A373045/b373045.txt">Table of n, a(n) for n = 1..46</a>

%H Eric Angelini, <a href="https://cinquantesignes.blogspot.com/2024/05/philip-gustons-primes.html">Philip Guston's primes</a>

%H Tiziano Mosconi, in reply to Carlos Rivera, <a href="https://www.primepuzzles.net/puzzles/puzz_019.htm">Puzzle 19: Primes on a clock</a>, primepuzzles.net, Aug 13 2001.

%o (Python)

%o import heapq

%o from sympy import isprime

%o from itertools import islice

%o def agen(): # generator of terms

%o digits = [1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 2]

%o h = [(digits[i], i) for i in range(len(digits))]

%o found = set()

%o while True:

%o v, last = heapq.heappop(h)

%o if v not in found and isprime(v):

%o found.add(v)

%o yield v

%o nxt = (last-1)%len(digits)

%o heapq.heappush(h, (v*10+digits[nxt], nxt))

%o print(list(islice(agen(), 25))) # _Michael S. Branicky_, May 20 2024

%o (PARI)

%o A373045_row(r)={my(d=concat([digits(i)|i<-[1..12]]), p); Set([p| s<-[1..#d], d[s]&& isprime(p=fromdigits([d[(s-i)%#d+1]| i<-[1..r]]))])}\\ r-digit-terms

%o A373045_upto_length(L)=concat([A373045_row(r)|r<-[1..L]]) \\ _M. F. Hasler_, May 21 2024

%Y Cf. A036343, A373044.

%K nonn,base

%O 1,1

%A _Eric Angelini_ and _Michael S. Branicky_, May 20 2024