|
Search: id:A077140
|
|
|
| A077140 |
|
a(1) = 1 and then add n to the previous term if n is coprime to the previous term else subtract n from the previous term. a(1) = 1 and a(n) = a(n-1) + n if G.C.D. (n,a(n-1) = 1 else a(n) = a(n-1) - n. |
|
+0 2
|
|
| 1, 3, 0, -4, 1, 7, 0, -8, 1, 11, 0, -12, 1, 15, 0, -16, 1, 19, 0, -20, 1, 23, 0, -24, 1, 27, 0, -28, 1, 31, 0, -32, 1, 35, 0, -36, 1, 39, 0, -40, 1, 43, 0, -44, 1, 47, 0, -48, 1, 51, 0, -52, 1, 55, 0
(list; graph; listen)
|
|
|
OFFSET
|
1,2
|
|
|
COMMENT
|
a[2k+1]=k+1 (mod 2), a[4k]=-4k, a[4k+2]=4k+3. Proof: If a[4k+3]=0 then a[4k+4]=-4k-4, a[4k+5]=1, a[4k+6]=1+4k+6, and again, a[4k+7]=0. - Ralf Stephan (ralf(AT)ark.in-berlin.de), Mar 18 2003
ABS(a(n)) = A003815(n). - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Oct 09 2007
|
|
FORMULA
|
a(1) = 1 and a(n) = a(n-1) + n if G.C.D. (n, a(n-1) = 1 else a(n) = a(n-1) - n.
G.f.: x(x^2-2x-1)/((x^2+1)^2*(x-1)). - Ralf Stephan (ralf(AT)ark.in-berlin.de), Mar 18 2003
a(n) = ((n+1) mod 2)*n + (floor ((n+(n mod 2))/2) mod 2). - Tj Wrenn (tjwrenn(AT)cs.utexas.edu), Apr 07 2005
|
|
PROGRAM
|
(PARI) v=vector(100):v[1]=1:for(k=2, 100, if(gcd(v[k-1], k)>1, v[k]=v[k-1]-k, v[k]=v[k-1]+k)):print(v)
|
|
CROSSREFS
|
Cf. A077141.
Adjacent sequences: A077137 A077138 A077139 this_sequence A077141 A077142 A077143
Sequence in context: A129718 A127375 A138376 this_sequence A003815 A131486 A127445
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Oct 30 2002
|
|
EXTENSIONS
|
More terms from Ralf Stephan (ralf(AT)ark.in-berlin.de), Mar 18 2003
|
|
|
Search completed in 0.002 seconds
|