login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A299112 Record values in A243145. 1

%I #14 Oct 16 2020 08:47:08

%S 1,2,6,12,16,30,42,54,66,78,105,120,156,330,525,546,831,1071,1251,

%T 1386,1875,1890,2136,2241,2331,2541,2565,2736,2871,3165,3606,3885,

%U 4710,5106,5220,5505,6375,6390,6426,6615,6786,8310,8571,9066,10050,10176,10221,10611,11865,11955,12096

%N Record values in A243145.

%p f:= proc(n) local k;

%p for k from (n mod 2)+1 by 2 do

%p if isprime(n+k) and isprime(n+k^2) then return k fi

%p od

%p end proc:

%p f(1):= 1:

%p vmax:= 0: recvals:= NULL:

%p for n from 1 to 10^7 do

%p v:= f(n);

%p if v > vmax then

%p vmax:= v; recvals:= recvals, v;

%p fi

%p od:

%p recvals;

%t f[n_] := Module[{k}, For[k = Mod[n, 2]+1, True, k += 2, If[PrimeQ[n + k] && PrimeQ[n + k^2], Return [k]]]]; f[1] = 1;

%t vmax = 0;

%t Reap[For[n = 1, n <= 10^6, n++, v = f[n]; If[v > vmax, vmax = v; Print["n = ", n, " v = ", v]; Sow[v]]]][[2, 1]] (* _Jean-François Alcover_, Oct 16 2020, after Maple *)

%Y Cf. A243145, A299073.

%K nonn,more

%O 1,2

%A _Robert Israel_, Feb 02 2018

%E a(34)-a(51) from _Chai Wah Wu_, Sep 10 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 28 07:46 EDT 2024. Contains 372020 sequences. (Running on oeis4.)