OFFSET
1,1
COMMENTS
LINKS
T. D. Noe and Robert Israel, Table of n, a(n) for n = 1..7800 (n = 1..1000 from T. D. Noe)
Richard Ehrenborg and N. Bradley Fox, The Descent Set Polynomial Revisited, arXiv:1408.6858 [math.CO], 2014.
Norman B. Fox, Combinatorial Potpourri: Permutations, Products, Posets, and Pfaffians, University of Kentucky, Theses and Dissertations, Mathematics, Paper 25.
FORMULA
A000120(a(n)) = 3.
EXAMPLE
7 = 2^2 + 2^1 + 1
11 = 2^3 + 2^1 + 1
13 = 2^3 + 2^2 + 1
19 = 2^4 + 2^1 + 1
37 = 2^5 + 2^2 + 1
41 = 2^5 + 2^3 + 1
67 = 2^6 + 2^1 + 1
73 = 2^6 + 2^3 + 1
97 = 2^6 + 2^5 + 1
131 = 2^7 + 2^1 + 1
137 = 2^7 + 2^3 + 1
193 = 2^7 + 2^6 + 1
521 = 2^9 + 2^3 + 1
MAPLE
N:= 20: # to get all terms < 2^N
select(isprime, [seq(seq(2^i+2^j+1, j=1..i-1), i=1..N-1)]); # Robert Israel, May 17 2016
MATHEMATICA
Select[Flatten[Table[2^i + 2^j + 1, {i, 21}, {j, i-1}]], PrimeQ] (* Alonso del Arte, Jan 11 2011 *)
PROG
(PARI) do(mx)=my(v=List(), t); for(i=2, mx, for(j=1, i-1, if(ispseudoprime(t=2^i+2^j+1), listput(v, t)))); Vec(v) \\ Charles R Greathouse IV, Jan 02 2014
(PARI) is(n)=hammingweight(n)==3 && isprime(n) \\ Charles R Greathouse IV, Aug 28 2017
(PARI) A81091=[7]; next_A081091(p, i=exponent(p), j=exponent(p-2^i))=!until(isprime(2^i+2^j+1), j++>=i && i++ && j=1)+2^i+2^j
A081091(n)={for(k=#A81091, n-1, A81091=concat(A81091, next_A081091(A81091[k]))); A81091[n]} \\ M. F. Hasler, Mar 03 2023
(Haskell)
a081091 n = a081091_list !! (n-1)
a081091_list = filter ((== 1) . a010051') a014311_list
-- Reinhard Zumkeller, May 03 2012
(Python)
from itertools import count, islice
from sympy import isprime
from sympy.utilities.iterables import multiset_permutations
def A081091_gen(): # generator of terms
return filter(isprime, map(lambda s:int('1'+''.join(s)+'1', 2), (s for l in count(1) for s in multiset_permutations('0'*(l-1)+'1'))))
KEYWORD
nonn,easy,changed
AUTHOR
Reinhard Zumkeller, Mar 05 2003
STATUS
approved