|
|
A239708
|
|
Numbers of the form m = 2^i + 2^j, where i > j >= 0, such that m - 1 is prime.
|
|
9
|
|
|
3, 6, 12, 18, 20, 24, 48, 68, 72, 80, 132, 192, 258, 264, 272, 384, 1032, 1040, 1088, 1152, 1280, 2064, 2112, 4100, 4112, 4128, 4160, 5120, 6144, 8448, 16448, 20480, 32772, 32784, 32832, 33024, 33792, 65538, 65540, 65544, 65552, 65600, 66048, 73728, 81920, 262148, 262152, 262272, 262400, 263168, 266240, 294912, 524352, 528384, 786432
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Complement of the disjunction of A079696 with A187813. This means that a number m is a term if and only if b = 2 is the only base for which the base-b digital sum of m is b.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(1) = 3, since 3 = 2^1 + 2^0.
a(3) = 12, since 12 = 2^3 + 2^2.
|
|
PROG
|
(Smalltalk)
Answer: a(n)"
| a b i k m p q terms |
terms := OrderedCollection new.
b := 2.
p := 1.
k := 0.
m := 0.
[k < self] whileTrue:
[m := m + 1.
p := b * p.
q := 1.
i := 0.
[i < m and: [k < self]] whileTrue:
[i := i + 1.
a := p + q.
(a - 1) isPrime
ifTrue:
[k := k + 1.
terms add: a].
q := b * q]].
^terms at: self
-----------------
(Smalltalk)
A239708inv
"Answers a kind of inverse of A239708.
Usage: n A239708inv
| k |
k := 1.
[k A239708 < self] whileTrue: [k := k + 1].
^k - 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|