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.

User: James Beyer

James Beyer's wiki page.

James Beyer has authored 1 sequences.

A308821 Semiprimes where the sum of the digits equals the difference between the prime factors.

Original entry on oeis.org

14, 95, 527, 851, 1247, 3551, 4307, 8051, 14351, 26969, 30227, 37769, 64769, 87953, 152051, 163769, 199553, 202451, 256793, 275369, 341969, 455369, 1070969, 1095953, 1159673, 1232051, 1625369, 1702769, 2005007, 2081993
Offset: 1

Author

James Beyer, Jun 26 2019

Keywords

Comments

14 is the only even number in the sequence, since 2 is the only even prime and p-2 grows much faster than the digit sum of 2p.

Examples

			14=2*7 and 1+4=7-2.
95=5*19 and 9+5=19-5.
527=17*31 and 5+2+7=31-17.
		

Crossrefs

Programs

  • Magma
    [n:n in [2..2100000]|IsSquarefree(n) and #PrimeDivisors(n) eq 2 and PrimeDivisors(n)[2]-PrimeDivisors(n)[1] eq &+Intseq(n)]; // Marius A. Burtea, Jul 27 2019
  • Mathematica
    Take[Sort@ Reap[ Do[ If[PrimeQ[q + g] && g == Total@ IntegerDigits[n = q (q + g)], Sow@n], {g, 9*9}, {q, Prime@ Range@ 2000}]][[2, 1]], 100] (* Giovanni Resta, Jul 25 2019 *)
    spdpfQ[n_]:=Module[{f=FactorInteger[n][[All,1]]},PrimeOmega[n]== 2 && Total[ IntegerDigits[n]]==f[[2]]-f[[1]]]; Select[Range[ 21*10^5],spdpfQ]// Quiet (* or *) Times@@@Select[Subsets[Prime[ Range[ 300]],{2}],#[[2]]-#[[1]]==Total[IntegerDigits[#[[1]]#[[2]]]]&] (* Harvey P. Dale, Oct 14 2021 *)
  • PARI
    isok(n) = (bigomega(n) == 2) && (f=factor(n)) && (#f~ == 2) && (sumdigits(n) == f[2,1] - f[1,1]); \\ Michel Marcus, Jun 29 2019