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.

A089227 Numbers k such that 1 + k*ds(k) is prime, where ds(k) is the sum of digits of k.

Original entry on oeis.org

1, 2, 4, 6, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 28, 33, 34, 35, 38, 44, 46, 48, 50, 51, 54, 56, 59, 64, 68, 70, 71, 78, 80, 82, 84, 88, 90, 91, 92, 93, 94, 97, 98, 99, 100, 102, 104, 105, 106, 107, 109, 112, 116, 118, 123, 128, 129, 130, 136, 138, 140, 144, 145
Offset: 1

Views

Author

Yalcin Aktar, Dec 10 2003

Keywords

Examples

			10 is in the sequence because A007953(10) = 1 and 1 + 10*1 = 11 is prime.
		

Crossrefs

Programs

  • Magma
    [k:k in [1..145] | IsPrime(1+k*(&+Intseq(k,10)))]; // Marius A. Burtea, Jun 21 2019
  • Maple
    ds:= n -> convert(convert(n,base,10),`+`):
    filter:= n -> isprime(1+n*ds(n)):
    select(filter, [$1..1000]); # Robert Israel, Jun 20 2019
  • Mathematica
    Do[k = Plus @@ IntegerDigits[n]; If[PrimeQ[n*k + 1], Print[n]], {n, 1, 100}] (* Ryan Propper *)
    Select[Range[150],PrimeQ[#*Total[IntegerDigits[#]]+1]&] (* Harvey P. Dale, May 25 2024 *)
  • PARI
    isok(k) = isprime(1+k*sumdigits(k)); \\ Michel Marcus, Jun 20 2019
    

Extensions

More terms from David Wasserman, Aug 31 2005