A249357 Fibonacci-Zumkeller numbers: a(n)=n if n<=3, otherwise the smallest number >= a(n-2) + a(n-1) having at least one common factor with a(n-2), but none with a(n-1).
1, 2, 3, 8, 15, 26, 45, 74, 123, 200, 327, 530, 861, 1396, 2259, 3656, 5919, 9578, 15501, 25082, 40587, 65672, 106263, 171938, 278211, 450151, 728367, 1178527, 1906896, 3085439, 4992336, 8077783, 13070121, 21147910, 34218033, 55365944, 89583981, 144949928, 234533913, 379483844, 614017761, 993501608
Offset: 1
Keywords
Examples
a(3)+a(4)=3+8=11. However, gcd(11,3)=1, further, gcd(12,8)>1, gcd(13,3)=1, gcd(14,8)>1, finally, gcd(15,3)>1 and gcd(15,8)=1. Thus 15 is the smallest number >11 which satisfies the definition. So a(5)=15.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..500
Programs
-
Haskell
a249357 n = a249357_list a249357_list = 1 : 2 : 3 : f 2 3 where f u v = y : f v y where y = head [x | x <- [u + v ..], gcd x u > 1, gcd x v == 1] -- Reinhard Zumkeller, Dec 04 2014
-
Maple
for n from 1 to 3 do a[n]:= n od: for n from 4 to 100 do for k from a[n-1]+a[n-2] do if igcd(k,a[n-2]) > 1 and igcd(k,a[n-1]) = 1 then a[n]:= k; break fi od od: seq(a[n],n=1..100); # Robert Israel, Dec 03 2014
-
Mathematica
A249357={1,2,3};Do[AppendTo[A249357,NestWhile[#+1&,A249357[[-1]]+A249357[[-2]],!(GCD[#,A249357[[-1]]]==1&&GCD[#,A249357[[-2]]]>1)&]],{50}];A249357 (* Peter J. C. Moses, Dec 03 2014 *)
-
PARI
a(n, show=1, a=3, o=2)={n<3&&return(n); show&&print1("1,2"); for(i=4,n, show&&print1(","a); k=a+o; until(gcd(k,o)>1 && gcd(k,a)==1,k++); o=a; a=k); a} \\ M. F. Hasler, Dec 03 2014
-
Python
from math import gcd A249357_list, l1, l2 = [1,2,3], 3, 2 for _ in range(100): i = l1+l2 while True: if gcd(i,l1) == 1 and gcd(i,l2) > 1: A249357_list.append(i) l2, l1 = l1, i break i += 1 # Chai Wah Wu, Dec 04 2014
Extensions
More terms from M. F. Hasler, Dec 03 2014
Comments