|
|
A089750
|
|
a(n) = the first prime in the orbit of n under f(n) = n + the first prime > n, or 0 if no such prime exists.
|
|
1
|
|
|
3, 2, 3, 43, 5, 13, 7, 19, 43, 379, 11, 113, 13, 31, 18749, 2341, 17, 37, 19, 43, 379, 788941, 23, 53, 113, 241, 511213, 4089763, 29, 61, 31, 18749, 2341, 71, 601, 73, 37, 79, 163, 331, 41, 353, 43, 379, 788941, 403941973, 47, 101, 13499, 103, 211
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Note that a(n) = n when n is prime.
Question: Is a(n) > 0 for all n? I do not have a value for a(46).
a(46)=403941973, a(52)=31626333786385669717. - Michel Marcus, May 19 2013
|
|
LINKS
|
|
|
EXAMPLE
|
4 -> 4 + (first prime > 4) = 4 + 5 = 9 -> 9 + 11 = 20 -> 20 + 23 = 43 (prime). So a(4) = 43.
|
|
MAPLE
|
f:= proc(n) local k;
k:= n;
while not isprime(k) do k:= k + nextprime(k) od;
k
end proc:
|
|
MATHEMATICA
|
a[n_] := NestWhile[# + NextPrime[#]&, n, CompositeQ];
|
|
PROG
|
(PARI) a(n) = {while(! isprime(n), n = n + nextprime(n+1); ); return (n); } \\ Michel Marcus, May 19 2013
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|