The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A337123 a(n) is the number of primes p in the n-digit "signed nonadjacent form" such that p has 3 or fewer nonzero digits. 1
 0, 1, 2, 1, 4, 5, 7, 5, 9, 8, 12, 7, 11, 7, 11, 9, 14, 10, 18, 11, 21, 7, 9, 11, 16, 4, 8, 9, 7, 12, 18, 13, 14, 11, 10, 9, 18, 7, 12, 10, 18, 12, 22, 5, 11, 13, 16, 13, 22, 8, 9, 16, 13, 9, 13, 14, 10, 11, 10, 10, 20, 15, 9, 10, 13, 8, 22, 10, 10, 10, 12, 13 (list; graph; refs; listen; history; text; internal format)
 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 Cf. A334913, A337124. Sequence in context: A159287 A252448 A021992 * A292388 A261035 A080030 Adjacent sequences:  A337120 A337121 A337122 * A337124 A337125 A337126 KEYWORD base,nonn AUTHOR Lei Zhou, Aug 17 2020 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified July 26 02:10 EDT 2021. Contains 346294 sequences. (Running on oeis4.)