A272464 Fractal sequence related to Stern's diatomic sequence (A002487).
1, 1, 2, 1, 3, 2, 1, 4, 3, 5, 2, 1, 4, 7, 3, 8, 5, 2, 1, 4, 11, 7, 10, 3, 8, 13, 5, 2, 1, 4, 15, 11, 18, 7, 17, 10, 3, 8, 21, 13, 5, 2, 1, 4, 19, 15, 26, 11, 29, 18, 25, 7, 24, 17, 27, 10, 3, 8, 21, 34, 13, 5, 2, 1, 4, 23, 19, 15, 41, 26, 37, 11, 40, 29, 47
Offset: 1
Examples
a(2)=1; the previous occurrence of a(n)=1 is a(1). Therefore a(3)=a(1)+a(2)=2, because 2 did not occur earlier in the sequence, and a(4)=a(2)=1. The terms may be displayed as a triangle, starting a new row when a 1 appears: 1; 1, 2; 1, 3, 2; 1, 4, 3, 5, 2; 1, 4, 7, 3, 8, 5, 2...
Links
- Max Barrentine, Table of n, a(n) for n = 1..8204
Crossrefs
Cf. A002487.
Van Eck's sequence A181391 has a somewhat similar flavor. - N. J. A. Sloane, May 03 2016
Programs
-
PARI
findprec(v) = {lastn = #v; forstep(k=lastn-1, 1, -1, if (v[k] == v[lastn], return (k)););} lista(nn) = {v = [1, 1]; for (n= 1, nn, k = findprec(v); if (! vecsearch(vecsort(v,,8), v[k]+v[k+1]), v = concat(v, v[k]+v[k+1]); v = concat(v, v[k+1]), v = concat(v, v[k+1]));); print(v);} \\ Michel Marcus, May 02 2016
Formula
For a(n)=a(k) for largest k
If a(k)+a(k+1)≠a(m), then a(n+1)=a(k)+a(k+1), a(n+2)=a(k+1);
If a(k)+a(k+1)=a(m), then a(n+1)=a(k+1).
a(1)=a(2)=1.
Extensions
Definition revised by N. J. A. Sloane, May 03 2016
Comments