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.
%I A038025 #17 Apr 18 2020 17:28:25 %S A038025 1,1,1,1,4,1,1,1,1,9,10,1,12,1,1,9,1,1,1,1,4,21,22,1,24,25,1,27,27,1, %T A038025 1,1,16,1,16,35,32,1,38,9,10,25,33,25,1,45,27,1,25,49,44,25,24,1,1,9, %U A038025 34,27,1,49,24,1,58,57,64,49,8,49,65,51,48,49,72,69,68 %N A038025 Winner of n-th Littlewood Frog Race. %C A038025 For 0 < k <= n, gcd(n,k) = 1, let P(n,k) be the smallest prime of the form a*n+k, with a >= 0. "Frog" k0 is said to win "race" n if P(n,k0) is largest of the phi(n) values P(n,k). %C A038025 In case of draws of P(n,k) values take the largest k. - _R. J. Mathar_, Jul 26 2015 %p A038025 A038025P := proc(n,k) %p A038025 local a; %p A038025 for a from 0 do %p A038025 if isprime(a*n+k) then %p A038025 return a; %p A038025 end if; %p A038025 end do: %p A038025 end proc: %p A038025 A038025 := proc(n) %p A038025 local a,phimax,phi,k ; %p A038025 a :=0 ; %p A038025 phimax := 0 ; %p A038025 for k from 1 to n do %p A038025 if igcd(k,n) = 1 then %p A038025 phi := A038025P(n,k) ; %p A038025 if phi >= phimax then %p A038025 a := k; %p A038025 phimax := phi; %p A038025 end if; %p A038025 end if; %p A038025 od; %p A038025 a ; %p A038025 end proc: %p A038025 seq(A038025(n),n=1..100) ; # _R. J. Mathar_, Jul 26 2015 %t A038025 A038025P[n_, k_] := Module[{a}, For[a = 0, True, a++, If[PrimeQ[a n + k], Return[a]]]]; %t A038025 A038025[n_] := Module[{a = 0, phiMax = 0, phi, k}, For[k = 1, k <= n, k++, If [GCD[k, n] == 1, phi = A038025P[n, k]; If[phi >= phiMax, a = k; phiMax = phi]]]; a]; %t A038025 Array[A038025, 100] (* _Jean-François Alcover_, Apr 16 2020, after _R. J. Mathar_ *) %Y A038025 Cf. A038026, A038029 (records). %K A038025 nonn %O A038025 1,5 %A A038025 _Christian G. Bower_ from a problem by _David W. Wilson_