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.

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

This page as a plain text file.
%I A308821 #25 Sep 08 2022 08:46:21
%S A308821 14,95,527,851,1247,3551,4307,8051,14351,26969,30227,37769,64769,
%T A308821 87953,152051,163769,199553,202451,256793,275369,341969,455369,
%U A308821 1070969,1095953,1159673,1232051,1625369,1702769,2005007,2081993
%N A308821 Semiprimes where the sum of the digits equals the difference between the prime factors.
%C A308821 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.
%H A308821 James Beyer, <a href="/A308821/b308821.txt">Table of n, a(n) for n = 1..1000</a>
%H A308821 James Beyer, <a href="https://jebeyer.github.io/nlfourteen.html">Numbers Like Fourteen</a>
%H A308821 Wikipedia, <a href="https://en.wikipedia.org/wiki/Digit_sum">Digit sum</a>
%H A308821 Wikipedia, <a href="https://en.wikipedia.org/wiki/Semiprime">Semiprime</a>
%e A308821 14=2*7 and 1+4=7-2.
%e A308821 95=5*19 and 9+5=19-5.
%e A308821 527=17*31 and 5+2+7=31-17.
%t A308821 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 *)
%t A308821 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 *)
%o A308821 (PARI) isok(n) = (bigomega(n) == 2) && (f=factor(n)) && (#f~ == 2) && (sumdigits(n) == f[2,1] - f[1,1]); \\ _Michel Marcus_, Jun 29 2019
%o A308821 (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
%Y A308821 Cf. A001358, A006753, A006881.
%K A308821 nonn,base
%O A308821 1,1
%A A308821 _James Beyer_, Jun 26 2019