A179739 a(n) = 2*h(n)-1 where h(n) is the sequence of records positions of A179738.
3, 5, 7, 11, 13, 31, 37
Offset: 2
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.
For n=5 we take x=A001651(4)=7. The iteration yields 1, 7<+>1=8, 7<+>8=5, 7<+>5=4, 7<+>4=11, 7<+>11=2, 7<+>2=1. We have reached the 1 of the beginning and therefore a cycle of length a(5)=6.
A038502 := proc(n) a := 1; for p in ifactors(n)[2] do if op(1,p) <> 3 then a := a*op(1,p)^op(2,p) ; end if; end do; a ; end proc: A179787aux := proc(x,y) local xtrack,xitr,xpos ; xtrack := [y] ; while true do xitr := A038502(op(-1,xtrack)+x) ; if not member(xitr, xtrack,'xpos') then xtrack := [op(xtrack),xitr] ; else return 1+nops(xtrack)-xpos ; end if; end do: end proc: A001651 := proc(n) option remember; if n <=2 then n; else procname(n-2)+3 ; end if; end proc: A179787 := proc(n) A179787aux(A001651(n),1) ; end proc: seq(A179787(n),n=1..80) ; # R. J. Mathar, Nov 04 2010
Comments