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.

A344127 Primes p such that (p mod s) and (p mod t) are consecutive primes, where s is the sum of the digits of p and t is the product of the digits of p.

Original entry on oeis.org

23, 29, 313, 397, 431, 661, 941, 1129, 1193, 1223, 1277, 1613, 2621, 2791, 3461, 4111, 4159, 12641, 12911, 14419, 15271, 19211, 21611, 21773, 22613, 26731, 29819, 31181, 31511, 41381, 61211, 74611, 111191, 115811, 121181, 121727, 141161, 141221, 141269, 145513, 157523, 171713, 173141, 173891
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, May 09 2021

Keywords

Comments

Since p mod 0 is not defined, the digit 0 is not allowed.

Examples

			a(3) = 313 is a term because with s = 3+1+3 = 7 and t = 3*1*3 = 9, 313 mod 7 = 5 and 313 mod 9 = 7 are consecutive primes.
		

Crossrefs

Programs

  • Maple
    filter:= proc(p) local L,s,t,q;
      L:= convert(p,base,10);
      s:= convert(L,`+`);
      t:= convert(L,`*`);
      if t = 0 then return false fi;
      q:= p mod s;
      isprime(q) and (p mod t) = nextprime(q)
    end proc:
    select(filter, [seq(ithprime(i),i=1..20000)]);
  • PARI
    isok(p) = if (isprime(p), my(d=digits(p)); vecmin(d) && isprime(q=(p%vecsum(d))) && isprime(r=(p%vecprod(d))) && (nextprime(q+1)==r)); \\ Michel Marcus, May 10 2021