login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A094877 Primes that are reached in A094830. 3

%I #16 Dec 15 2017 17:36:40

%S 2,2,3,199,5,107,7,547,263,11,11,17,13,31,41,53,17,83,19,199,643,563,

%T 23,199,547,643,1301,227,29,563,31,643,439,59,643,199,37,199,563,269,

%U 41,107,43,199,643,643,47,197,199,149,439,199,53,547,131,269,131,227,59

%N Primes that are reached in A094830.

%C If n is prime, a(n) = n. - _Robert Israel_, Oct 27 2016

%H Robert Israel, <a href="/A094877/b094877.txt">Table of n, a(n) for n = 1..10000</a>

%p f:= proc(n) local x, t;

%p x:= n;

%p do

%p if isprime(x) then return x fi;

%p x:= x + add(t^2, t = convert(x,base,10))

%p od;

%p end proc:

%p map(f, [$1..100]); # _Robert Israel_, Oct 27 2016

%t p2[n_]:=NestWhile[#+Total[IntegerDigits[#]^2]&,n,!PrimeQ[#]&]; Array[p2,60] (* _Harvey P. Dale_, Dec 03 2011 *)

%Y Cf. A094830.

%K easy,base,nonn

%O 1,1

%A _Jason Earls_, Jun 15 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 18:58 EDT 2024. Contains 371798 sequences. (Running on oeis4.)