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.

A085818 For n > 1: a(n) = p if n = p^e with p prime and e > 1, otherwise a(n) = (n-m)-th prime, where m = number of nonprime prime powers <= n; a(1)=1.

This page as a plain text file.
%I A085818 #21 Aug 20 2024 13:19:32
%S A085818 1,2,3,2,5,7,11,2,3,13,17,19,23,29,31,2,37,41,43,47,53,59,61,67,5,71,
%T A085818 3,73,79,83,89,2,97,101,103,107,109,113,127,131,137,139,149,151,157,
%U A085818 163,167,173,7,179,181,191,193,197,199,211,223,227,229,233,239,241
%N A085818 For n > 1: a(n) = p if n = p^e with p prime and e > 1, otherwise a(n) = (n-m)-th prime, where m = number of nonprime prime powers <= n; a(1)=1.
%C A085818 a(n) = A025473(n) if n = p^e with p prime and e > 1, otherwise a(n) = A008578(n-A085501(n));
%C A085818 n divides A085819(n) = Product_{k<=n} a(k), as by construction: a(1)=1; if n divides A085819(n-1) then a(n) = smallest prime not occurring earlier; if n does not divide A085819(n-1) then a(n) = greatest prime factor of n (A006530);
%C A085818 A000040 occurs infinitely many times as a subsequence.
%C A085818 a(A085971(n))=A000040(n) and for all k > 1: a(A000040(n)^k)=A000040(n); A085985(n)=A049084(a(n)). - _Reinhard Zumkeller_, Jul 06 2003
%H A085818 Michel Marcus, <a href="/A085818/b085818.txt">Table of n, a(n) for n = 1..10000</a>
%o A085818 (PARI) f(n) = 1 + sum(k=2, n, isprimepower(k) && !isprime(k));  \\ A085501
%o A085818 a(n) = {if (n==1, return (1)); my(p); if (isprimepower(n, &p) && !isprime(n), p, prime(n-f(n)));} \\ _Michel Marcus_, Jan 28 2021
%o A085818 (Python)
%o A085818 from sympy import primefactors, prime, primepi, integer_nthroot
%o A085818 def A085818(n): return 1 if n==1 else (f[0] if len(f:=primefactors(n))==1 and f[0]<n else prime(n-1-sum(primepi(integer_nthroot(n,k)[0]) for k in range(2,n.bit_length())))) # _Chai Wah Wu_, Aug 20 2024
%Y A085818 Cf. A000040, A008578, A085971.
%Y A085818 Cf. A006530, A025473, A085501, A085819, A085985, A049084.
%K A085818 nonn
%O A085818 1,2
%A A085818 _Reinhard Zumkeller_, Jul 04 2003