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.

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).

This page as a plain text file.
%I A288469 #17 Jun 09 2017 20:51:30
%S A288469 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,
%T A288469 28,10,30,1,32,33,34,35,36,12,38,39,40,6,42,14,44,45,46,15,48,49,50,
%U A288469 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
%N 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).
%C A288469 a(n) = 1 for n in A007097. - _Robert Israel_, Jun 09 2017
%H A288469 Charles R Greathouse IV, <a href="/A288469/b288469.txt">Table of n, a(n) for n = 1..10000</a>
%F A288469 From _Robert Israel_, Jun 09 2017: (Start)
%F A288469 a(n) = n + A010051(n)*(a(A000720(n))-n).
%F A288469 a(A114537(n,k)) = A114537(n,1). (End)
%e A288469 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.
%p A288469 f:= proc(n) option remember; if isprime(n) then procname(numtheory:-pi(n)) else n fi end proc:
%p A288469 map(f, [$1..100]); # _Robert Israel_, Jun 09 2017
%t A288469 Table[If[!PrimeQ@ n, n, NestWhile[PrimePi, n, PrimeQ]], {n, 86}] (* _Michael De Vlieger_, Jun 09 2017 *)
%o A288469 (PARI) a(n)=while(isprime(n), n=primepi(n)); n \\ _Charles R Greathouse IV_, Jun 09 2017
%Y A288469 Cf. A000720, A007097, A010051, A114537.
%K A288469 nonn
%O A288469 1,4
%A A288469 _Peter Weiss_, Jun 09 2017