%I #13 Apr 22 2021 22:11:59
%S 1,9,56,320,1624,7152,26016,72912,140704,140704
%N Number of unlock patterns of length n for the Android operating system.
%C Since Android unlock patterns must have length between 4 and 9 (inclusive), there are a(4) + ... + a(9) = 389112 total Android unlock patterns. - _Nathaniel Johnston_, Jan 10 2014
%H Blog, <a href="http://themagicofscience.blogspot.com/2009/08/counting-unlock-patterns.html">Counting Unlock Patterns</a>
%H StackOverflow, <a href="https://stackoverflow.com/a/34606243/5821790">Number of possible paths in android pattern lock</a>, Jan 5, 2016
%H Yoyo Zhou, <a href="http://www.quora.com/How-many-combinations-does-Android-9-point-unlock-have/answer/Yoyo-Zhou">How many combinations does Android 9 point unlock have?</a>
%e There are 9 points to start a unlock pattern with. So there are 9 paths of length 1. Therefore a(1) = 9.
%o (Python)
%o def f(p, s, x={1:{3:2,7:4,9:5},2:{8:5},3:{1:2,7:5,9:6},4:{6:5},5:{},6:{4:5},7:{1:4,3:5,9:8},8:{2:5},9:{1:5,3:6,7:8}}):
%o return int(s==0) or sum(f(p+[n], s-1) for n in (n for n in range(1,10) if (not p or n not in p and (n not in x[p[-1]] or x[p[-1]][n] in p))))
%o print([f([], s) for s in range(10)]) # _Matej Veselovac_, Mar 16 2021, based on StackOverflow entry for Jan 5, 2016
%K fini,full,nonn
%O 0,2
%A Daan van Berkel (daan.v.berkel.1980(AT)gmail.com), Aug 06 2009
%E a(4) corrected by _Nathaniel Johnston_, Jan 10 2014