OFFSET
1,2
MAPLE
A020639 := proc(n) numtheory[factorset](n) ; min(op(%)) ; end proc:
A177929 := proc(n) option remember; if n = 1 then 4; else d1 := A020639(procname(n-1)-1) ; d2 := A020639(procname(n-1)+1) ; procname(n-1)+min(d1, d2) -1; end if; end proc:
A177930 := proc(n) d1 := A020639(A177929(n)-1) ; d2 := A020639(A177929(n)+1) ; min(d1, d2) ; end proc:
read("transforms") ; L := [seq(A177930(n), n=1..1300)] ; RECORDS(L)[2] ; # R. J. Mathar, May 31 2010
MATHEMATICA
lpf[n_] := FactorInteger[n][[1, 1]];
b[n_] := b[n] = If[n == 1, 4, b[n-1] + lpf[b[n-1]^2-1]-1];
Position[Table[b[n], {n, 1, 1000}], k_ /; PrimeQ[k-1] && PrimeQ[k+1]] // Flatten (* Jean-François Alcover, Feb 24 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, May 15 2010
EXTENSIONS
Extended by R. J. Mathar, May 31 2010
More terms from Jean-François Alcover, Feb 24 2024
STATUS
approved