OFFSET
1,2
COMMENTS
To construct Fibonacci-like sequence, we use a rule from the definition of A098550.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..500
EXAMPLE
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.
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
PROG
(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 fractions 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
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Dec 03 2014
EXTENSIONS
More terms from M. F. Hasler, Dec 03 2014
STATUS
approved