[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A116533 revision #7

A116533
a(1)=1, a(2)=2, for n>2 if a(n-1) is prime, then a(n)=2*a(n-1), otherwise a(n)=a(n-1)-1.
14
1, 2, 4, 3, 6, 5, 10, 9, 8, 7, 14, 13, 26, 25, 24, 23, 46, 45, 44, 43, 86, 85, 84, 83, 166, 165, 164, 163, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 634, 633, 632, 631, 1262, 1261, 1260, 1259, 2518, 2517, 2516, 2515, 2514, 2513, 2512, 2511, 2510, 2509, 2508
OFFSET
1,2
COMMENTS
For n>=3, using Wilson's theorem, a(n)=a(n-1)+ (-1)^r*gcd(a(n-1), W), where W = A038507(a(n-1)-1), and r=1 if gcd(a(n-1),W) = 1 and r=0 otherwise. - Vladimir Shevelev, Aug 07 2009
MAPLE
a[1]:=1: a[2]:=2: for n from 3 to 60 do if isprime(a[n-1])=true then a[n]:=2*a[n-1] else a[n]:=a[n-1]-1 fi od: seq(a[n], n=1..60); - Emeric Deutsch, Apr 02 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Rodolfo Kurchan, Mar 26 2006
EXTENSIONS
More terms from Emeric Deutsch, Apr 02 2006
STATUS
proposed