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.

A321150 Primes p such that p minus its digit sum is a square.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 41, 43, 47, 97, 151, 157, 233, 239, 331, 337, 457, 593, 599, 743, 911, 919, 1301, 1303, 1307, 1531, 1783, 1787, 1789, 2039, 2311, 2617, 2939, 3613, 3617, 4373, 4783, 4787, 4789, 5641, 5647, 6581, 7079, 7591, 8111, 8117, 8677, 9239, 9829, 11681, 11689, 13001, 13003, 13007
Offset: 1

Views

Author

Marius A. Burtea, Oct 28 2018

Keywords

Examples

			11 is prime and 11 - (1+1) = 9 = 3^2 is square, so 11 is a term of the sequence.
457 is prime and 457 - (4+5+7) = 441 = 21^2 is square, so 457 is a term of the sequence.
2939 is prime and 2939 - (2+9+3+9) = 2916 = 54^2 is square, so 2939 is a term of the sequence.
101 is prime and 101 - (1+0+1) = 99 is not square, so 101 is not a term of the sequence.
		

Crossrefs

Intersection of A000040 and A066566.

Programs

  • Maple
    select(t -> isprime(t) and issqr(t - convert(convert(t,base,10),`+`)),
    [2,seq(i,i=3..20000,2)]); # Robert Israel, Apr 15 2019
  • Mathematica
    Select[Prime@ Range@ 2000, IntegerQ@ Sqrt[# - Total@ IntegerDigits@ #] &] (* Michael De Vlieger, Nov 05 2018 *)
  • PARI
    isok(p) = isprime(p) && issquare(p-sumdigits(p)); \\ Michel Marcus, Oct 30 2018

Extensions

a(26) corrected by Robert Israel, Apr 15 2019