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.

Showing 1-1 of 1 results.

A338972 Primes p such that the sum of decimal digits of p is the sum of primes dividing p+1 (with repetition).

Original entry on oeis.org

5, 17, 47, 97, 359, 1979, 2399, 5669, 9719, 12799, 79379, 134999, 143999, 161999, 199679, 671999, 679999, 890999, 967999, 974999, 1249999, 3455999, 3583999, 3644999, 4687499, 4976639, 5279999, 5375999, 6298559, 8774999, 16839899, 24959999, 26459999, 29567999, 45359999, 48383999, 68849999
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Dec 18 2020

Keywords

Examples

			a(4) = 97 is in the sequence because 97 is prime, the sum of digits of 97 is 9+7 = 16 and the sum of primes dividing 98=2*7*7 is 2+7+7 = 16.
		

Crossrefs

Primes in A339805.

Programs

  • Maple
    sod:= n -> convert(convert(n,base,10),`+`):
    spf:= proc(n) local t; add(t[1]*t[2],t=ifactors(n)[2]) end proc:
    select(p -> sod(p) = spf(p+1), [seq(ithprime(i),i=1..10^5)]);
  • Mathematica
    sddQ[p_]:=Total[Flatten[Table[#[[1]],#[[2]]]&/@FactorInteger[p+1]]]==Total[IntegerDigits[p]]; Select[Prime[Range[600000]],sddQ] (* The program generates the first 30 terms of the sequence. *) (* Harvey P. Dale, Jul 31 2025 *)
  • PARI
    isok(p) = if (isprime(p), my(f=factor(p+1)); sumdigits(p) == f[, 1]~*f[, 2]); \\ Michel Marcus, Dec 18 2020
Showing 1-1 of 1 results.