OFFSET
1,5
COMMENTS
Form the product of the previous two terms and then subtract all other previous terms.
Additionally, with a(1)=1, a(2)=2, this gives: 1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10... cf. A008619.
MATHEMATICA
f[s_] := Block[{}, Append[s, s[[ -1]]s[[ -2]] - Plus @@ Drop[s, -2]]]; Nest[f, {1, 1}, 15] (* Robert G. Wilson v, May 26 2006 *)
PROG
(C) #include <stdio.h> #include <inttypes.h> int main (void) { int64_t n1=1; int64_t n2=1; int i; int64_t sum=0, next; printf("%lld, %lld, ", n1, n2); for (i=0; i<12; i++) { next=n1*n2-sum; sum+=n1; n1=n2; n2=next; printf("%lld, ", n2); } }
(PARI) {m=16; a=1; b=1; print1(a=1, ", ", b=1, ", "); v=[]; for(n=3, m, print1(k=a*b-sum(j=1, #v, v[j]), ", "); v=concat(v, a); a=b; b=k)} \\ Klaus Brockhaus
CROSSREFS
KEYWORD
sign
AUTHOR
Gabriel Finch (salsaman(AT)xs4all.nl), Apr 16 2006
EXTENSIONS
a(12) corrected; a(15) and a(16) from Klaus Brockhaus, Apr 17 2006
STATUS
approved