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!)
A261301 a(n+1) = abs(a(n) - gcd(a(n), n)), a(1) = 1. 21

%I #19 Sep 08 2015 02:22:08

%S 1,0,2,1,0,5,4,3,2,1,0,11,10,9,8,7,6,5,4,3,2,1,0,23,22,21,20,19,18,17,

%T 16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,47,46,45,40,39,26,25,24,23,

%U 22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,79,78,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60

%N a(n+1) = abs(a(n) - gcd(a(n), n)), a(1) = 1.

%C The absolute value is relevant only when a(n) = 0 in which case a(n+1) = gcd(a(n),n) = n.

%C It is conjectured that a(n) = 0 implies that n is prime, see A186253. (This is the sequence {u(n)} mentioned there.)

%C a(A186253(n)-1) = 1; a(A186253(n)) = 0; a(A186253(n)+1) = A186253(n). - _Reinhard Zumkeller_, Sep 07 2015

%H Reinhard Zumkeller, <a href="/A261301/b261301.txt">Table of n, a(n) for n = 1..10000</a>

%e a(2) = a(1) - gcd(a(1),1) = 1 - 1 = 0.

%e a(3) = |a(2) - gcd(a(2),2)| = gcd(0,2) = 2 is prime.

%e a(3+2) = a(5) = 0, a(6) = gcd(0,5) = 5 is prime.

%e a(6+5) = a(11) = 0, a(12) = gcd(0,11) = 11 is prime.

%e a(12+11) = a(23) = 0, a(24) = 23 is prime.

%e a(24+23) = a(47) = 0, a(48) = 47 is prime.

%e a(50) = 45 and gcd(45,50) = 5, thus a(51) = 45 - 5 = 40.

%e a(52) = 39 and gcd(39,52) = 13, thus a(53) = 39 - 13 = 26. Then, a(53+26) = 0 and 79 = a(80) is prime.

%t FoldList[Abs[#1-GCD[#1,#2]]&,1,Range@96] (* _Ivan N. Ianakiev_, Aug 15 2015 *)

%o (PARI) print1(a=1);m=1;for(n=1,199, print1( ",",a=abs(a-gcd(a,n))))

%o (Haskell)

%o a261301 n = a261301_list !! (n-1)

%o a261301_list = 1 : map abs

%o (zipWith (-) a261301_list (zipWith gcd [1..] a261301_list))

%o -- _Reinhard Zumkeller_, Sep 07 2015

%Y Cf. A186253 - A186263, A261302 - A261310, A106108.

%K nonn

%O 1,3

%A _M. F. Hasler_, Aug 14 2015

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 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)