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.

A195508 Number of iterations in a Draim factorization of 2n+1.

This page as a plain text file.
%I A195508 #24 Nov 06 2019 12:38:25
%S A195508 1,2,3,1,5,6,1,8,9,1,11,2,1,14,15,1,2,18,1,20,21,1,23,3,1,26,2,1,29,
%T A195508 30,1,2,33,1,35,36,1,3,39,1,41,2,1,44,3,1,2,48,1,50,51,1,53,54,1,56,2,
%U A195508 1,3,5,1,2,63,1,65,3,1,68,69,1,5,2,1,74,75,1,2,78,1,3,81,1,83,6,1,86,2,1,89,90,1,2,5,1,95,96,1,98,99
%N A195508 Number of iterations in a Draim factorization of 2n+1.
%C A195508 A Draim factorization determines the smallest divisor d of 2n+1 with simple operations (integer division, remainder, +, -, *) and needs a(n)=(d-1)/2 steps.
%C A195508 Least m>0 for which gcd(n+1+m, n-m) > 1.  [_Clark Kimberling_, Jul 18 2012]
%D A195508 H. Davenport, The Higher Arithmetics, 7th ed. 1999, Cambridge University Press, pp. 32-35.
%H A195508 Amiram Eldar, <a href="/A195508/b195508.txt">Table of n, a(n) for n = 1..10000</a>
%F A195508 a(n) = (A090368(n+1)-1)/2.
%e A195508 a(12)=2 because the Draim algorithm needs 2 steps to find the smallest divisor of 25=2*12+1; any a(n)=2 indicates a smallest divisor 5 of 2n+1.
%t A195508 a[n_] := Module[{m = 1}, While[GCD[n + m + 1, n - m] == 1, m++]; m]; Array[a, 100] (* _Amiram Eldar_, Nov 06 2019 *)
%o A195508 (Rexx)
%o A195508   SEQ = '' ;  do N = 1 to 50 ;  X = 2 * N + 1  ;  M = X
%o A195508    do Y = 3 by 2 until R = 0
%o A195508       Q = X % Y   ;  R = X // Y  ;  M = M - 2 * Q  ;  X = M + R
%o A195508    end Y ;  SEQ = SEQ (( Y - 1 ) / 2 ) ;  end N ;  say SEQ
%Y A195508 Cf. A090368.
%K A195508 nonn,easy
%O A195508 1,2
%A A195508 _Frank Ellermann_, Sep 19 2011