OFFSET
0,1
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..4096
Geeks for Geeks, Count Distinct Subsequences
PROG
(PARI) a(n)={if(!n, 2, my(M=Map(Mat([1, 1]))); while(n, my(R=Mat(M)[, 1]); for(i=1, #R, mapput(M, bitor(R[i]<<1, bittest(n, 0)), 1)); n>>=1); #M)} \\ Andrew Howroyd, Mar 01 2020
(PARI) a(n)={if(!n, 2, my(p=vector(2), s=1); while(n, my(k=1+bitand(n, 1), t=s); s = 2*s-p[k]; p[k] = t; n>>=1); s)} \\ Andrew Howroyd, Mar 26 2020
CROSSREFS
KEYWORD
AUTHOR
N. J. A. Sloane, Oct 18 2017
EXTENSIONS
Terms a(50) and beyond from Andrew Howroyd, Mar 01 2020
STATUS
approved