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.

A094877 Primes that are reached in A094830.

Original entry on oeis.org

2, 2, 3, 199, 5, 107, 7, 547, 263, 11, 11, 17, 13, 31, 41, 53, 17, 83, 19, 199, 643, 563, 23, 199, 547, 643, 1301, 227, 29, 563, 31, 643, 439, 59, 643, 199, 37, 199, 563, 269, 41, 107, 43, 199, 643, 643, 47, 197, 199, 149, 439, 199, 53, 547, 131, 269, 131, 227, 59
Offset: 1

Views

Author

Jason Earls, Jun 15 2004

Keywords

Comments

If n is prime, a(n) = n. - Robert Israel, Oct 27 2016

Crossrefs

Cf. A094830.

Programs

  • Maple
    f:= proc(n) local x, t;
      x:= n;
      do
       if isprime(x) then return x fi;
       x:= x + add(t^2, t = convert(x,base,10))
      od;
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 27 2016
  • Mathematica
    p2[n_]:=NestWhile[#+Total[IntegerDigits[#]^2]&,n,!PrimeQ[#]&]; Array[p2,60] (* Harvey P. Dale, Dec 03 2011 *)