OFFSET
1,3
COMMENTS
Sign nonadjacent form notation is defined by the publications listed in the reference.
We use abbreviation SNF for "signed nonadjacent form" notation.
This is an expansion of A337124 to include 2 and primes in the form of 2^k+1 and 2^k-1.
REFERENCES
Joerg Arndt, Matters Computational - Ideas, Algorithms, Source Code, 2011, Springer, pp. 61-62.
LINKS
H. Prodinger, On binary representations of integers with digits -1,0,1, Integers 0 (2000), #A08.
EXAMPLE
There is only one number in single-digit SNF notation, which is 1 and 1 is not a prime. So a(1)=0;
There is only one number in the two-digit SNF notation, which is 10 = 2 base 10 and it is a prime with one nonzero digit. So a(2)=1;
There are three numbers in three digits SNF notation: 10T = 3 base 10, 100 = 4 base 10, and 101 = 5 base 10. There are two prime numbers among 3, 4, and 5 and both of them have two nonzero digits. So a(3)=2;
...
For seven-digit SNF numbers, 10T0T0T = 43 base 10 has 4 nonzero digits (excluded); 10T000T = 47 base 10 has 3 nonzero digits (included). Thereafter 10T0101 = 53: 4 digits, excluded; 1000T0T = 59: 3 digits, included; 1000T01 = 61: 3 digits, included; 100010T = 67: 3 digits, included; 100100T = 71: 3 digits, included; 1001001 = 73, 3 digits, included; 101000T = 79: 3 digits, included; 101010T = 83, 4 digits, excluded. In total, 7 numbers fit the definition. So a(7)=7.
MATHEMATICA
Table[s1=2^(n-1); ct=0; If[n>1, If[PrimeQ[s1+1], ct++]; If[PrimeQ[s1-1], ct++]; If[n>=5, Do[s2=2^i; If[PrimeQ[s1+s2+1], ct++]; If[PrimeQ[s1+s2-1], ct++]; If[PrimeQ[s1-s2+1], ct++]; If[PrimeQ[s1-s2-1], ct++], {i, 2, n-3}]]]; ct, {n, 1, 72}]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Lei Zhou, Aug 17 2020
STATUS
approved