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.

A073832 k between A001359(n) and A001359(n+1) such that A073830(k) is maximal.

This page as a plain text file.
%I A073832 #24 Aug 14 2024 08:37:15
%S A073832 4,7,13,23,37,53,67,97,103,131,139,173,181,193,223,233,263,277,307,
%T A073832 337,409,421,457,509,563,593,613,631,653,797,811,823,853,877,1013,
%U A073832 1021,1039,1051,1087,1129,1223,1259,1283,1297,1307,1423,1447,1471,1483,1601
%N A073832 k between A001359(n) and A001359(n+1) such that A073830(k) is maximal.
%C A073832 A073830(a(n)) = A073831(n).
%H A073832 Michael S. Branicky, <a href="/A073832/b073832.txt">Table of n, a(n) for n = 1..2600</a>
%p A073832 A073832 := proc(n)
%p A073832     local k,kmx,a ;
%p A073832     kmx := 0 ;
%p A073832     a := A001359(n)+1 ;
%p A073832     for k from A001359(n)+1 to A001359(n+1)-1 do
%p A073832         if A073830(k) > kmx then
%p A073832             a := k ;
%p A073832             kmx := A073830(k) ;
%p A073832         end if;
%p A073832     end do:
%p A073832     a ;
%p A073832 end proc:
%p A073832 seq(A073832(n),n=1..50) ; # _R. J. Mathar_, Feb 21 2017
%t A073832 f[n_] := Mod[4*((n - 1)! + 1) + n, n*(n + 2)];
%t A073832 pp = Select[Prime[Range[300]], PrimeQ[# + 2] & ];
%t A073832 a[n_] := MaximalBy[Range[pp[[n]], pp[[n + 1]]], f];
%t A073832 Array[a, Length[pp] - 1] // Flatten (* _Jean-François Alcover_, Feb 22 2018 *)
%o A073832 (Python)
%o A073832 from math import factorial
%o A073832 from itertools import islice, pairwise
%o A073832 from sympy import isprime, nextprime, primerange
%o A073832 def f(n): return (4*(factorial(n-1) + 1) + n)%(n*(n + 2))
%o A073832 def bgen(): # generator of A001359
%o A073832     p, q = 2, 3
%o A073832     while True:
%o A073832         if q - p == 2: yield p
%o A073832         p, q = q, nextprime(q)
%o A073832 def agen(): # generator of terms
%o A073832     for p, q in pairwise(bgen()):
%o A073832         yield max((f(k), k) for k in range(p+1, q))[1]
%o A073832 print(list(islice(agen(), 80))) # _Michael S. Branicky_, Aug 13 2024
%K A073832 nonn
%O A073832 1,1
%A A073832 _Reinhard Zumkeller_, Aug 12 2002