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.

A104738 Positions of records in A104706.

This page as a plain text file.
%I A104738 #53 Sep 21 2023 19:26:56
%S A104738 1,2,3,5,6,9,11,15,17,21,24,29,30,39,41,51,54,59,66,75,77,87,96,105,
%T A104738 107,120,129,137,141,161,165,180,186,201,209,221,227,249,255,270,285,
%U A104738 306,311,324,336,359,366,390,401,420,435,459,465,495,501,527,534
%N A104738 Positions of records in A104706.
%C A104738 The entries in this sequence are the same as the partial sums of the independently derived A204539, for reasons unknown at present. - _Colm Fagan_, Jan 23 2012
%H A104738 Robert Israel, <a href="/A104738/b104738.txt">Table of n, a(n) for n = 1..5000</a>
%t A104738 A104706 = NestList[Rest[Insert[#, #[[1]], 2 + 2 #[[1]]]]&, Range[m = 1000], m][[All, 1]];
%t A104738 rec = 0; Reap[For[k = 1, k <= Length[A104706], k++, ak = A104706[[k]]; If[ak > rec, rec = ak; Sow[k]]]][[2, 1]] (* _Jean-François Alcover_, Apr 11 2019, after _Birkas Gyorgy_ in A104706 *)
%o A104738 (BASIC) n=n+1; temp1=n^2; for k=(n-1) step -1 to 2; temp2=int(temp1/k); temp1=k*temp2; if int((temp2+k)/2))*2<>(temp2+k) then temp1=temp1-k; next k; a(n-1)=temp1/4 ' _Colm Fagan_, Nov 08 2015
%o A104738 (PARI) a(n) = {n++; temp1 = n^2; forstep (k= n-1, 2, -1, temp2 = temp1\k; temp1 = k*temp2; if (((temp2+k)\2)*2 != (temp2+k), temp1 -= k)); temp1/4;} \\ after Basic; _Michel Marcus_, Dec 04 2015
%o A104738 (MATLAB)
%o A104738 function [ A ] = A104738( N )
%o A104738 % Produce a(1) : a(N)
%o A104738 M = N;
%o A104738 R = [1:M];
%o A104738 v = 1;
%o A104738 A = 1;
%o A104738 count = 1;
%o A104738 n = 1;
%o A104738 while count < N
%o A104738     n = n+1;
%o A104738     if 2*R(1)+1 > M
%o A104738         R = [R, (M+1):M+N];
%o A104738     end
%o A104738     R = [R(2:2*R(1)+1), R(1), R((2*R(1)+2) : M)];
%o A104738     if R(1) > v
%o A104738         A = [A, n];
%o A104738         v = R(1);
%o A104738         count = count+1;
%o A104738     end
%o A104738 end
%o A104738 end;
%o A104738 A104738(100)
%Y A104738 Cf. A104706, A104737, A104739, A204539.
%Y A104738 See A002491 for a conjectured connection to this sequence.
%K A104738 nonn
%O A104738 1,2
%A A104738 _Zak Seidov_, Mar 21 2005
%E A104738 Extended by _Ray Chandler_, Jan 19 2012