|
|
A288469
|
|
a(n) = n if n is a nonprime, otherwise take the prime index of n and repeat until you get a nonprime which is then a(n).
|
|
3
|
|
|
1, 1, 1, 4, 1, 6, 4, 8, 9, 10, 1, 12, 6, 14, 15, 16, 4, 18, 8, 20, 21, 22, 9, 24, 25, 26, 27, 28, 10, 30, 1, 32, 33, 34, 35, 36, 12, 38, 39, 40, 6, 42, 14, 44, 45, 46, 15, 48, 49, 50, 51, 52, 16, 54, 55, 56, 57, 58, 4, 60, 18, 62, 63, 64, 65, 66, 8, 68, 69, 70, 20, 72, 21, 74, 75, 76, 77, 78, 22, 80, 81, 82, 9, 84, 85, 86
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n = 17: 17 is a prime, so you take the prime index of 17 which is 7. 7 is a prime, so you take the prime index of 7 which is 4. 4 is a nonprime, so a(17) = 4.
|
|
MAPLE
|
f:= proc(n) option remember; if isprime(n) then procname(numtheory:-pi(n)) else n fi end proc:
|
|
MATHEMATICA
|
Table[If[!PrimeQ@ n, n, NestWhile[PrimePi, n, PrimeQ]], {n, 86}] (* Michael De Vlieger, Jun 09 2017 *)
|
|
PROG
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|