A372770 Primes in A284798.
13, 97, 853, 1021, 1093, 7873, 8161, 8377, 9337, 12241, 62989, 63853, 66733, 74797, 79861, 81373, 82021, 84181, 86413, 91381, 92317, 94477, 95773, 98893, 100189, 101701, 111997, 114157, 534841, 552553, 556441, 560977, 578689, 580633, 591937, 600361, 631249
Offset: 1
Examples
For m = 3, the only solution is 13 = 111_3. For m = 5, the only solution is 97 = 10121_3.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Lubomira Dvorakova, Stanislav Kruml, and David Ryzák, Antipalindromic numbers, arXiv:2008.06864 [math.CO], 2020.
Crossrefs
Cf. A284798.
Programs
-
Maple
arev3:= proc(n) local L,i; L:= convert(n,base,3); add((2-L[-i])*3^(i-1),i=1..nops(L)) end proc; qprime:= proc(x) if isprime(x) then x fi end proc: F:= proc(d) local x,y; seq(qprime(x*3^((d+1)/2) + 3^((d-1)/2) + arev3(x)),x=3^((d-3)/2)..2*3^((d-3)/2)-1) end proc; [seq(F(i),i=3..13,2)]; # Robert Israel, Mar 14 2025
-
Mathematica
Select[Prime[Range[52000]], FromDigits[Reverse[2 - IntegerDigits[#, 3]], 3] == # &] (* Amiram Eldar, Jun 16 2024 *)
-
Python
from sympy import isprime from itertools import count, islice, product def bgen(): # generator of terms of A284798 yield 1 for d in count(2): for first in [1, 2]: for rest in product([0, 1, 2], repeat=(d-2)//2): left, mid = (first,) + rest, (1,) if d&1 else tuple() right = tuple([2-d for d in left][::-1]) yield int("".join(str(d) for d in left + mid + right), 3) def agen(): yield from filter(isprime, bgen()) print(list(islice(agen(), 40))) # Michael S. Branicky, Jun 16 2024
Comments