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.

A082433 a(n) = A072181(n) - p, where p is the largest prime < A072181(n) - 1.

This page as a plain text file.
%I A082433 #18 Sep 06 2021 03:11:40
%S A082433 3,5,7,7,11,11,11,11,13,23,17,17,17,41,191,47,31,53,53,53,31,179,61,
%T A082433 61,337,131,523,523,419,223,223,223,223,79,3821,3821,3821,23399,21269,
%U A082433 21269,3607
%N A082433 a(n) = A072181(n) - p, where p is the largest prime < A072181(n) - 1.
%C A082433 Are all terms prime?
%C A082433 All terms are odd. - _Michael S. Branicky_, Sep 05 2021
%e A082433 a(4) = A072181(4)-7 = 12-7 = 5.
%o A082433 (Python)
%o A082433 from sympy import factorint, isprime
%o A082433 def afindn(terms):
%o A082433     prev_factors, prevan, prevk, n = dict(), 1, None, 2
%o A082433     for n in range(2, terms+1):
%o A082433         n_factors, an = factorint(n), 1
%o A082433         for pi in set(prev_factors.keys()) | set(n_factors.keys()):
%o A082433             ei = prev_factors[pi] if pi in prev_factors else 1
%o A082433             fi = n_factors[pi] if pi in n_factors else 1
%o A082433             an *= pi**(ei*fi)
%o A082433         if n >= 3:
%o A082433             if an != prevan:
%o A082433                 k = 3
%o A082433                 while not isprime(an - k): k += 2
%o A082433             else:
%o A082433                 k = prevk
%o A082433             print(k, end=", ")
%o A082433             prevk = k
%o A082433         prev_factors, prevan = factorint(an), an
%o A082433 afindn(36) # _Michael S. Branicky_, Sep 05 2021
%Y A082433 Cf. A005235, A037153, A037155, A072181, A082432.
%K A082433 nonn,more
%O A082433 3,1
%A A082433 _Naohiro Nomoto_, Apr 25 2003
%E A082433 a(36)-a(40) from _Jinyuan Wang_, Sep 05 2020
%E A082433 a(41)-a(43) from _Michael S. Branicky_, Sep 05 2021