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.

A356947 Emirps p such that p == 1 (mod s) and R(p) == 1 (mod s), where R(p) is the digit reversal of p and s the sum of digits of p.

This page as a plain text file.
%I A356947 #25 Sep 18 2022 11:22:21
%S A356947 1021,1031,1201,1259,1301,9521,10253,10711,11071,11161,11243,11701,
%T A356947 12113,12241,14221,15907,16111,16481,17011,17491,18461,19471,30757,
%U A356947 31121,34211,35201,70951,71347,71569,72337,73327,74317,75703,96517,100621,101611,101701,102061,102913,103141,105211,106661
%N A356947 Emirps p such that p == 1 (mod s) and R(p) == 1 (mod s), where R(p) is the digit reversal of p and s the sum of digits of p.
%C A356947 Emirps p such that p and its digit reversal are quasi-Niven numbers.
%H A356947 Robert Israel, <a href="/A356947/b356947.txt">Table of n, a(n) for n = 1..1000</a>
%e A356947 a(3) = 1201 is a term because it and its digit reversal 1021 are distinct primes with sum of digits 4, and 1201 == 1021 == 1 (mod 4).
%p A356947 filter:= proc(n) local L,i,r,s;
%p A356947   if not isprime(n) then return false fi;
%p A356947   L:= convert(n,base,10);
%p A356947   r:= add(L[-i]*10^(i-1),i=1..nops(L));
%p A356947   if r = n or not isprime(r) then return false fi;
%p A356947   s:= convert(L,`+`);
%p A356947   n mod s = 1 and r mod s = 1
%p A356947 end proc:
%p A356947 select(filter, [seq(i,i=13 .. 200000, 2)]);
%t A356947 Select[Range[110000], (r = IntegerReverse[#]) != # && PrimeQ[#] && PrimeQ[r] && Divisible[# - 1, (s = Plus @@ IntegerDigits[#])] && Divisible[r - 1, s] &] (* _Amiram Eldar_, Sep 06 2022 *)
%o A356947 (Python)
%o A356947 from sympy import isprime
%o A356947 def ok(n):
%o A356947     strn = str(n)
%o A356947     R, s = int(strn[::-1]), sum(map(int, strn))
%o A356947     return n != R and n%s == 1 and R%s == 1 and isprime(n) and isprime(R)
%o A356947 print([k for k in range(10**6) if ok(k)]) # _Michael S. Branicky_, Sep 06 2022
%Y A356947 Cf. A004086, A006567, A209871.
%K A356947 nonn,base
%O A356947 1,1
%A A356947 _J. M. Bergot_ and _Robert Israel_, Sep 05 2022