cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A372770 Primes in A284798.

This page as a plain text file.
%I A372770 #31 Mar 14 2025 19:02:00
%S A372770 13,97,853,1021,1093,7873,8161,8377,9337,12241,62989,63853,66733,
%T A372770 74797,79861,81373,82021,84181,86413,91381,92317,94477,95773,98893,
%U A372770 100189,101701,111997,114157,534841,552553,556441,560977,578689,580633,591937,600361,631249
%N A372770 Primes in A284798.
%C A372770 The base-b expansion (d_1)(d_2)...(d_m) of a number is antipalindromic if, for each of its m digits, it holds that d_k + d_{m-k+1} = b-1.
%C A372770 In a base other than 3, there is at most a single antipalindromic prime.
%C A372770 All terms have an odd number of base-3 digits. - _Robert Israel_, Mar 14 2025
%H A372770 Robert Israel, <a href="/A372770/b372770.txt">Table of n, a(n) for n = 1..10000</a>
%H A372770 Lubomira Dvorakova, Stanislav Kruml, and David Ryzák, <a href="https://arxiv.org/abs/2008.06864">Antipalindromic numbers</a>, arXiv:2008.06864 [math.CO], 2020.
%e A372770 For m = 3, the only solution is 13 = 111_3.
%e A372770 For m = 5, the only solution is 97 = 10121_3.
%p A372770 arev3:= proc(n) local L,i;
%p A372770     L:= convert(n,base,3);
%p A372770     add((2-L[-i])*3^(i-1),i=1..nops(L))
%p A372770 end proc;
%p A372770 qprime:= proc(x) if isprime(x) then x fi end proc:
%p A372770 F:= proc(d) local x,y;
%p A372770     seq(qprime(x*3^((d+1)/2) + 3^((d-1)/2) + arev3(x)),x=3^((d-3)/2)..2*3^((d-3)/2)-1)
%p A372770 end proc;
%p A372770 [seq(F(i),i=3..13,2)]; # _Robert Israel_, Mar 14 2025
%t A372770 Select[Prime[Range[52000]], FromDigits[Reverse[2 - IntegerDigits[#, 3]], 3] == # &] (* _Amiram Eldar_, Jun 16 2024 *)
%o A372770 (Python)
%o A372770 from sympy import isprime
%o A372770 from itertools import count, islice, product
%o A372770 def bgen(): # generator of terms of A284798
%o A372770     yield 1
%o A372770     for d in count(2):
%o A372770         for first in [1, 2]:
%o A372770             for rest in product([0, 1, 2], repeat=(d-2)//2):
%o A372770                 left, mid = (first,) + rest, (1,) if d&1 else tuple()
%o A372770                 right = tuple([2-d for d in left][::-1])
%o A372770                 yield int("".join(str(d) for d in left + mid + right), 3)
%o A372770 def agen(): yield from filter(isprime, bgen())
%o A372770 print(list(islice(agen(), 40))) # _Michael S. Branicky_, Jun 16 2024
%Y A372770 Cf. A284798.
%K A372770 base,nonn,easy
%O A372770 1,1
%A A372770 _Stanislav Kruml_, May 12 2024